Re: [PATCH v4 6/8] perf, tools, script: Make itrace script default to all calls

From: Kim Phillips
Date: Tue Sep 04 2018 - 15:38:40 EST


On Mon, 3 Sep 2018 09:22:47 -0700
Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:

<snip>
> Fix ETM build failure
> ---
> diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
> index 2ae640257fdb..0296405f38b2 100644
> --- a/tools/perf/util/cs-etm.c
> +++ b/tools/perf/util/cs-etm.c
> @@ -1432,7 +1432,8 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
> if (session->itrace_synth_opts && session->itrace_synth_opts->set) {
> etm->synth_opts = *session->itrace_synth_opts;
> } else {
> - itrace_synth_opts__set_default(&etm->synth_opts);
> + itrace_synth_opts__set_default(&etm->synth_opts,
> + etm->synth_opts->default_no_sample);

This still fails but with a different error:

CC util/cs-etm.o
util/cs-etm.c: In function âcs_etm__process_auxtrace_infoâ:
util/cs-etm.c:1436:20: error: invalid type argument of â->â (have âstruct itrace_synth_optsâ)
etm->synth_opts->default_no_sample);
^~

I tried this diff, and it built:

diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 0296405f38b2..3b37d66dc533 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -1433,7 +1433,7 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
etm->synth_opts = *session->itrace_synth_opts;
} else {
itrace_synth_opts__set_default(&etm->synth_opts,
- etm->synth_opts->default_no_sample);
+ session->itrace_synth_opts->default_no_sample);
etm->synth_opts.callchain = false;
}

So please incorporate it in this patch.

FYI, building-in cs-etm decoding into perf depends on
CONFIG_LIBOPENCSD. Debian has a package 'libopencsd' that provides
it. I don't know about other distros, but it's possible to build and
install the library from scratch:

https://github.com/Linaro/OpenCSD/

Thanks,

Kim