• Mark Rutland's avatar
    ftrace: Add sample with custom ops · b56c68f7
    Mark Rutland authored
    When reworking core ftrace code or architectural ftrace code, it's often
    necessary to test/analyse/benchmark a number of ftrace_ops
    configurations. This patch adds a module which can be used to explore
    some of those configurations.
    
    I'm using this to benchmark various options for changing the way
    trampolines and handling of ftrace_ops work on arm64, and ensuring other
    architectures aren't adversely affected.
    
    For example, in a QEMU+KVM VM running on a 2GHz Xeon E5-2660
    workstation, loading the module in various configurations produces:
    
    | # insmod ftrace-ops.ko
    | ftrace_ops: registering:
    |   relevant ops: 1
    |     tracee: tracee_relevant [ftrace_ops]
    |     tracer: ops_func_nop [ftrace_ops]
    |   irrelevant ops: 0
    |     tracee: tracee_irrelevant [ftrace_ops]
    |     tracer: ops_func_nop [ftrace_ops]
    |   saving registers: NO
    |   assist recursion: NO
    |   assist RCU: NO
    | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 1681558ns (16ns / call)
    
    | # insmod ftr...
    b56c68f7
ftrace-ops.c 6.86 KB