[PATCH v1] perf test: Add missing __exit calls in tool/hwmon tests

Ian Rogers posted 1 patch 6 days, 14 hours ago
tools/perf/tests/hwmon_pmu.c | 1 +
tools/perf/tests/tool_pmu.c  | 1 +
2 files changed, 2 insertions(+)
[PATCH v1] perf test: Add missing __exit calls in tool/hwmon tests
Posted by Ian Rogers 6 days, 14 hours ago
Address sanitizer flagged the missing parse_events_error__exit when
testing on ARM.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/hwmon_pmu.c | 1 +
 tools/perf/tests/tool_pmu.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/perf/tests/hwmon_pmu.c b/tools/perf/tests/hwmon_pmu.c
index 5c4114354c65..9f44093f18df 100644
--- a/tools/perf/tests/hwmon_pmu.c
+++ b/tools/perf/tests/hwmon_pmu.c
@@ -194,6 +194,7 @@ static int do_test(size_t i, bool with_pmu, bool with_alias)
 	}
 
 out:
+	parse_events_error__exit(&err);
 	evlist__delete(evlist);
 	return ret;
 }
diff --git a/tools/perf/tests/tool_pmu.c b/tools/perf/tests/tool_pmu.c
index 46896b485abf..187942b749b7 100644
--- a/tools/perf/tests/tool_pmu.c
+++ b/tools/perf/tests/tool_pmu.c
@@ -66,6 +66,7 @@ static int do_test(enum tool_pmu_event ev, bool with_pmu)
 	}
 
 out:
+	parse_events_error__exit(&err);
 	evlist__delete(evlist);
 	return ret;
 }
-- 
2.47.0.338.g60cca15819-goog
Re: [PATCH v1] perf test: Add missing __exit calls in tool/hwmon tests
Posted by Arnaldo Carvalho de Melo 5 days, 15 hours ago
On Fri, Nov 15, 2024 at 12:12:58PM -0800, Ian Rogers wrote:
> Address sanitizer flagged the missing parse_events_error__exit when
> testing on ARM.

Thanks, applied to perf-tools-next,

- Arnaldo
 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/tests/hwmon_pmu.c | 1 +
>  tools/perf/tests/tool_pmu.c  | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/tools/perf/tests/hwmon_pmu.c b/tools/perf/tests/hwmon_pmu.c
> index 5c4114354c65..9f44093f18df 100644
> --- a/tools/perf/tests/hwmon_pmu.c
> +++ b/tools/perf/tests/hwmon_pmu.c
> @@ -194,6 +194,7 @@ static int do_test(size_t i, bool with_pmu, bool with_alias)
>  	}
>  
>  out:
> +	parse_events_error__exit(&err);
>  	evlist__delete(evlist);
>  	return ret;
>  }
> diff --git a/tools/perf/tests/tool_pmu.c b/tools/perf/tests/tool_pmu.c
> index 46896b485abf..187942b749b7 100644
> --- a/tools/perf/tests/tool_pmu.c
> +++ b/tools/perf/tests/tool_pmu.c
> @@ -66,6 +66,7 @@ static int do_test(enum tool_pmu_event ev, bool with_pmu)
>  	}
>  
>  out:
> +	parse_events_error__exit(&err);
>  	evlist__delete(evlist);
>  	return ret;
>  }
> -- 
> 2.47.0.338.g60cca15819-goog