linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Tommi Rantala <tommi.t.rantala@nokia.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexey Budankov <alexey.budankov@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] perf tools: Move zstd_fini() to session deletion
Date: Mon, 20 Apr 2020 10:54:48 +0200	[thread overview]
Message-ID: <20200420084931.GD718574@krava> (raw)
In-Reply-To: <20200417132330.119407-2-tommi.t.rantala@nokia.com>

On Fri, Apr 17, 2020 at 04:23:27PM +0300, Tommi Rantala wrote:
> Move zstd_fini() call to perf_session__delete(), so that we always
> cleanup the zstd state when deleting the session.

it shold be orthogonal with zstd_init calls, which
are not currently called within perf_session 

I guess  zstd_initcould moved to perf_session__new,
just need some nice way to pass rec->opts.comp_level

jirka

> 
> Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.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
> 


  reply	other threads:[~2020-04-20  8:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17 13:23 [PATCH 1/4] perf cgroup: Avoid needless closing of unopened fd Tommi Rantala
2020-04-17 13:23 ` [PATCH 2/4] perf tools: Move zstd_fini() to session deletion Tommi Rantala
2020-04-20  8:54   ` Jiri Olsa [this message]
2020-04-23  5:52     ` Rantala, Tommi T. (Nokia - FI/Espoo)
2020-04-17 13:23 ` [PATCH 3/4] perf tools: Fix segfaults due to missing zstd decompressor initialization Tommi Rantala
2020-04-20  9:05   ` Jiri Olsa
2020-04-17 13:23 ` [PATCH 4/4] perf bench: Fix div-by-zero if runtime is zero Tommi Rantala
2020-04-20  9:05   ` Jiri Olsa
2020-04-20 12:05     ` Arnaldo Carvalho de Melo
2020-05-08 13:05   ` [tip: perf/core] " tip-bot2 for Tommi Rantala
2020-04-20  8:48 ` [PATCH 1/4] perf cgroup: Avoid needless closing of unopened fd Jiri Olsa
2020-04-20 12:05   ` Arnaldo Carvalho de Melo
2020-05-08 13:05 ` [tip: perf/core] " tip-bot2 for Tommi Rantala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200420084931.GD718574@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexey.budankov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tommi.t.rantala@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).