Re: register_timer_hook use in arch/sh/oprofile

Ingo Molnar
2009-06-24T12:48:14Z

* Paul Mackerras <paulus@samba.org> wrote:

> Paul Mundt writes:
>
> > Yes, that all works fine. My comment was more in reference to
> > the hardware performance counters that don't have IRQs of their
> > own, which still need to be tied in to the perf_counter API.
>
> For them you would need to check in hw_perf_counter_init() that
> counter->attr.sample_period is zero, and fail with an -EINVAL
> error if it isn't.

That would make 'perf stat' work - but 'perf top' and 'perf record'
would not.

But those can be made to work as well without hw IRQ support, if the
period is simply fed into a special hrtimer, with nanosecs units.
The resulting sampling wont be "constant period" - but none of the
tools really mind about that.

Ingo