From 31a80218aa6197b6070342e6a40d82f1e17745d4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 9 Aug 2021 11:21:25 +0200 Subject: [PATCH] 4.14-stable patches added patches: scripts-tracing-fix-the-bug-that-can-t-parse-raw_trace_func.patch --- ...-bug-that-can-t-parse-raw_trace_func.patch | 66 +++++++++++++++++++ queue-4.14/series | 1 + 2 files changed, 67 insertions(+) create mode 100644 queue-4.14/scripts-tracing-fix-the-bug-that-can-t-parse-raw_trace_func.patch diff --git a/queue-4.14/scripts-tracing-fix-the-bug-that-can-t-parse-raw_trace_func.patch b/queue-4.14/scripts-tracing-fix-the-bug-that-can-t-parse-raw_trace_func.patch new file mode 100644 index 00000000000..c82bd7a4a37 --- /dev/null +++ b/queue-4.14/scripts-tracing-fix-the-bug-that-can-t-parse-raw_trace_func.patch @@ -0,0 +1,66 @@ +From 1c0cec64a7cc545eb49f374a43e9f7190a14defa Mon Sep 17 00:00:00 2001 +From: Hui Su +Date: Fri, 11 Jun 2021 10:21:07 +0800 +Subject: scripts/tracing: fix the bug that can't parse raw_trace_func + +From: Hui Su + +commit 1c0cec64a7cc545eb49f374a43e9f7190a14defa upstream. + +Since commit 77271ce4b2c0 ("tracing: Add irq, preempt-count and need resched info +to default trace output"), the default trace output format has been changed to: + -0 [009] d.h. 22420.068695: _raw_spin_lock_irqsave <-hrtimer_interrupt + -0 [000] ..s. 22420.068695: _nohz_idle_balance <-run_rebalance_domains + -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: 77271ce4b2c0 tracing: Add irq, preempt-count and need resched info to default trace output +Signed-off-by: Hui Su +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman +--- + scripts/tracing/draw_functrace.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/scripts/tracing/draw_functrace.py ++++ b/scripts/tracing/draw_functrace.py +@@ -17,7 +17,7 @@ Usage: + $ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func + Wait some times but not too much, the script is a bit slow. + Break the pipe (Ctrl + Z) +- $ scripts/draw_functrace.py < raw_trace_func > draw_functrace ++ $ scripts/tracing/draw_functrace.py < ~/raw_trace_func > draw_functrace + Then you have your drawn trace in draw_functrace + """ + +@@ -103,10 +103,10 @@ def parseLine(line): + line = line.strip() + if line.startswith("#"): + raise CommentLineException +- m = re.match("[^]]+?\\] +([0-9.]+): (\\w+) <-(\\w+)", line) ++ m = re.match("[^]]+?\\] +([a-z.]+) +([0-9.]+): (\\w+) <-(\\w+)", line) + if m is None: + raise BrokenLineException +- return (m.group(1), m.group(2), m.group(3)) ++ return (m.group(2), m.group(3), m.group(4)) + + + def main(): diff --git a/queue-4.14/series b/queue-4.14/series index d48b4cfee74..4a85a8ab0e7 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -20,3 +20,4 @@ usb-gadget-f_hid-added-get_idle-and-set_idle-handlers.patch usb-gadget-f_hid-fixed-null-pointer-dereference.patch usb-gadget-f_hid-idle-uses-the-highest-byte-for-duration.patch usb-otg-fsm-fix-hrtimer-list-corruption.patch +scripts-tracing-fix-the-bug-that-can-t-parse-raw_trace_func.patch -- 2.47.3