From 1a27707a4d8a987cf688d65c28eeed4968c6a915 Mon Sep 17 00:00:00 2001 From: colramos-amd Date: Tue, 12 Mar 2024 16:46:36 -0500 Subject: [PATCH] Throw error if user analyzes two of same path (#260, #67) Signed-off-by: colramos-amd [ROCm/rocprofiler-compute commit: fa7c82de75103ae1baa1603956c6e69c7ed80c41] --- .../src/omniperf_analyze/analysis_base.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/projects/rocprofiler-compute/src/omniperf_analyze/analysis_base.py b/projects/rocprofiler-compute/src/omniperf_analyze/analysis_base.py index 9f7d46ec23..a893f94d65 100644 --- a/projects/rocprofiler-compute/src/omniperf_analyze/analysis_base.py +++ b/projects/rocprofiler-compute/src/omniperf_analyze/analysis_base.py @@ -186,6 +186,16 @@ class OmniAnalyze_Base: # validate profiling data is_workload_empty(dir[0]) + # no using same paths + occurances = set() + for dir in self.__args.path: + dir = dir[0] + if dir in occurances: + console_error("You cannot provide the same path twice.") + else: + occurances.add(dir) + + # ---------------------------------------------------- # Required methods to be implemented by child classes # ----------------------------------------------------