分析ftrace的时候,有时会对其字段部分不了解,有些字段解析的不清晰,例如D和~
# cat /sys/kernel/debug/tracing/trace
# tracer: function
#
# entries-in-buffer/entries-written: 0/23029303390 #P:8
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
kworker/u16:1-503 [003] D.~2 3037.587262: irq_find_mapping <-gic_handle_irq
对于5.10内核,我们找到其对应函数 trace_print_context,该函数可以仔细研读
trace_print_context
=>trace_seq_printf(s, "%16s-%-7d ", comm, entry->pid); // 打印线程名称和PID
=>trace_seq_printf(s, "[%03d] ", iter->cpu); // 打印线程所在CORE信息
=>trace_print_lat_fmt(s, entry); // 打印调度信息
=>trace_seq_printf(s, " %5lu.%06lu: ", secs, usec_rem); // 打印时间信息