From 5d74b142b6434cfeb2f0f1f75c42bee51bae375c Mon Sep 17 00:00:00 2001 From: coleramos425 Date: Wed, 16 Aug 2023 14:16:50 -0500 Subject: [PATCH] Prevent users from ipblock filtering in standalone GUI Signed-off-by: coleramos425 --- src/omniperf | 32 +++++++++++++++++------- src/omniperf_analyze/omniperf_analyze.py | 2 +- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/omniperf b/src/omniperf index 4689b02ac5..fc7c7cfa96 100755 --- a/src/omniperf +++ b/src/omniperf @@ -856,6 +856,20 @@ def main(): my_parser, "Access denied. Cannot access parent directories in path ../", ) + if args.filter_metrics and args.gui: + throw_parse_error( + my_parser, + """ + omniperf analyze --path [analyze options] + \n\n------------------------------------------------------------------------------- + \nExamples: + \n\tomniperf analyze -p workloads/vcopy/mi200/ --list-metrics gfx90a + \n\tomniperf analyze -p workloads/mixbench/mi200/ --filter-dispatch-ids 12 34 --decimal 3 + \n\tomniperf analyze -p workloads/mixbench/mi200/ --gui + \n-------------------------------------------------------------------------------\n + \ntool: error: --gui cannot be used in combination with: -b/--metric + """ + ) print("\n--------\nAnalyze\n--------\n") # Ensure absolute path for dir in args.path: @@ -877,15 +891,15 @@ def main(): throw_parse_error( my_parser, """ - omniperf analyze --path [analyze options] - \n\n------------------------------------------------------------------------------- - \nExamples: - \n\tomniperf analyze -p workloads/vcopy/mi200/ --list-metrics gfx90a - \n\tomniperf analyze -p workloads/mixbench/mi200/ --filter-dispatch-ids 12 34 --decimal 3 - \n\tomniperf analyze -p workloads/mixbench/mi200/ --gui - \n-------------------------------------------------------------------------------\n - \ntool: error: the following arguments are required: -p/--path - """, + omniperf analyze --path [analyze options] + \n\n------------------------------------------------------------------------------- + \nExamples: + \n\tomniperf analyze -p workloads/vcopy/mi200/ --list-metrics gfx90a + \n\tomniperf analyze -p workloads/mixbench/mi200/ --filter-dispatch-ids 12 34 --decimal 3 + \n\tomniperf analyze -p workloads/mixbench/mi200/ --gui + \n-------------------------------------------------------------------------------\n + \ntool: error: the following arguments are required: -p/--path + """, ) sys.exit(0) # Indicate successful on exit diff --git a/src/omniperf_analyze/omniperf_analyze.py b/src/omniperf_analyze/omniperf_analyze.py index 7e62556b17..ac06a5c8a8 100644 --- a/src/omniperf_analyze/omniperf_analyze.py +++ b/src/omniperf_analyze/omniperf_analyze.py @@ -268,7 +268,7 @@ def roofline_only(path_to_dir, dev_id, sort_type, mem_level, kernel_names, verbo app_path = path_to_dir + "/pmc_perf.csv" roofline_exists = os.path.isfile(app_path) if not roofline_exists: - print("Error: {} does not exist") + print("Error: {} does not exist".format(app_path)) sys.exit(0) t_df = OrderedDict() t_df["pmc_perf"] = pd.read_csv(app_path)