Re: [PATCH] perf report: Display per-thread event counters

From: Brice Goglin
Date: Sat Aug 08 2009 - 12:10:31 EST


Ingo Molnar wrote:
>> [...] But I don't see yet where I am suppose to get something like
>> PERF_READ_EVENT in builtin-stat.c so I haven't touched it yet.
>>
>
> Yeah. 'perf stat' is not really getting events but is doing a
> read-out of the counter value(s) and constructs its 'read event'
> that way. So you wont find PERF_READ_EVENT in builtin-stat.c, you'll
> find:
>
> res = read(fd[cpu][counter], single_count, nv * sizeof(u64));
>
> in read_counter(). The printout is then done in print_counter().
>

Is there a way to get per-thread counters there? I wrote the code to
gather per-cpu counters there, but I don't see any way to get the
corresponding thread-id.

I looked at perf record to get some help. But I don't see where the
PERF_EVENT_READ are generated. I guess they are directly generated by
the kernel, read by perf record, and written as is to the output file?

thanks,
Brice

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/