下面是trace扩展的项目地址:
如果已经编译安装过crash,可以直接编译,然后使用extend工具加载.
加载模块
crash> extend /mnt/crash-trace/trace.so /mnt/crash-trace/trace.so: shared object loaded crash> extend SHARED OBJECT COMMANDS /mnt/crash-trace/trace.so trace
输出缓冲区数据
crash> trace show ... cpus=8 bash-461 [002] 548.086834: function: mutex_unlock bash-461 [002] 548.086847: function: __mutex_unlock_slowpath bash-461 [002] 548.086849: function: preempt_count_add bash-461 [002] 548.086849: function: rcu_read_lock_any_held bash-461 [002] 548.086849: function: rcu_read_lock_held_common bash-461 [002] 548.086849: function: rcu_lockdep_current_cpu_online bash-461 [002] 548.086849: function: preempt_count_sub bash-461 [002] 548.086850: function: syscall_exit_to_user_mode_prepare bash-461 [002] 548.086850: function: exit_to_user_mode_prepare bash-461 [002] 548.086851: function: fpregs_assert_state_consistent bash-461 [002] 548.086851: function: switch_fpu_return bash-461 [002] 548.086862: function: __x64_sys_dup2
导出到trace.dat
crash> trace dump -t # trace-cmd report ... cpus=8 bash-461 [002] 548.086834: function: mutex_unlock bash-461 [002] 548.086847: function: __mutex_unlock_slowpath bash-461 [002] 548.086849: function: preempt_count_add bash-461 [002] 548.086849: function: rcu_read_lock_any_held bash-461 [002] 548.086849: function: rcu_read_lock_held_common bash-461 [002] 548.086849: function: rcu_lockdep_current_cpu_online bash-461 [002] 548.086849: function: preempt_count_sub bash-461 [002] 548.086850: function: syscall_exit_to_user_mode_prepare
卸载
crash> extend /mnt/crash-trace/trace.so -u /mnt/crash-trace/trace.so: shared object unloaded