Re: [PATCH v5 12/13] perf evsel: Add functions to enable/disable for a specific CPU

Jiri Olsa
2019-11-11T13:30:50Z

On Thu, Nov 07, 2019 at 10:16:45AM -0800, Andi Kleen wrote:

SNIP

> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index 7106f9a067df..79050a6f4991 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -1205,13 +1205,26 @@ int perf_evsel__append_addr_filter(struct evsel *evsel, const char *filter)
> return perf_evsel__append_filter(evsel, "%s,%s", filter);
> }
>
> +/* Caller has to clear disabled after going through all CPUs. */
> +int evsel__enable_cpu(struct evsel *evsel, int cpu)
> +{
> + int err = perf_evsel__enable_cpu(&evsel->core, cpu);
> + return err;

return perf_evsel__enable_cpu(... ?

> +}
> +
> int evsel__enable(struct evsel *evsel)
> {
> int err = perf_evsel__enable(&evsel->core);
>
> if (!err)
> evsel->disabled = false;
> + return err;
> +}
>
> +/* Caller has to set disabled after going through all CPUs. */
> +int evsel__disable_cpu(struct evsel *evsel, int cpu)
> +{
> + int err = perf_evsel__disable_cpu(&evsel->core, cpu);
> return err;

return perf_evsel__disable_cpu(... ?

jirka