mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jiri Olsa <jolsa@kernel.org>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>
Subject: Re: [PATCH] perf: Fix header.size for namespace events
Date: Fri, 27 Oct 2017 16:18:19 +0200	[thread overview]
Message-ID: <20171027141819.GB3165@worktop.lehotels.local> (raw)
In-Reply-To: <20171027074311.2648-1-jolsa@kernel.org>

On Fri, Oct 27, 2017 at 09:43:11AM +0200, Jiri Olsa wrote:
> Reset header size for namespace events, otherwise
> it only gets bigger in ctx iterations.
> 
> Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
> Link: http://lkml.kernel.org/n/tip-nlo4gonz9d4guyb8153ukzt0@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Fixes: e422267322cd ("perf: Add PERF_RECORD_NAMESPACES to include namespaces related info")

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

> ---
>  kernel/events/core.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 04989fb769f0..4e6aa3f7d018 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -6717,6 +6717,7 @@ static void perf_event_namespaces_output(struct perf_event *event,
>  	struct perf_namespaces_event *namespaces_event = data;
>  	struct perf_output_handle handle;
>  	struct perf_sample_data sample;
> +	u16 header_size = namespaces_event->event_id.header.size;
>  	int ret;
>  
>  	if (!perf_event_namespaces_match(event))
> @@ -6727,7 +6728,7 @@ static void perf_event_namespaces_output(struct perf_event *event,
>  	ret = perf_output_begin(&handle, event,
>  				namespaces_event->event_id.header.size);
>  	if (ret)
> -		return;
> +		goto out;
>  
>  	namespaces_event->event_id.pid = perf_event_pid(event,
>  							namespaces_event->task);
> @@ -6739,6 +6740,8 @@ static void perf_event_namespaces_output(struct perf_event *event,
>  	perf_event__output_id_sample(event, &handle, &sample);
>  
>  	perf_output_end(&handle);
> +out:
> +	namespaces_event->event_id.header.size = header_size;
>  }
>  
>  static void perf_fill_ns_link_info(struct perf_ns_link_info *ns_link_info,
> -- 
> 2.13.6
> 

      reply	other threads:[~2017-10-27 14:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27  7:43 Jiri Olsa
2017-10-27 14:18 ` Peter Zijlstra [this message]

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=20171027141819.GB3165@worktop.lehotels.local \
    --to=peterz@infradead.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /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

all inboxes | Powered by JetHome®