Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/nsprpub/build/win32/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  pgomerge.py   Sprache: Python

 
#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Usage: pgomerge.py <binary basename> <dist/bin>
# Gathers .pgc files from dist/bin and merges them into
# $PWD/$basename.pgd using pgomgr, then deletes them.
# No errors if any of these files don't exist.

import sys, os, os.path, subprocess
if not sys.platform == "win32":
    raise Exception("This script was only meant for Windows.")

def MergePGOFiles(basename, pgddir, pgcdir):
  """Merge pgc files produced from an instrumented binary
     into the pgd file for the second pass of profile-guided optimization
     with MSVC.  |basename| is the name of the DLL or EXE without the
     extension.  |pgddir| is the path that contains <basename>.pgd
     (should be the objdir it was built in).  |pgcdir| is the path
     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

if __name__ == '__main__':
  if len(sys.argv) != 3:
      print >>sys.stderr, "Usage: pgomerge.py "
      sys.exit(1)
  MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2])

Messung V0.5
C=97 H=92 G=94

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.