Using the following script (as extracted from scripts/tracing/draw_functrace.py): 1 #!/bin/bash 2 mount -t debugfs nodev /sys/kernel/debug 3 echo function > /sys/kernel/debug/tracing/current_tracer 4 cat /sys/kernel/debug/tracing/trace_pipe > raw_trace_func 5 #### Wait some times but not too much, the script is a bit slow. 6 #### Break the pipe (Ctrl + Z) 7 draw_functrace.py < raw_trace_func > draw_functrace The following output is recorded: ----Root (Nowhere) |----tracing_set_tracer | |----mutex_unlock (2916.833727) |----vfs_write | |----inotify_inode_queue_event (2916.833731) | |----__fsnotify_parent (2916.833732) | |----inotify_dentry_parent_queue_event (2916.833732) | |----fsnotify (2916.833733) |----sysret_audit | |----audit_syscall_exit (2916.833734) | |----path_put (2916.833734) | | |----dput (2916.833735) | |----unroll_tree_refs (2916.833735) | |----kfree (2916.833735) |----auditsys | |----audit_syscall_entry (2916.833744) | |----current_kernel_time (2916.833744) |----system_call_fastpath | |----sys_dup2 (2916.833745) | |----sys_dup3 (2916.833745) | |----_spin_lock (2916.833746) | |----expand_files (2916.833747) | |----filp_close (2916.833748) | |----dnotify_flush (2916.833748) | |----locks_remove_posix (2916.833749) | |----fput (2916.833749) | |----__fput (2916.833750) | |----__might_sleep (2916.833750) | |----_cond_resched (2916.833751) | |----inotify_inode_queue_event (2916.833751) | |----__fsnotify_parent (2916.833751) | |----inotify_dentry_parent_queue_event (2916.833752) | |----fsnotify (2916.833752) | |----locks_remove_flock (2916.833752) | |----security_file_free (2916.833753) | | |----cap_file_free_security (2916.833753) | |----module_put (2916.833754) | |----put_pid (2916.833754) | |----file_kill (2916.833754) | | |----_spin_lock (2916.833755) | |----drop_file_write_access (2916.833756) | | |----mnt_drop_write (2916.833756) | |----call_rcu (2916.833757) | | |----__call_rcu (2916.833757) | |----dput (2916.833758) | |----mntput_no_expire (2916.833758) |----sysret_audit | |----audit_syscall_exit (2916.833759) | |----path_put (2916.833759) | | |----dput (2916.833760) | |----unroll_tree_refs (2916.833760) | |----kfree (2916.833760) |----auditsys | |----audit_syscall_entry (2916.833761) | |----current_kernel_time (2916.833761) |----system_call_fastpath | |----sys_fcntl (2916.833762) | |----fget (2916.833762) | |----security_file_fcntl (2916.833763) | | |----cap_file_fcntl (2916.833763) | |----fput (2916.833764) |----sysret_audit | |----audit_syscall_exit (2916.833764) | |----path_put (2916.833764) | | |----dput (2916.833765) | |----unroll_tree_refs (2916.833765) | |----kfree (2916.833765) |----auditsys | |----audit_syscall_entry (2916.833767) | |----current_kernel_time (2916.833767) |----system_call_fastpath | |----sys_close (2916.833767) | |----_spin_lock (2916.833768) | |----filp_close (2916.833768) | |----dnotify_flush (2916.833769) | |----locks_remove_posix (2916.833769) | |----fput (2916.833770) |----sysret_audit | |----audit_syscall_exit (2916.833770) | |----path_put (2916.833770) | | |----dput (2916.833771) | |----unroll_tree_refs (2916.833771) | |----kfree (2916.833771) |----apic_timer_interrupt | |----smp_apic_timer_interrupt (2916.833774) | |----native_apic_mem_write (2916.833774) | |----exit_idle (2916.833774) | |----irq_enter (2916.833775) | | |----idle_cpu (2916.833775) | |----hrtimer_interrupt (2916.833775) | |----ktime_get (2916.833776) | | |----ktime_get_ts (2916.833776) | | |----getnstimeofday (2916.833776) | | |----set_normalized_timespec (2916.833777) | |----_spin_lock (2916.833777) | |----_spin_lock (2916.833778) | |----__run_hrtimer (2916.833778) | |----__remove_hrtimer (2916.833778) | |----timer_stats_update_stats (2916.833779) | |----tick_sched_timer (2916.833779) | |----ktime_get (2916.833780) | | |----ktime_get_ts (2916.833780) | | |----getnstimeofday (2916.833780) | | |----set_normalized_timespec (2916.833781) | |----update_process_times (2916.833781) | |----account_process_tick (2916.833781) | | |----account_user_time (2916.833782) | | |----acct_update_integrals (2916.833782) | | |----jiffies_to_timeval (2916.833783) | |----run_local_timers (2916.833783) | | |----hrtimer_run_queues (2916.833783) | | |----raise_softirq (2916.833784) | | |----softlockup_tick (2916.833784) | | |----__touch_softlockup_watchdog (2916.833784) | |----rcu_pending (2916.833785) | |----rcu_check_callbacks (2916.833785) | | |----raise_softirq (2916.833786) | |----printk_tick (2916.833786) | |----scheduler_tick (2916.833786) |----sched_clock_tick | |----ktime_get (2916.833787) | |----ktime_get_ts (2916.833787) | |----getnstimeofday (2916.833787) | |----set_normalized_timespec (2916.833788) |----scheduler_tick | |----_spin_lock (2916.833788) | |----task_tick_fair (2916.833789) | |----update_curr (2916.833789) |----update_process_times | |----run_posix_cpu_timers (2916.833789) |----tick_sched_timer | |----profile_tick (2916.833790) | |----hrtimer_forward (2916.833791) | |----ktime_add_safe (2916.833791) | |----ktime_add_safe (2916.833792) |----__run_hrtimer | |----_spin_lock (2916.833792) | |----enqueue_hrtimer (2916.833792) |----hrtimer_interrupt | |----tick_program_event (2916.833793) | |----tick_dev_program_event (2916.833793) | |----ktime_get (2916.833793) | | |----ktime_get_ts (2916.833794) | | |----getnstimeofday (2916.833794) | | |----set_normalized_timespec (2916.833794) | |----clockevents_program_event (2916.833795) | |----lapic_next_event (2916.833795) | |----native_apic_mem_write (2916.833795) |----smp_apic_timer_interrupt | |----irq_exit (2916.833796) | |----do_softirq (2916.833796) |----call_softirq | |----__do_softirq (2916.833796) | |----run_timer_softirq (2916.833797) | | |----hrtimer_run_pending (2916.833797) | |----rcu_bh_qsctr_inc (2916.833798) | |----rcu_process_callbacks (2916.833798) | | |----__rcu_process_callbacks (2916.833798) | | | |----_spin_lock_irqsave (2916.833799) | | | |----rcu_start_batch (2916.833799) | | | |----_spin_unlock_irqrestore (2916.833799) | | | |----release_tgcred_rcu (2916.833800) | | | | |----key_put (2916.833800) | | | | |----key_put (2916.833801) | | | | |----kfree (2916.833801) | | | | |----__phys_addr (2916.833802) | | | | |----__slab_free (2916.833802) | | | |----release_tgcred_rcu (2916.833803) | | | |----key_put (2916.833803) | | | |----key_put (2916.833803) | | | |----kfree (2916.833803) | | | |----__phys_addr (2916.833804) | | | |----__slab_free (2916.833804) | | | |----add_partial (2916.833805) | | | |----_spin_lock (2916.833805) | | |----__rcu_process_callbacks (2916.833806) | |----rcu_bh_qsctr_inc (2916.833806) | |----_local_bh_enable (2916.833806) |----irq_exit | |----idle_cpu (2916.833807) |----auditsys | |----audit_syscall_entry (2916.833816) | |----current_kernel_time (2916.833817) |----system_call_fastpath | |----sys_rt_sigprocmask (2916.833817) | |----_spin_lock_irq (2916.833818) |----sysret_audit | |----audit_syscall_exit (2916.833819) | |----path_put (2916.833819) | | |----dput (2916.833819) | |----unroll_tree_refs (2916.833820) | |----kfree (2916.833820) |----auditsys | |----audit_syscall_entry (2916.833868) | |----current_kernel_time (2916.833869) |----system_call_fastpath | |----sys_newstat (2916.833869) | |----vfs_stat (2916.833870) | | |----vfs_fstatat (2916.833870) | | |----user_path_at (2916.833870) | | | |----getname (2916.833871) | | | | |----kmem_cache_alloc (2916.833871) | | | | | |----__might_sleep (2916.833872) | | | | | |----_cond_resched (2916.833872) | | | | | |----should_failslab (2916.833873) | | | | |----strncpy_from_user (2916.833874) | | | | |----__strncpy_from_user (2916.833874) | | | | |----__might_sleep (2916.833875) | | | | |----_cond_resched (2916.833875) | | | |----do_path_lookup (2916.833876) | | | | |----path_init (2916.833876) | | | | | |----_read_lock (2916.833877) | | | | |----path_walk (2916.833878) | | | | |----__link_path_walk (2916.833878) | | | | | |----inode_permission (2916.833879) | | | | | |----ext3_permission (2916.833880) | | | | | | |----generic_permission (2916.833880) | | | | | |----security_inode_permission (2916.833881) | | | | | |----cap_inode_permission (2916.833881) | | | | |----path_put (2916.833883) | | | | |----dput (2916.833883) | | | | |----mntput_no_expire (2916.833883) | | | |----putname (2916.833884) | | | |----kmem_cache_free (2916.833884) | | | |----__phys_addr (2916.833884) | | |----vfs_getattr (2916.833885) | | | |----security_inode_getattr (2916.833885) | | | | |----cap_inode_getattr (2916.833886) | | | |----generic_fillattr (2916.833886) | | |----path_put (2916.833887) | | |----dput (2916.833887) | | |----mntput_no_expire (2916.833887) | |----cp_new_stat (2916.833888) |----sysret_audit | |----audit_syscall_exit (2916.833888) | |----path_put (2916.833889) | | |----dput (2916.833889) | |----unroll_tree_refs (2916.833889) | |----kfree (2916.833890) |----auditsys | |----audit_syscall_entry (2916.833892) | |----current_kernel_time (2916.833892) |----system_call_fastpath | |----sys_newstat (2916.833893) | |----vfs_stat (2916.833893) | |----vfs_fstatat (2916.833893) | |----user_path_at (2916.833893) | |----getname (2916.833894) | | |----kmem_cache_alloc (2916.833894) | | | |----__might_sleep (2916.833894) | | | |----_cond_resched (2916.833895) | | | |----should_failslab (2916.833895) | | |----strncpy_from_user (2916.833895) | | |----__strncpy_from_user (2916.833896) | | |----__might_sleep (2916.833896) | | |----_cond_resched (2916.833896) | |----do_path_lookup (2916.833897) | |----path_init (2916.833898) | | |----_read_lock (2916.833898) | |----path_walk (2916.833899) |----apic_timer_interrupt | |----smp_apic_timer_interrupt (2916.833899) |----path_walk | |----__link_path_walk (2916.833900) | |----inode_permission (2916.833901) |