]> git.ozlabs.org Git - hiprofile/blobdiff - hiprofile.py
Add --opreport and --opannotate options
[hiprofile] / hiprofile.py
index f6456a4423297eada40b27a5431019dba6d11618..212fbf13e76a32e8dd26fdbb650fd387df5edb12 100644 (file)
@@ -174,7 +174,7 @@ class Binary(object):
                 lambda r: r.count, thresholds['symbol'])
         self.reference_dict = dict([ (r.name, r) for r in self.references ])
 
-    def annotate(self, report, conn):
+    def annotate(self, report, conn, options):
         fn_re = re.compile('^[0-9a-f]+\s+<[^>]+>: /\* (\S+) total:')
 
         symbols = [ s for s in self.references if s.name != '(no symbols)' ]
@@ -182,7 +182,7 @@ class Binary(object):
         if not symbols:
             return
 
-        command = ['opannotate', '--source', '--assembly',
+        command = [options.opannotate, '--source', '--assembly',
             '--include-file=' + self.name,
             '-i', ','.join([ s.name for s in symbols ])]
 
@@ -252,9 +252,9 @@ class Report(object):
         for binary in self.binaries:
             binary.threshold(thresholds)
 
-    def annotate(self, conn):
+    def annotate(self, conn, options):
         for binary in self.binaries:
-            binary.annotate(self, conn)
+            binary.annotate(self, conn, options)
 
     @staticmethod
     def parse(doc, hostname):
@@ -288,8 +288,8 @@ class Report(object):
         return report
 
     @staticmethod
-    def extract(connection):
-        fd = connection.execute(['opreport', '--xml'])
+    def extract(connection, options):
+        fd = connection.execute([options.opreport, '--xml'])
         doc = parseXML(fd)
 
         if connection.host: