Skip to content

Commit 1c0cec6

Browse files
Hui Surostedt
authored andcommitted
scripts/tracing: fix the bug that can't parse raw_trace_func
Since commit 77271ce ("tracing: Add irq, preempt-count and need resched info to default trace output"), the default trace output format has been changed to: <idle>-0 [009] d.h. 22420.068695: _raw_spin_lock_irqsave <-hrtimer_interrupt <idle>-0 [000] ..s. 22420.068695: _nohz_idle_balance <-run_rebalance_domains <idle>-0 [011] d.h. 22420.068695: account_process_tick <-update_process_times origin trace output format:(before v3.2.0) # tracer: nop # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | migration/0-6 [000] 50.025810: rcu_note_context_switch <-__schedule migration/0-6 [000] 50.025812: trace_rcu_utilization <-rcu_note_context_switch migration/0-6 [000] 50.025813: rcu_sched_qs <-rcu_note_context_switch migration/0-6 [000] 50.025815: rcu_preempt_qs <-rcu_note_context_switch migration/0-6 [000] 50.025817: trace_rcu_utilization <-rcu_note_context_switch migration/0-6 [000] 50.025818: debug_lockdep_rcu_enabled <-__schedule migration/0-6 [000] 50.025820: debug_lockdep_rcu_enabled <-__schedule The draw_functrace.py(introduced in v2.6.28) can't parse the new version format trace_func, So we need modify draw_functrace.py to adapt the new version trace output format. Link: https://lkml.kernel.org/r/20210611022107.608787-1-suhui@zeku.com Cc: stable@vger.kernel.org Fixes: 77271ce tracing: Add irq, preempt-count and need resched info to default trace output Signed-off-by: Hui Su <suhui@zeku.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent b18b851 commit 1c0cec6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/tracing/draw_functrace.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
$ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func
1818
Wait some times but not too much, the script is a bit slow.
1919
Break the pipe (Ctrl + Z)
20-
$ scripts/draw_functrace.py < raw_trace_func > draw_functrace
20+
$ scripts/tracing/draw_functrace.py < ~/raw_trace_func > draw_functrace
2121
Then you have your drawn trace in draw_functrace
2222
"""
2323

@@ -103,10 +103,10 @@ def parseLine(line):
103103
line = line.strip()
104104
if line.startswith("#"):
105105
raise CommentLineException
106-
m = re.match("[^]]+?\\] +([0-9.]+): (\\w+) <-(\\w+)", line)
106+
m = re.match("[^]]+?\\] +([a-z.]+) +([0-9.]+): (\\w+) <-(\\w+)", line)
107107
if m is None:
108108
raise BrokenLineException
109-
return (m.group(1), m.group(2), m.group(3))
109+
return (m.group(2), m.group(3), m.group(4))
110110

111111

112112
def main():

0 commit comments

Comments
 (0)