[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200417132330.119407-2-tommi.t.rantala@nokia.com>
Date: Fri, 17 Apr 2020 16:23:27 +0300
From: Tommi Rantala <tommi.t.rantala@...ia.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>
Cc: Tommi Rantala <tommi.t.rantala@...ia.com>,
Peter Zijlstra <peterz@...radead.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexey Budankov <alexey.budankov@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/4] perf tools: Move zstd_fini() to session deletion
Move zstd_fini() call to perf_session__delete(), so that we always
cleanup the zstd state when deleting the session.
Signed-off-by: Tommi Rantala <tommi.t.rantala@...ia.com>
---
tools/perf/builtin-inject.c | 1 -
tools/perf/builtin-record.c | 1 -
tools/perf/builtin-report.c | 1 -
tools/perf/util/session.c | 1 +
4 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 7e124a7b8bfd..1ffb8393357a 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -836,7 +836,6 @@ int cmd_inject(int argc, const char **argv)
ret = __cmd_inject(&inject);
out_delete:
- zstd_fini(&(inject.session->zstd_data));
perf_session__delete(inject.session);
return ret;
}
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 1ab349abe904..8ed00de1ca29 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1827,7 +1827,6 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
}
out_delete_session:
- zstd_fini(&session->zstd_data);
perf_session__delete(session);
if (!opts->no_bpf_event)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 26d8fc27e427..e06e14980264 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1579,7 +1579,6 @@ int cmd_report(int argc, const char **argv)
report.block_reports = NULL;
}
- zstd_fini(&(session->zstd_data));
perf_session__delete(session);
return ret;
}
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 0b0bfe5bef17..64e8b794b0bc 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -302,6 +302,7 @@ void perf_session__delete(struct perf_session *session)
machines__exit(&session->machines);
if (session->data)
perf_data__close(session->data);
+ zstd_fini(&session->zstd_data);
free(session);
}
--
2.25.2
Powered by blists - more mailing lists