Got kernel summaries in rocscope integrated

Signed-off-by: coleramos425 <colramos@amd.com>
Cette révision appartient à :
Keith Lowery
2022-12-07 23:45:39 +00:00
révisé par coleramos425
Parent eadd35e5c6
révision 9e12acf79c
2 fichiers modifiés avec 36 ajouts et 0 suppressions
+25
Voir le fichier
@@ -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)
+11
Voir le fichier
@@ -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",