• Steven Rostedt's avatar
    ftrace: add cpu annotation for function graph tracer · 437f24fb
    Steven Rostedt authored
    Impact: enhancement for function graph tracer
    
    When run on a SMP box, the function graph tracer is confusing because
    it shows the different CPUS as changes in the trace.
    
    This patch adds the annotation of 'CPU[###]' where ### is a three digit
    number. The output will look similar to this:
    
    CPU[001]     dput() {
    CPU[000] } 726
    CPU[001]     } 487
    CPU[000] do_softirq() {
    CPU[001]   } 2221
    CPU[000]   __do_softirq() {
    CPU[000]     __local_bh_disable() {
    CPU[001]   unroll_tree_refs() {
    CPU[000]     } 569
    CPU[001]   } 501
    CPU[000]     rcu_process_callbacks() {
    CPU[001]   kfree() {
    
    What makes this nice is that now you can grep the file and produce
    readable format for a particular CPU.
    
     # cat /debug/tracing/trace > /tmp/trace
     # grep '^CPU\[000\]' /tmp/trace > /tmp/trace0
     # grep '^CPU\[001\]' /tmp/trace > /tmp/trace1
    
    Will give you:
    
     # head /tmp/trace0
    CPU[000] ------------8<---------- thread sshd-3899 ------------8<----------
    CPU[000]     inotify_dentry_parent_queue_event() {
    CPU[000]     } 2531
    CPU[000]     inotify_inode_queue_event() {
    CPU[000]     } 505
    CPU[000]   } 69626
    CPU[000] } 73089
    CPU[000] audit_syscall_exit() {
    CPU[000]   path_put() {
    CPU[000]     dput() {
    
     # head /tmp/trace1
    CPU[001] ------------8<---------- thread pcscd-3446 ------------8<----------
    CPU[001]               } 4186
    CPU[001]               dput() {
    CPU[001]               } 543
    CPU[001]               vfs_permission() {
    CPU[001]                 inode_permission() {
    CPU[001]                   shmem_permission() {
    CPU[001]                     generic_permission() {
    CPU[001]                     } 501
    CPU[001]                   } 2205
    Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    437f24fb
trace_functions_graph.c 3.91 KB