@@ -45,7 +45,7 @@ def clean(args):
45
45
def merge (args ):
46
46
parser = argparse .ArgumentParser (
47
47
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" ,
49
49
)
50
50
parser .add_argument ("profdata" , help = "Path to llvm-profdata tool" )
51
51
parser .add_argument ("output" , help = "Output filename" )
@@ -79,17 +79,14 @@ def merge_fdata(args):
79
79
def perf (args ):
80
80
parser = argparse .ArgumentParser (
81
81
prog = "perf-helper perf" ,
82
- description = "perf wrapper for BOLT/CSSPGO profile collection"
82
+ description = "perf wrapper for BOLT/CSSPGO profile collection" ,
83
83
)
84
84
parser .add_argument (
85
85
"--lbr" , action = "store_true" , help = "Use perf with branch stacks"
86
86
)
87
+ parser .add_argument ("--call-graph" , action = "store_true" , help = "Collect call graph" )
87
88
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"
93
90
)
94
91
parser .add_argument ("cmd" , nargs = argparse .REMAINDER , help = "" )
95
92
@@ -144,18 +141,19 @@ def perf2bolt(args):
144
141
145
142
def perf2prof (args ):
146
143
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
+ )
150
147
parser .add_argument ("profgen" , help = "Path to llvm-profgen binary" )
151
148
parser .add_argument ("binary" , help = "Input binary" )
152
149
parser .add_argument ("path" , help = "Path containing perf.data files" )
153
150
opts = parser .parse_args (args )
154
151
155
152
profgen_args = [opts .profgen , f"--binary={ opts .binary } " ]
156
153
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
+ )
159
157
return 0
160
158
161
159
0 commit comments