Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: test/win/linker-flags/update_pgd.py

Issue 82703007: Support Visual C++ PGO in Ninja generator (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/win/linker-flags/pgo.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 # Copyright (c) 2013 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 from optparse import OptionParser
8 import glob
9 import os
10 import subprocess
11
12 parser = OptionParser()
13 parser.add_option('--exe', dest='exe')
14 parser.add_option('--vcbindir', dest='vcbindir')
15 parser.add_option('--pgd', dest='pgd')
16 (options, args) = parser.parse_args()
17
18 # Instrumented binaries fail to run unless the Visual C++'s bin dir is included
19 # in the PATH environment variable.
20 os.environ['PATH'] = os.environ['PATH'] + os.pathsep + options.vcbindir
21
22 # Run Instrumented binary. The profile will be recorded into *.pgc file.
23 subprocess.call([options.exe])
24
25 # Merge *.pgc files into a *.pgd (Profile-Guided Database) file.
26 subprocess.call(['pgomgr', '/merge', options.pgd])
27
28 # *.pgc files are no longer necessary. Clear all of them.
29 pgd_file = os.path.abspath(options.pgd)
30 pgd_dir = os.path.dirname(pgd_file)
31 (pgd_basename, _) = os.path.splitext(os.path.basename(pgd_file))
32 pgc_filepattern = os.path.join(pgd_dir, '%s!*.pgc' % pgd_basename)
33 pgc_files= glob.glob(pgc_filepattern)
34 for pgc_file in pgc_files:
35 os.unlink(pgc_file)
OLDNEW
« no previous file with comments | « test/win/linker-flags/pgo.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698