Re: [PATCH v2 1/4] perf record: allocate affinity masks

From: Jiri Olsa
Date: Tue Jan 01 2019 - 16:39:32 EST


On Mon, Dec 24, 2018 at 03:23:13PM +0300, Alexey Budankov wrote:

SNIP

> @@ -2143,6 +2152,8 @@ int cmd_record(int argc, const char **argv)
> if (verbose > 0)
> pr_info("nr_cblocks: %d\n", rec->opts.nr_cblocks);
>
> + pr_debug("affinity: %s\n", affinity_tags[rec->opts.affinity]);
> +
> err = __cmd_record(&record, argc, argv);
> out:
> perf_evlist__delete(rec->evlist);
> diff --git a/tools/perf/perf.h b/tools/perf/perf.h
> index 388c6dd128b8..69f54529d81f 100644
> --- a/tools/perf/perf.h
> +++ b/tools/perf/perf.h
> @@ -83,6 +83,14 @@ struct record_opts {
> clockid_t clockid;
> u64 clockid_res_ns;
> int nr_cblocks;
> + int affinity;
> +};
> +
> +enum perf_affinity {
> + PERF_AFFINITY_SYS = 0,
> + PERF_AFFINITY_NODE,
> + PERF_AFFINITY_CPU,
> + PERF_AFFINITY_EOF

PERF_AFFINITY_MAX might be better name

jirka