Re: [PATCH v2 2/5]: trace_event: export HZ in timer's tracepointformat

From: Xiao Guangrong
Date: Mon Dec 28 2009 - 05:42:21 EST




Ingo Molnar wrote:

>
> I think we can do something slightly different and more efficient: just create
> a new timer event to report the value of HZ.
>
> That way we dont clutter the timer_expire_entry record format with a
> repetitive HZ field. It's an extra 4 bytes overhead: that has to be written,
> passed along, copied and thrown away in 99.9999% of the cases - such overhead
> should be avoided.
>
> If you created a special timer_params event, which would produce precisely one
> event when triggered via say a new perf ioctl. I.e. add something like this to
> perf_event.h:
>
> #define PERF_EVENT_IOC_INJECT _IOW('$', 7, __u64)
>
> and add code to kernel/perf_event.c's perf_ioctl() function that takes that
> __u64 parameter as an event ID and injects an 'artificial' event.
>
> Such a new feature would be useful for other things as well: backtesting rare
> events, injecting other types of 'parameter/query events', etc.
>
> There might be more details to this, but it would be a useful scheme IMO - and
> it would still integrate nicely with the whole ftrace event enumeration scheme
> so tooling support would be easier.
>
> What do you think?
>

Sure, this is the better way, i'll fix it address your suggestion in the next version.

Thanks,
Xiao
--
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/