09 Jan, 2020

1 commit

  • commit 01f36a554e3ef32f9fc4b81a4437cf08fd0e4742 upstream.

    trace_printk schedules work via irq_work_queue(), but doesn't
    wait until it was processed. The kprobe_module.tc testcase does:

    :;: "Load module again, which means the event1 should be recorded";:
    modprobe trace-printk
    grep "event1:" trace

    so the grep which checks the trace file might run before the irq work
    was processed. Fix this by adding a irq_work_sync().

    Link: http://lore.kernel.org/linux-trace-devel/20191218074427.96184-3-svens@linux.ibm.com

    Cc: stable@vger.kernel.org
    Fixes: af2a0750f3749 ("selftests/ftrace: Improve kprobe on module testcase to load/unload module")
    Signed-off-by: Sven Schnelle
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: Greg Kroah-Hartman

    Sven Schnelle
     

21 May, 2019

2 commits


20 Jun, 2016

1 commit

  • Add sample code to test trace_printk(). The trace_printk() functions should
    never be used in production code. This makes testing it a bit more
    difficult. Having a sample module that can test use cases of trace_printk()
    can help out.

    Currently it just tests trace_printk() where it will be converted into:

    trace_bputs()
    trace_puts()
    trace_bprintk()

    as well as staying as the normal _trace_printk().

    It also tests its use in interrupt context as that will test the auxilery
    buffers.

    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)