[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200324102557.GN1534489@krava>
Date: Tue, 24 Mar 2020 11:25:57 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Ian Rogers <irogers@...gle.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>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Igor Lubashev <ilubashe@...mai.com>,
Alexey Budankov <alexey.budankov@...ux.intel.com>,
Florian Fainelli <f.fainelli@...il.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Jiwei Sun <jiwei.sun@...driver.com>,
yuzhoujian <yuzhoujian@...ichuxing.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Jin Yao <yao.jin@...ux.intel.com>,
Leo Yan <leo.yan@...aro.org>,
John Garry <john.garry@...wei.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, linux-perf-users@...r.kernel.org,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v5] perf tools: add support for libpfm4
On Mon, Mar 23, 2020 at 04:58:46PM -0700, Ian Rogers wrote:
SNIP
> + /* no event */
> + if (*q == '\0')
> + continue;
> +
> + memset(&attr, 0, sizeof(attr));
> + event_attr_init(&attr);
> +
> + ret = parse_libpfm_event(q, &attr);
> + if (ret != PFM_SUCCESS) {
> + fprintf(stderr, "failed to parse event %s : %s\n", str, pfm_strerror(ret));
> + goto error;
> + }
> +
> + evsel = perf_evsel__new_idx(&attr, evlist->core.nr_entries);
> + if (evsel == NULL)
> + goto error;
> +
> + evsel->name = strdup(q);
> + if (!evsel->name) {
> + evsel__delete(evsel);
> + goto error;
> + }
> + evsel->is_libpfm_event = true;
> +
> + pmu = perf_pmu__find_by_type((unsigned)attr.type);
> + if (pmu)
> + evsel->core.own_cpus = perf_cpu_map__get(pmu->cpus);
I think you need to do more setup in here, like in __add_event function
would be great to factor those bits from __add_event function and call
it from here, so it's all in one place
jirka
Powered by blists - more mailing lists