@@ -45,7 +45,7 @@ def clean(args):
4545def merge (args ):
4646 parser = argparse .ArgumentParser (
4747 prog = "perf-helper merge" ,
48- description = "Merges all profraw files from path(s) into output"
48+ description = "Merges all profraw files from path(s) into output" ,
4949 )
5050 parser .add_argument ("profdata" , help = "Path to llvm-profdata tool" )
5151 parser .add_argument ("output" , help = "Output filename" )
@@ -79,17 +79,14 @@ def merge_fdata(args):
7979def perf (args ):
8080 parser = argparse .ArgumentParser (
8181 prog = "perf-helper perf" ,
82- description = "perf wrapper for BOLT/CSSPGO profile collection"
82+ description = "perf wrapper for BOLT/CSSPGO profile collection" ,
8383 )
8484 parser .add_argument (
8585 "--lbr" , action = "store_true" , help = "Use perf with branch stacks"
8686 )
87+ parser .add_argument ("--call-graph" , action = "store_true" , help = "Collect call graph" )
8788 parser .add_argument (
88- "--call-graph" , action = "store_true" , help = "Collect call graph"
89- )
90- parser .add_argument (
91- "--event" , help = "PMU event name, defaults to cycles:u" ,
92- default = "cycles:u"
89+ "--event" , help = "PMU event name, defaults to cycles:u" , default = "cycles:u"
9390 )
9491 parser .add_argument ("cmd" , nargs = argparse .REMAINDER , help = "" )
9592
@@ -144,18 +141,19 @@ def perf2bolt(args):
144141
145142def perf2prof (args ):
146143 parser = argparse .ArgumentParser (
147- prog = "perf-helper perf2prof" ,
148- description = "perf to CSSPGO prof conversion wrapper" ,
149- )
144+ prog = "perf-helper perf2prof" ,
145+ description = "perf to CSSPGO prof conversion wrapper" ,
146+ )
150147 parser .add_argument ("profgen" , help = "Path to llvm-profgen binary" )
151148 parser .add_argument ("binary" , help = "Input binary" )
152149 parser .add_argument ("path" , help = "Path containing perf.data files" )
153150 opts = parser .parse_args (args )
154151
155152 profgen_args = [opts .profgen , f"--binary={ opts .binary } " ]
156153 for filename in findFilesWithExtension (opts .path , "perf.data" ):
157- subprocess .check_call (profgen_args + [f"--perfdata={ filename } " ,
158- f"--output={ filename } .profraw" ])
154+ subprocess .check_call (
155+ profgen_args + [f"--perfdata={ filename } " , f"--output={ filename } .profraw" ]
156+ )
159157 return 0
160158
161159
0 commit comments