linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Song Liu <songliubraving@fb.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Michael Petlan <mpetlan@redhat.com>,
	Ian Rogers <irogers@google.com>,
	nakamura.shun@fujitsu.com, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/7] libperf: Move idx to perf_evsel::idx
Date: Wed, 7 Jul 2021 20:17:27 +0200	[thread overview]
Message-ID: <YOXvt/8qrKXyomQU@krava> (raw)
In-Reply-To: <YOW+3yhgNgMOrE99@kernel.org>

On Wed, Jul 07, 2021 at 11:49:03AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jul 06, 2021 at 05:16:59PM +0200, Jiri Olsa escreveu:
> > Moving evsel::idx to perf_evsel::idx, so we can move
> > the group interface to libperf.
> 
> I fixed up this, that appearead on my tree after you cooked up this
> patch:

great, thanks

jirka

> 
> diff --git a/tools/perf/util/bpf_counter_cgroup.c b/tools/perf/util/bpf_counter_cgroup.c
> index 21261f1a05011d62..89aa5e71db1a9a23 100644
> --- a/tools/perf/util/bpf_counter_cgroup.c
> +++ b/tools/perf/util/bpf_counter_cgroup.c
> @@ -124,7 +124,7 @@ static int bperf_load_program(struct evlist *evlist)
>  			map_fd = bpf_map__fd(skel->maps.events);
>  			for (cpu = 0; cpu < nr_cpus; cpu++) {
>  				int fd = FD(evsel, cpu);
> -				__u32 idx = evsel->idx * total_cpus +
> +				__u32 idx = evsel->core.idx * total_cpus +
>  					evlist->core.all_cpus->map[cpu];
>  
>  				err = bpf_map_update_elem(map_fd, &idx, &fd,
> @@ -221,7 +221,7 @@ static int bperf_cgrp__sync_counters(struct evlist *evlist)
>  
>  static int bperf_cgrp__enable(struct evsel *evsel)
>  {
> -	if (evsel->idx)
> +	if (evsel->core.idx)
>  		return 0;
>  
>  	bperf_cgrp__sync_counters(evsel->evlist);
> @@ -232,7 +232,7 @@ static int bperf_cgrp__enable(struct evsel *evsel)
>  
>  static int bperf_cgrp__disable(struct evsel *evsel)
>  {
> -	if (evsel->idx)
> +	if (evsel->core.idx)
>  		return 0;
>  
>  	bperf_cgrp__sync_counters(evsel->evlist);
> @@ -251,7 +251,7 @@ static int bperf_cgrp__read(struct evsel *evsel)
>  	int reading_map_fd, err = 0;
>  	__u32 idx;
>  
> -	if (evsel->idx)
> +	if (evsel->core.idx)
>  		return 0;
>  
>  	bperf_cgrp__sync_counters(evsel->evlist);
> @@ -263,7 +263,7 @@ static int bperf_cgrp__read(struct evsel *evsel)
>  	reading_map_fd = bpf_map__fd(skel->maps.cgrp_readings);
>  
>  	evlist__for_each_entry(evlist, evsel) {
> -		idx = evsel->idx;
> +		idx = evsel->core.idx;
>  		err = bpf_map_lookup_elem(reading_map_fd, &idx, values);
>  		if (err) {
>  			pr_err("bpf map lookup falied: idx=%u, event=%s, cgrp=%s\n",
> @@ -288,7 +288,7 @@ static int bperf_cgrp__read(struct evsel *evsel)
>  
>  static int bperf_cgrp__destroy(struct evsel *evsel)
>  {
> -	if (evsel->idx)
> +	if (evsel->core.idx)
>  		return 0;
>  
>  	bperf_cgroup_bpf__destroy(skel);
> 


  parent reply	other threads:[~2021-07-07 18:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06 15:16 [RFCv2 0/7] libperf: Add leader/group info to perf_evsel Jiri Olsa
2021-07-06 15:16 ` [PATCH 1/7] libperf: Change tests to single static and shared binaries Jiri Olsa
2021-07-06 15:16 ` [PATCH 2/7] libperf: Move idx to perf_evsel::idx Jiri Olsa
2021-07-07 14:45   ` Arnaldo Carvalho de Melo
2021-07-07 18:17     ` Jiri Olsa
2021-07-07 18:36       ` Arnaldo Carvalho de Melo
2021-07-07 14:49   ` Arnaldo Carvalho de Melo
2021-07-07 17:48     ` Arnaldo Carvalho de Melo
2021-07-07 18:18       ` Jiri Olsa
2021-07-07 18:17     ` Jiri Olsa [this message]
2021-07-06 15:17 ` [PATCH 3/7] libperf: Move leader to perf_evsel::leader Jiri Olsa
2021-07-07 14:53   ` Arnaldo Carvalho de Melo
2021-07-07 18:14     ` Jiri Olsa
2021-07-07 18:34       ` Arnaldo Carvalho de Melo
2021-07-06 15:17 ` [PATCH 4/7] libperf: Move nr_groups to evlist::nr_groups Jiri Olsa
2021-07-06 15:17 ` [PATCH 5/7] libperf: Add perf_evlist__set_leader function Jiri Olsa
2021-07-06 15:17 ` [PATCH 6/7] libperF: Add group support to perf_evsel__open Jiri Olsa
2021-07-07 17:43   ` Arnaldo Carvalho de Melo
2021-07-07 18:15     ` Jiri Olsa
2021-07-09 17:57       ` [PATCH] libperf: Remove BUG_ON() from library code in get_group_fd(). was " Arnaldo Carvalho de Melo
2021-07-06 15:17 ` [PATCH 7/7] libperf: Add tests for perf_evlist__set_leader function Jiri Olsa
2021-07-09 17:59   ` Arnaldo Carvalho de Melo
2021-07-07 14:47 ` [RFCv2 0/7] libperf: Add leader/group info to perf_evsel Arnaldo Carvalho de Melo
2021-07-07 18:20   ` Jiri Olsa
2021-07-07 18:37     ` Arnaldo Carvalho de Melo
2021-07-09  8:32       ` nakamura.shun
  -- strict thread matches above, loose matches on Subject: below --
2021-07-06 13:20 [RFC " Jiri Olsa
2021-07-06 13:20 ` [PATCH 2/7] libperf: Move idx to perf_evsel::idx Jiri Olsa

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=YOXvt/8qrKXyomQU@krava \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=nakamura.shun@fujitsu.com \
    --cc=namhyung@kernel.org \
    --cc=songliubraving@fb.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).