From 9cb1e39a19492ea377026d8200062ddc31aacb6e Mon Sep 17 00:00:00 2001 From: Giovanni LB Date: Mon, 24 Apr 2023 14:07:22 -0300 Subject: [PATCH] SWDEV-391616: Added network/file/off option for ATT analysis. Change-Id: I77d0d6d6652f0bf1b3f46d919aec5c17e29f3da7 [ROCm/rocprofiler commit: 55c6a2d4ad56f0082c3977f801c25cd1797b8658] --- projects/rocprofiler/bin/rocprofv2 | 2 +- projects/rocprofiler/plugin/att/att.py | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/projects/rocprofiler/bin/rocprofv2 b/projects/rocprofiler/bin/rocprofv2 index 47541ea091..d2229e2090 100755 --- a/projects/rocprofiler/bin/rocprofv2 +++ b/projects/rocprofiler/bin/rocprofv2 @@ -232,7 +232,7 @@ while [ 1 ] ; do ATT_ARGV="$ATT_ARGV $3 \"$4\"" shift shift - elif [[ "$3" = "--dumpfiles" || "$3" = "--ports" || "$3" = "--genasm" || "$3" == "--att_kernel" ]]; then + elif [[ "$3" = "--mode" || "$3" = "--ports" || "$3" = "--genasm" || "$3" == "--att_kernel" ]]; then ATT_ARGV="$ATT_ARGV $3 $4" shift shift diff --git a/projects/rocprofiler/plugin/att/att.py b/projects/rocprofiler/plugin/att/att.py index 1ad8ec4360..78123a3f5a 100755 --- a/projects/rocprofiler/plugin/att/att.py +++ b/projects/rocprofiler/plugin/att/att.py @@ -434,15 +434,25 @@ if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("assembly_code", help="Path of the assembly code") parser.add_argument("--trace_file", help="Filter for trace files", default=None, type=str) - parser.add_argument("--att_kernel", help="Kernel file", + parser.add_argument("--att_kernel", help="Kernel file", type=str, default=pathenv+'/*_kernel.txt') parser.add_argument("--ports", help="Server and websocket ports, default: 8000,18000") parser.add_argument("--genasm", help="Generate post-processed asm file at this path", type=str, default="") - parser.add_argument("--dumpfiles", help="Dont open server, \ - dump json files to disk instead.", default=False, action='store_true') + parser.add_argument("--mode", help='''ATT analysis modes:\n + off: Only run ATT collection, disable analysis.\n + file: dump json files to disk.\n + network: Open att server over the network.''', type=str, default="off") args = parser.parse_args() + if args.mode.lower() == 'file': + args.dumpfiles = True + elif args.mode.lower() == 'network': + args.dumpfiles = False + else: + print('Skipping analysis.') + quit() + global EVENT_NAMES with open(os.getenv("COUNTERS_PATH"), 'r') as f: lines = [l.split('//')[0] for l in f.readlines()]