[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230925061824.3818631-24-weilin.wang@intel.com>
Date: Sun, 24 Sep 2023 23:18:22 -0700
From: weilin.wang@...el.com
To: weilin.wang@...el.com, Ian Rogers <irogers@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>
Cc: linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Perry Taylor <perry.taylor@...el.com>,
Samantha Alt <samantha.alt@...el.com>,
Caleb Biggers <caleb.biggers@...el.com>,
Mark Rutland <mark.rutland@....com>
Subject: [RFC PATCH 23/25] perf stat: Fix a return error issue in hardware-grouping
From: Weilin Wang <weilin.wang@...el.com>
Update the hw_aware_parse_ids() goto to improve error handling.
Signed-off-by: Weilin Wang <weilin.wang@...el.com>
---
tools/perf/util/metricgroup.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 07a82fa21..6a4404226 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -2196,11 +2196,11 @@ static int hw_aware_parse_ids(struct perf_pmu *fake_pmu,
*out_evlist = NULL;
ret = hw_aware_build_grouping(ids, &grouping);
if (ret)
- goto err_out;
+ goto out;
ret = hw_aware_metricgroup__build_event_string(&grouping_str, modifier,
tool_events, &grouping);
if (ret)
- goto err_out;
+ goto out;
parsed_evlist = evlist__new();
if (!parsed_evlist) {
@@ -2225,10 +2225,11 @@ static int hw_aware_parse_ids(struct perf_pmu *fake_pmu,
*out_evlist = parsed_evlist;
parsed_evlist = NULL;
err_out:
- metricgroup__free_group_list(&grouping);
- metricgroup__free_grouping_strs(&grouping_str);
parse_events_error__exit(&parse_error);
evlist__delete(parsed_evlist);
+out:
+ metricgroup__free_group_list(&grouping);
+ metricgroup__free_grouping_strs(&grouping_str);
return ret;
}
--
2.39.3
Powered by blists - more mailing lists