On 10/12/10, Jack Daniel <wanders.thi...@gmail.com> wrote:
> On Tue, Oct 12, 2010 at 6:56 AM, wu zhangjin <wuzhang...@gmail.com> wrote:
>> On Mon, Oct 11, 2010 at 10:00 PM, Jack Daniel <wanders.thi...@gmail.com>
>> wrote:
>>> On Thu, Oct 7, 2010 at 8:30 PM, wu zhangjin <wuzhang...@gmail.com> wrote:
>>>> Hi, Jack
>>>>
>>>> On 10/7/10, Jack Daniel <wanders.thi...@gmail.com> wrote:
>>>>> Hi Wu,
>>>>>
>>>>> I was going through your latency tracing implementation for loongson.
>>>>> Could you please assist me in understanding the following.
>>>>>
>>>>> 1) How is the latency tracing implemented here different from ftrace
>>>>> tracer function "irqsoff" ? "irqsoff" calculates the time when
>>>>> interrupts are disabled.
>>>>
>>>> What do you mean "the latency tracing implemented here"? In reality,
>>>> the latency tracers I have used are the ones you said above: irqsoff
>>>> tracer, preemptoff tracer and preemptirqsoff tracer, wakeup tracer ...
>>>
>>> My apologies for not articulating my question properly. What I meant
>>> was the latency tracing support available at
>>> Device Drivers  --->  [*] PREEMPT_RT Specific Device Drivers  --->
>>> <*>   Interrupt Latency Driver
>>> I see that you are the only one to support this in your tree for
>>> loongson. How different is this from "irqsoff" supported by Ftrace?
>>>
>>
>> The "Interrupt latency driver" differs from the irqsoff tracer, it
>> tries to measure the time between the interrupt emitted and the
>> interrupt is really handled, it reflects the response time of an
>> interrupt.
>>
>> Perhaps you can write such one driver for octeon via the RTC driver
>> (if your board has such a driver) for we can use RTC to generate
>> interrupt, For Loongson, I have used the MFGPT timer.
>
> Thank you for taking the time to explain this concept. I will try and
> implement this tracing method for Octeon by using RTC. First I will
> need to study your code.

The source code is a little 'ugly' and some of the comments may be
out-of-date ;-)

The key is calculate the time elapsed from the interrupt is
emitted(Ti) to the interrupt is to be handled(Th):

1. Set the interrupt of device

For example, we set the RTC and let it emit the interrupt at 'period'
us from current.

2. Record the time we set the interrupt

Tc = the time we set the interrupt

3. Record the time when the interrupt handler is entered

Th = the time when entering into the interrupt handler

4. Calculate the interrupt response time

Firstly, we calculate the time when the interrupt is really emitted

Ti = Tc + period

Then, we calculate the interrupt response time

Tr = Th - Ti = Th -  (Tc + period) = Th - Tc - period

I just checked the latest source code and found the first Tc was not
initialized rightly, we should get the Tc whenever we set the
interrupt.

I will add a patch for it.

Regards,
   Wu Zhangjin

> Thank you once again.
>
> Regards,
> Jack
>

-- 
You received this message because you are subscribed to the Google Groups 
"loongson-dev" group.
To post to this group, send email to loongson-...@googlegroups.com.
To unsubscribe from this group, send email to 
loongson-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/loongson-dev?hl=en.

Reply via email to