[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fUGRdj=G6=srwoATWMimK5tB4X2Sxa64tTVk_JRwMJdWg@mail.gmail.com>
Date: Mon, 21 Jun 2021 22:14:46 -0700
From: Ian Rogers <irogers@...gle.com>
To: Riccardo Mancini <rickyman7@...il.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] perf script: delete evlist when deleting session
On Mon, Jun 21, 2021 at 4:44 PM Riccardo Mancini <rickyman7@...il.com> wrote:
>
> ASan reports a memory leak related to session->evlist never being deleted.
> The evlist member is not deleted in perf_session__delete, so it should be
> deleted separately.
> This patch adds the missing deletion in perf-script.
>
> Signed-off-by: Riccardo Mancini <rickyman7@...il.com>
> ---
> tools/perf/builtin-script.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 1280cbfad4db..635a1d9cfc88 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -3991,7 +3991,7 @@ int cmd_script(int argc, const char **argv)
> zfree(&script.ptime_range);
> }
>
> - evlist__free_stats(session->evlist);
Should this be removed?
> + evlist__delete(session->evlist);
If the perf session "owns" the evlist, would it be cleaner to add this
to perf_session__delete?
Thanks,
Ian
> perf_session__delete(session);
>
> if (script_started)
> --
> 2.31.1
>
Powered by blists - more mailing lists