Changes

Jump to: navigation, search

PGO Related Bugs/Patches

2,225 bytes added, 15:00, 9 December 2008
468285
== 468285 ==
=== Patch 1 ===
This patch will stop the deletion of the profiled data.
<pre>
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -44,17 +44,21 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
default alldep all::
$(RM) -rf $(DIST)/sdk
$(RM) -rf $(DIST)/include
$(RM) -rf $(DIST)/private
$(RM) -rf $(DIST)/public
+# Do not clear this directory if second pass on profiledbuild
+ifndef MOZ_PROFILE_USE
$(RM) -rf $(DIST)/bin/components
+endif
+
$(RM) -rf _tests
TIERS += base
#
# tier "base" - basic setup
#
tier_base_dirs = \
 
</pre>
=== Patch 2 ===
This patch will merge any profile data into its corresponding program database.
<pre>
diff --git a/build/win32/pgomerge.py b/build/win32/pgomerge.py
--- a/build/win32/pgomerge.py
+++ b/build/win32/pgomerge.py
@@ -17,24 +17,26 @@ def MergePGOFiles(basename, pgddir, pgcd
containing basename!N.pgc files, which is probably dist/bin.
Calls pgomgr to merge each pgc file into the pgd, then deletes
the pgc files."""
if not os.path.isdir(pgddir) or not os.path.isdir(pgcdir):
return
pgdfile = os.path.abspath(os.path.join(pgddir, basename + ".pgd"))
if not os.path.isfile(pgdfile):
return
- for file in os.listdir(pgcdir):
- if file.startswith(basename) and file.endswith(".pgc"):
- try:
- pgcfile = os.path.normpath(os.path.join(pgcdir, file))
- subprocess.call(['pgomgr', '-merge',
- pgcfile,
- pgdfile])
- os.remove(pgcfile)
- except OSError:
- pass
+ for root, dirs, files in os.walk(pgcdir):
+ for dir in dirs:
+ for file in os.listdir(dir):
+ if file.startswith(basename) and file.endswith(".pgc"):
+ try:
+ pgcfile = os.path.normpath(os.path.join(pgcdir, file))
+ subprocess.call(['pgomgr', '-merge',
+ pgcfile,
+ pgdfile])
+ os.remove(pgcfile)
+ except OSError:
+ pass
if __name__ == '__main__':
if len(sys.argv) != 3:
print >>sys.stderr, "Usage: pgomerge.py <binary basename> <dist/bin>"
sys.exit(1)
MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2])
 
</pre>
1
edit

Navigation menu