18 Oct, 2018

1 commit

  • The preemptirq_delay_test module is used for the ftrace selftest code that
    tests the latency tracers. The problem is that it uses ktime for the delay
    loop, and then checks the tracer to see if the delay loop is caught, but the
    tracer uses trace_clock_local() which uses various different other clocks to
    measure the latency. As ktime uses the clock cycles, and the code then
    converts that to nanoseconds, it causes rounding errors, and the preemptirq
    latency tests are failing due to being off by 1 (it expects to see a delay
    of 500000 us, but the delay is only 499999 us). This is happening due to a
    rounding error in the ktime (which is totally legit). The purpose of the
    test is to see if it can catch the delay, not to test the accuracy between
    trace_clock_local() and ktime_get(). Best to use apples to apples, and have
    the delay loop use the same clock as the latency tracer does.

    Cc: stable@vger.kernel.org
    Fixes: f96e8577da102 ("lib: Add module for testing preemptoff/irqsoff latency tracers")
    Acked-by: Joel Fernandes (Google)
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     

28 Jul, 2018

1 commit


26 Jul, 2018

1 commit

  • Here we introduce a test module for introducing a long preempt or irq
    disable delay in the kernel which the preemptoff or irqsoff tracers can
    detect. This module is to be used only for test purposes and is default
    disabled.

    Following is the expected output (only briefly shown) that can be parsed
    to verify that the tracers are working correctly. We will use this from
    the kselftests in future patches.

    For the preemptoff tracer:

    echo preemptoff > /d/tracing/current_tracer
    sleep 1
    insmod ./preemptirq_delay_test.ko test_mode=preempt delay=500000
    sleep 1
    bash-4.3# cat /d/tracing/trace
    preempt -1066 2...2 0us@: preemptirq_delay_run
    => kthread
    => ret_from_fork

    For the irqsoff tracer:

    echo irqsoff > /d/tracing/current_tracer
    sleep 1
    insmod ./preemptirq_delay_test.ko test_mode=irq delay=500000
    sleep 1
    bash-4.3# cat /d/tracing/trace
    irq dis -1069 1d..1 0us@: preemptirq_delay_run
    irq dis -1069 1d..1 500001us : preemptirq_delay_run
    irq dis -1069 1d..1 500002us : tracer_hardirqs_on
    => ret_from_fork

    Link: http://lkml.kernel.org/r/20180712213611.GA8743@joelaf.mtv.corp.google.com

    Cc: Boqun Feng
    Cc: Byungchul Park
    Cc: Ingo Molnar
    Cc: Julia Cartwright
    Cc: Masami Hiramatsu
    Cc: Mathieu Desnoyers
    Cc: Namhyung Kim
    Cc: Paul McKenney
    Cc: Peter Zijlstra
    Cc: Shuah Khan
    Cc: Thomas Glexiner
    Cc: Todd Kjos
    Cc: Tom Zanussi
    Cc: Andy Shevchenko
    Reviewed-by: Andy Shevchenko
    [ Erick is a co-developer of this commit ]
    Signed-off-by: Erick Reyes
    Signed-off-by: Joel Fernandes (Google)
    Signed-off-by: Steven Rostedt (VMware)

    Joel Fernandes (Google)