On Mon, 15 Mar 2021 08:18:21 +0200 "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > +static void default_perf_init_pe(struct perf_event_attr *pe) > +{ > + pe->type = PERF_TYPE_SOFTWARE; > + pe->sample_type = PERF_SAMPLE_CPU; > + pe->size = sizeof(struct perf_event_attr); > + pe->config = PERF_COUNT_HW_CPU_CYCLES; > + pe->disabled = 1; > + pe->exclude_kernel = 1; > + pe->freq = 1; > + pe->sample_freq = 1000; > + pe->inherit = 1; > + pe->mmap = 1; > + pe->comm = 1; > + pe->task = 1; > + pe->precise_ip = 1; > + pe->sample_id_all = 1; I tried to compile this on an old system and it fails to compile. We'll need to add a compile time check if the perf functions are supported by the user space, as trace-cmd should still build on these systems. COMPILE FPIC trace-perf.o trace-perf.c: In function ‘default_perf_init_pe’: trace-perf.c:26: error: ‘struct perf_event_attr’ has no member named ‘precise_ip’ trace-perf.c:27: error: ‘struct perf_event_attr’ has no member named ‘sample_id_all’ make[1]: *** [/work/git/trace-cmd.git/lib/trace-cmd/trace-perf.o] Error 1 -- Steve > + pe->read_format = PERF_FORMAT_ID | > + PERF_FORMAT_TOTAL_TIME_ENABLED | > + PERF_FORMAT_TOTAL_TIME_RUNNING; > +}