From 9e12acf79c805a1c8bf25df899e38bb1314e49ed Mon Sep 17 00:00:00 2001 From: Keith Lowery Date: Wed, 7 Dec 2022 23:45:39 +0000 Subject: [PATCH] Got kernel summaries in rocscope integrated Signed-off-by: coleramos425 --- src/omniperf | 25 +++++++++++++++++++++++++ src/parser.py | 11 +++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/omniperf b/src/omniperf index 9032778ddc..b88416dfbf 100755 --- a/src/omniperf +++ b/src/omniperf @@ -357,6 +357,31 @@ def omniperf_profile(args): else: print("rocscope must be in the PATH") sys.exit(1) + elif not args.summaries == None and args.summaries == True: + print("creating kernel summaries") + #look for whether workload_dir exists - create if not + try: + os.makedirs(workload_dir, exist_ok = True) + except Exception as e: + print("Unable to create workload directory: ", workload_dir) + print(e) + sys.exit(1) + + result = subprocess.run(["which", "rocscope"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + if result.returncode == 0: + rs_cmd = [result.stdout.decode('ascii').strip(), + "summary", + "-p", args.path, + "-n", args.name, + "--", args.remaining] + print(rs_cmd) + result = subprocess.run(rs_cmd) #, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if result.returncode != 0: + print(result.stderr.decode('ascii')) + else: + print("rocscope must be in the PATH") + sys.exit(1) + else: for fname in glob.glob(workload_dir + "/perfmon/*.txt"): # Kernel filtering (in-place replacement) diff --git a/src/parser.py b/src/parser.py index ac62fd2995..f71b6258d3 100644 --- a/src/parser.py +++ b/src/parser.py @@ -125,6 +125,17 @@ def parse(my_parser): dest="lucky", help="\t\t\tProfile only the most time consuming kernels.", ) + + profile_group.add_argument( + "-s", + "--kernel-summaries", + required=False, + default=False, + action="store_true", + dest="summaries", + help="\t\t\tCreate kernel summaries.", + ) + profile_group.add_argument( "-b", "--ipblocks",