Re: [PATCH 11/14] perf tools: record write data overhead
From: Jiri Olsa
Date: Wed Nov 23 2016 - 18:06:19 EST
On Wed, Nov 23, 2016 at 04:44:49AM -0500, kan.liang@xxxxxxxxx wrote:
SNIP
>
> +static void perf_event__synth_overhead(struct record *rec, perf_event__handler_t process)
> +{
> + int cpu;
> +
> + union perf_event event = {
> + .overhead = {
> + .header = {
> + .type = PERF_RECORD_USER_OVERHEAD,
> + .size = sizeof(struct perf_overhead),
> + },
> + },
> + };
> +
> + event.overhead.type = PERF_USER_WRITE_OVERHEAD;
> +
> + for (cpu = 0; cpu < MAX_NR_CPUS; cpu++) {
> + if (!rec->overhead[cpu].nr)
> + continue;
> +
> + event.overhead.entry.cpu = cpu;
> + event.overhead.entry.nr = rec->overhead[cpu].nr;
> + event.overhead.entry.time = rec->overhead[cpu].time;
> +
> + (void)process(&rec->tool, &event, NULL, NULL);
plese make perf_event__synth_overhead return int and check above 'process' return value
jirka