linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephane Eranian <eranian@google.com>,
	Ian Rogers <irogers@google.com>
Subject: Re: [PATCH] perf tools: Add missing swap for cgroup events
Date: Tue, 3 Nov 2020 09:24:48 -0300	[thread overview]
Message-ID: <20201103122448.GF151027@kernel.org> (raw)
In-Reply-To: <20201102174956.GA3597846@krava>

Em Mon, Nov 02, 2020 at 06:49:56PM +0100, Jiri Olsa escreveu:
> On Mon, Nov 02, 2020 at 11:02:28PM +0900, Namhyung Kim wrote:
> > It was missed to add a swap function for PERF_RECORD_CGROUP.
> > 
> > Fixes: ba78c1c5461c ("perf tools: Basic support for CGROUP event")
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>


Thanks, applied.

- Arnaldo

 
> thanks,
> jirka
> 
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> >  tools/perf/util/session.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> > index 7a5f03764702..c44c8e8c09c6 100644
> > --- a/tools/perf/util/session.c
> > +++ b/tools/perf/util/session.c
> > @@ -710,6 +710,18 @@ static void perf_event__namespaces_swap(union perf_event *event,
> >  		swap_sample_id_all(event, &event->namespaces.link_info[i]);
> >  }
> >  
> > +static void perf_event__cgroup_swap(union perf_event *event, bool sample_id_all)
> > +{
> > +	event->cgroup.id = bswap_64(event->cgroup.id);
> > +
> > +	if (sample_id_all) {
> > +		void *data = &event->cgroup.path;
> > +
> > +		data += PERF_ALIGN(strlen(data) + 1, sizeof(u64));
> > +		swap_sample_id_all(event, data);
> > +	}
> > +}
> > +
> >  static u8 revbyte(u8 b)
> >  {
> >  	int rev = (b >> 4) | ((b & 0xf) << 4);
> > @@ -952,6 +964,7 @@ static perf_event__swap_op perf_event__swap_ops[] = {
> >  	[PERF_RECORD_SWITCH]		  = perf_event__switch_swap,
> >  	[PERF_RECORD_SWITCH_CPU_WIDE]	  = perf_event__switch_swap,
> >  	[PERF_RECORD_NAMESPACES]	  = perf_event__namespaces_swap,
> > +	[PERF_RECORD_CGROUP]		  = perf_event__cgroup_swap,
> >  	[PERF_RECORD_TEXT_POKE]		  = perf_event__text_poke_swap,
> >  	[PERF_RECORD_HEADER_ATTR]	  = perf_event__hdr_attr_swap,
> >  	[PERF_RECORD_HEADER_EVENT_TYPE]	  = perf_event__event_type_swap,
> > -- 
> > 2.29.1.341.ge80a0c044ae-goog
> > 
> 

-- 

- Arnaldo

      reply	other threads:[~2020-11-03 12:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 14:02 [PATCH] perf tools: Add missing swap for cgroup events Namhyung Kim
2020-11-02 17:49 ` Jiri Olsa
2020-11-03 12:24   ` Arnaldo Carvalho de Melo [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=20201103122448.GF151027@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@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;
as well as URLs for NNTP newsgroup(s).