[llvm] [clang] [Clang][CMake] Add CSSPGO support to LLVM_BUILD_INSTRUMENTED (PR #79942)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 29 20:20:55 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r c34aa784f8867517315d8ef32a8038ee9dbb7165...90686f2cd5e210f9ca974c10f8c1224a825c1315 clang/utils/perf-training/perf-helper.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- perf-helper.py 2024-01-30 04:13:23.000000 +0000
+++ perf-helper.py 2024-01-30 04:20:47.870019 +0000
@@ -42,11 +42,11 @@
def merge(args):
parser = argparse.ArgumentParser(
prog="perf-helper merge",
- description="Merges all profraw files from path into output"
+ description="Merges all profraw files from path into output",
)
parser.add_argument("profdata", help="Path to llvm-profdata tool")
parser.add_argument("output", help="Output filename")
parser.add_argument("path", help="Folder containing input profraw files")
parser.add_argument("--sample", action="store_true", help="Sample profile")
@@ -74,21 +74,18 @@
def perf(args):
parser = argparse.ArgumentParser(
prog="perf-helper perf",
- description="perf wrapper for BOLT/CSSPGO profile collection"
+ description="perf wrapper for BOLT/CSSPGO profile collection",
)
parser.add_argument(
"--lbr", action="store_true", help="Use perf with branch stacks"
)
- parser.add_argument(
- "--call-graph", action="store_true", help="Collect call graph"
- )
- parser.add_argument(
- "--event", help="PMU event name, defaults to cycles:u",
- default="cycles:u"
+ parser.add_argument("--call-graph", action="store_true", help="Collect call graph")
+ parser.add_argument(
+ "--event", help="PMU event name, defaults to cycles:u", default="cycles:u"
)
parser.add_argument("cmd", nargs=argparse.REMAINDER, help="")
opts = parser.parse_args(args)
cmd = opts.cmd[1:]
@@ -139,22 +136,23 @@
return 0
def perf2prof(args):
parser = argparse.ArgumentParser(
- prog="perf-helper perf2prof",
- description="perf to CSSPGO prof conversion wrapper",
- )
+ prog="perf-helper perf2prof",
+ description="perf to CSSPGO prof conversion wrapper",
+ )
parser.add_argument("profgen", help="Path to llvm-profgen binary")
parser.add_argument("binary", help="Input binary")
parser.add_argument("path", help="Path containing perf.data files")
opts = parser.parse_args(args)
profgen_args = [opts.profgen, f"--binary={opts.binary}"]
for filename in findFilesWithExtension(opts.path, "perf.data"):
- subprocess.check_call(profgen_args + [f"--perfdata={filename}",
- f"--output={filename}.profraw"])
+ subprocess.check_call(
+ profgen_args + [f"--perfdata={filename}", f"--output={filename}.profraw"]
+ )
return 0
def dtrace(args):
parser = argparse.ArgumentParser(
``````````
</details>
https://github.com/llvm/llvm-project/pull/79942
More information about the cfe-commits
mailing list