[LITMUS^RT] tracing time duration within IRQ handler

Björn Brandenburg bbb at mpi-sws.org
Fri Apr 18 12:43:35 CEST 2014


On 17 Apr 2014, at 21:55, Glenn Elliott <gelliott at cs.unc.edu> wrote:

> Feather-trace has evolved a little bit since I last did overhead measurements.  Specifically, the counting of IRQs.  The code implies to me that I should be using different trace methods for events measured from within an IRQ handler.  Is this true?
> 
> When should I use TIMESTAMP_IRQ() and TIMESTAMP_IN_IRQ() macros for tracing?

I'm not sure which version you are looking at. In the current master branch, and in most cases, CPU_TIMESTAMP() or CPU_TIMESTAMP_CUR() are the appropriate choices, regardless of whether the code executes in interrupt context or process context.

There's only one special case concerning the tracing of time intervals that start before an interrupt and end inside an interrupt (IPIs being the typical scenario). With the normal macros, you'd discard such samples as "disturbed" by the interrupt, so there's the option to hide the expected interrupt in the count.

	https://github.com/LITMUS-RT/litmus-rt/blob/master/litmus/trace.c#L151

This is used by the "message received" callback.

	https://github.com/LITMUS-RT/litmus-rt/blob/master/litmus/trace.c#L283 via https://github.com/LITMUS-RT/litmus-rt/blob/master/litmus/trace.c#L188

Unless you are tracing IPIs, this does not concern you. If you are tracing IPIs, simply use the MSG_TIMESTAMP_SENT and MSG_TIMESTAMP_RECEIVED callbacks.

- Björn






More information about the litmus-dev mailing list