[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9B5AEBE0-D000-4D58-94BA-85153C5CD66F@gmail.com>
Date: Wed, 07 Sep 2022 20:47:52 -0300
From: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To: Ian Rogers <irogers@...gle.com>, Jiri Olsa <olsajiri@...il.com>
CC: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
James Clark <james.clark@....com>,
Kees Cook <keescook@...omium.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Riccardo Mancini <rickyman7@...il.com>,
German Gomez <german.gomez@....com>,
Colin Ian King <colin.king@...el.com>,
Song Liu <songliubraving@...com>,
Dave Marchevsky <davemarchevsky@...com>,
Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>,
Leo Yan <leo.yan@...aro.org>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v2 6/6] perf cpumap: Add range data encoding
On September 7, 2022 7:41:19 PM GMT-03:00, Ian Rogers <irogers@...gle.com> wrote:
>On Thu, Aug 4, 2022 at 12:30 PM Ian Rogers <irogers@...gle.com> wrote:
>>
>> On Sun, Jul 31, 2022 at 5:39 AM Jiri Olsa <olsajiri@...il.com> wrote:
>> >
>> > On Tue, Jun 14, 2022 at 07:33:53AM -0700, Ian Rogers wrote:
>> >
>> > SNIP
>> >
>> > > + event = cpu_map_data__alloc(&syn_data, sizeof(struct perf_event_header));
>> > > if (!event)
>> > > return NULL;
>> > >
>> > > + syn_data.data = &event->data;
>> > > event->header.type = PERF_RECORD_CPU_MAP;
>> > > - event->header.size = size;
>> > > - event->data.type = type;
>> > > -
>> > > - cpu_map_data__synthesize(&event->data, map, type, max);
>> > > + event->header.size = syn_data.size;
>> > > + cpu_map_data__synthesize(&syn_data);
>> > > return event;
>> > > }
>> > >
>> > > +
>> > > int perf_event__synthesize_cpu_map(struct perf_tool *tool,
>> > > const struct perf_cpu_map *map,
>> > > perf_event__handler_t process,
>> > > @@ -1891,24 +1894,20 @@ int perf_event__synthesize_event_update_name(struct perf_tool *tool, struct evse
>> > > int perf_event__synthesize_event_update_cpus(struct perf_tool *tool, struct evsel *evsel,
>> > > perf_event__handler_t process)
>> > > {
>> > > - size_t size = sizeof(struct perf_event_header) + sizeof(u64) + sizeof(u64);
>> > > + struct synthesize_cpu_map_data syn_data = { .map = evsel->core.own_cpus };
>> > > struct perf_record_event_update *ev;
>> > > - int max, err;
>> > > - u16 type;
>> > > -
>> > > - if (!evsel->core.own_cpus)
>> > > - return 0;
>> >
>> > all seems fine, just looks like we no longer do this check,
>> > might not be needed anymore, as that changed in past
>>
>> This function is called in a test and in this file. The caller already
>> does this test and so the check is redundant plus a little confusing:
>> https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/util/synthetic-events.c?h=perf/core#n2062
>> As you say, it wasn't needed any more and so I removed it.
>>
>> Thanks,
>> Ian
>
>Would be nice to land this imo. Anything outstanding?
I'll check first hour tomorrow, today was a holiday down here.
- Arnaldo
>
>Thanks,
>Ian
>
>> > thanks,
>> > jirka
>> >
>> > > + int err;
>> > >
>> > > - ev = cpu_map_data__alloc(evsel->core.own_cpus, &size, &type, &max);
>> > > + ev = cpu_map_data__alloc(&syn_data, sizeof(struct perf_event_header) + 2 * sizeof(u64));
>> > > if (!ev)
>> > > return -ENOMEM;
>> > >
>> > > + syn_data.data = &ev->cpus.cpus;
>> > > ev->header.type = PERF_RECORD_EVENT_UPDATE;
>> > > - ev->header.size = (u16)size;
>> > > + ev->header.size = (u16)syn_data.size;
>> > > ev->type = PERF_EVENT_UPDATE__CPUS;
>> > > ev->id = evsel->core.id[0];
>> > > -
>> > > - cpu_map_data__synthesize(&ev->cpus.cpus, evsel->core.own_cpus, type, max);
>> > > + cpu_map_data__synthesize(&syn_data);
>> > >
>> > > err = process(tool, (union perf_event *)ev, NULL, NULL);
>> > > free(ev);
>> > > --
>> > > 2.36.1.476.g0c4daa206d-goog
>> > >
Powered by blists - more mailing lists