Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1592335

Re: [PATCH 01/10] perf, tools, stat: Factor out callback for collecting event values

From Andi Kleen <andi@firstfloor.org>
Newsgroups linux.kernel
Subject Re: [PATCH 01/10] perf, tools, stat: Factor out callback for collecting event values
Date 2017-03-04 00:20 +0100
Message-ID <th4Ep-8eD-1@gated-at.bofh.it> (permalink)
References <tg6oV-7DX-3@gated-at.bofh.it> <tg6oV-7DX-7@gated-at.bofh.it> <tgSWC-8qy-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Mar 03, 2017 at 11:33:03AM +0100, Jiri Olsa wrote:
> On Tue, Feb 28, 2017 at 10:49:15PM -0800, Andi Kleen wrote:
> 
> SNIP
> 
> > +static void collect_data(struct perf_evsel *counter,
> > +			    void (*cb)(struct perf_evsel *counter, void *data,
> > +				       bool first),
> > +			    void *data)
> > +{
> > +	cb(counter, data, true);
> > +}
> > +
> > +struct aggr_data {
> > +	u64 ena, run, val;
> > +	int id;
> > +	int nr;
> > +	int cpu;
> > +};
> > +
> > +static void aggr_cb(struct perf_evsel *counter, void *data, bool first)
> > +{
> > +	struct aggr_data *ad = data;
> > +	int cpu, cpu2, s2;
> > +
> > +	for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
> > +		struct perf_counts_values *counts;
> > +
> > +		cpu2 = perf_evsel__cpus(counter)->map[cpu];
> > +		s2 = aggr_get_id(evsel_list->cpus, cpu2);
> 
> that does not match the removed code.. why?
>                 s2 = aggr_get_id(perf_evsel__cpus(counter), cpu);

I added it at some point during debugging. I think it's
actually a nop here, but technically it's correct (we're
always supposed to remap)

I can remove it, but it's really a small code cleanup.

-Andi

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 01/10] perf, tools, stat: Factor out callback for collecting event values Andi Kleen <andi@firstfloor.org> - 2017-03-01 08:00 +0100
  Re: [PATCH 01/10] perf, tools, stat: Factor out callback for  collecting event values Jiri Olsa <jolsa@redhat.com> - 2017-03-03 11:50 +0100
    Re: [PATCH 01/10] perf, tools, stat: Factor out callback for  collecting event values Andi Kleen <andi@firstfloor.org> - 2017-03-04 00:20 +0100
      Re: [PATCH 01/10] perf, tools, stat: Factor out callback for  collecting event values Jiri Olsa <jolsa@redhat.com> - 2017-03-05 18:20 +0100

csiph-web