Re: [PATCH RESEND v1 05/11] perf mem: Support AUX trace

From: James Clark
Date: Tue Sep 01 2020 - 11:53:16 EST


Hi Leo,

>
> +static int process_attr(struct perf_tool *tool __maybe_unused,
> + union perf_event *event,
> + struct evlist **pevlist)
> +{
> + int err;
> +
> + err = perf_event__process_attr(tool, event, pevlist);
> + if (err)
> + return err;
> +
> + return 0;
> +}
> +
> int cmd_mem(int argc, const char **argv)
> {
> struct stat st;
> @@ -405,8 +430,12 @@ int cmd_mem(int argc, const char **argv)
> .comm = perf_event__process_comm,
> .lost = perf_event__process_lost,
> .fork = perf_event__process_fork,
> + .attr = process_attr,
> .build_id = perf_event__process_build_id,

I don't understand the __maybe_unused here. And also isn't this equivalent
to this without the new function:

@@ -405,8 +430,12 @@ int cmd_mem(int argc, const char **argv)
.comm = perf_event__process_comm,
.lost = perf_event__process_lost,
.fork = perf_event__process_fork,
+ .attr = perf_event__process_attr,
.build_id = perf_event__process_build_id,


James