Re: [PATCH 0/4] perf events: Add realtime clock event and timehistoption -v2

From: Frederic Weisbecker
Date: Mon Feb 21 2011 - 16:37:50 EST


On Mon, Feb 21, 2011 at 02:02:26PM -0700, David Ahern wrote:
> v1 -> v2:
> - removed change to WARN_ON_ONCE in perf_event.c
> - fixed init of realtime_clock event (needed call to perf_swevent_init_hrtimer)
> - changed userspace event name to clock-realtime with the alias clkr as the
> raw events code sucks up all options that start with 'r' followed by a hex
> character
> - remove RAW sample hack for pushing realtime clock event data to userspace
> - plumbed PERF_SAMPLE_READ to enable retrieving event data during sample
> generation
> - add patch to perf-stat to recognize realtime-clock as a nsec counter
> - implementation of tiemhist in perf-record was revamped significantly
> -- to use event data,
> -- to better handle fallback to synthesized event,
> -- added feature to force a sample to be generated at startup (to output
> wall-clock times we need a sample immediately; after that realtime-clock
> samples are generated periodically)
> -- change counter creation to be done only on first cpu; we do not need a
> counter for each cpu
>
> A request was made to modify perf-trace and perf-script. From what I can see
> perf-trace does not exist yet and perf-script requires raw data which means
> it does not work for the primary use case that motivated this feature
> (perf record -e cs -1 -ag).

The goal is actually to extend perf script to handle more than just raw data.
So that it can handle the rest of what we can find in an event: time, ip, stacktraces...

You've added 200 lines in perf report to add the dump support. It wouldn't
require more to extend perf script to do that. And the result is going to be
much more powerful.

Look at struct scripting_ops::process_event().

What you need is too pass in the whole event instead of only the raw data,
cpu and so on...

You don't even need to add the support in the scripts themselves, they can
just cope with the new parameter layout. You only need to handle the rest of
the event in the print_event() function (the default scripting_ops::process_event())
to print ip, time and stacktraces.

This probably needs some option in perf script to avoid showing ip and other
new things. Although we probably want to print stacktraces by default
if there are present.
--
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/