]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools/perf/tests: Remove duplicate evlist__delete in tests/tool_pmu.c
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Sun, 13 Oct 2024 17:07:32 +0000 (22:37 +0530)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 14 Oct 2024 17:29:55 +0000 (10:29 -0700)
commit9ea671d1b2d5962368b94b28507ae65f94c86fb3
tree66b713cd47d9237bc1a7ef747e7ae8196c4cba7e
parentd94d86cee1032bbf429d5bd0914b064e03b56f0e
tools/perf/tests: Remove duplicate evlist__delete in tests/tool_pmu.c

The testcase for tool_pmu failed in powerpc as below:

 ./perf test -v "Parsing without PMU name"
  8: Tool PMU                                                        :
  8.1: Parsing without PMU name                                      : FAILED!

This happens when parse_events results in either skip or fail
of an event. Because the code invokes evlist__delete(evlist)
and "goto out".

ret = parse_events(evlist, str, &err);
if (ret) {
 evlist__delete(evlist);

But in the "out" section also evlist__delete happens.

out:
        evlist__delete(evlist);
        return ret;

Hence remove the duplicate evlist__delete from the first path
in the testcase

With the change:
# ./perf test -v "Parsing without PMU name"
  8: Tool PMU                                                        :
  8.1: Parsing without PMU name                                      : Ok

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: akanksha@linux.ibm.com
Cc: hbathini@linux.ibm.com
Cc: kjain@linux.ibm.com
Cc: maddy@linux.ibm.com
Cc: disgoel@linux.vnet.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20241013170732.71339-1-atrajeev@linux.vnet.ibm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/tests/tool_pmu.c