diff options
author | LiweiSong <liwei.song@windriver.com> | 2021-05-25 13:40:33 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-05-28 06:55:33 -0700 |
commit | 8edab5f09d9342b562bfaae851625cb2debcb3ef (patch) | |
tree | 27de880f7dfc402efdc27b39f75a20a75d20faca /meta-oe/recipes-kernel | |
parent | b25ea9cb97a7afbffdf4ed01c195ab602213ed18 (diff) | |
download | meta-openembedded-contrib-8edab5f09d9342b562bfaae851625cb2debcb3ef.tar.gz |
pm-graph: parse separated cpu exec line
if cpu exec line was split into different line, there will be an error
when parse it:
File "/usr/bin/sleepgraph", line 3165, in parseTraceLog
proclist[name] = int(val[1])
IndexError: list index out of range
check this case and append to parse the unfinished line.
Signed-off-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel')
-rw-r--r-- | meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch | 51 | ||||
-rw-r--r-- | meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch b/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch new file mode 100644 index 0000000000..33557275fb --- /dev/null +++ b/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch @@ -0,0 +1,51 @@ +From 9bbc991a927722439cad38c892fc9f57207089d3 Mon Sep 17 00:00:00 2001 +From: Liwei Song <liwei.song@windriver.com> +Date: Mon, 24 May 2021 08:27:28 +0000 +Subject: [PATCH] sleepgraph.py: parse unfished cpu exec line + +exist the below case in ftrace file: +sleepgraph-6508 [003] .... 18197.824037: tracing_mark_write: ps - xxx..., lock_torture_wr-94 169,lock_torture_wr-95 143,lock_tort +sleepgraph-6508 [003] .... 18197.824043: tracing_mark_write: ure_wr-96 189,lock_torture_wr-97 174,lock_torture_wr-98 160,lock_torture_st-99 1 + +lock_torture_wr-96 was split to different line due to limited buffer +size(1k) set in kernel, check this case and re-parse the unfinished +line. + +Upstream-Status: [Submitted: https://github.com/intel/pm-graph/pull/20] + +Signed-off-by: Liwei Song <liwei.song@windriver.com> +--- + sleepgraph.py | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/sleepgraph.py b/sleepgraph.py +index e340d5b3f03b..38b4439db8eb 100755 +--- a/sleepgraph.py ++++ b/sleepgraph.py +@@ -3365,8 +3365,21 @@ def parseTraceLog(live=False): + val = ps.split() + if not val: + continue +- name = val[0].replace('--', '-') +- proclist[name] = int(val[1]) ++ if not len(val) < 2: ++ name = val[0].replace('--', '-') ++ proclist[name] = int(val[1]) ++ else: ++ proclist = dict() ++ nextline = next(tf) ++ mcont = re.match(tp.ftrace_line_fmt, nextline) ++ n = m.group('ps') + mcont.group('msg').split(': ')[1] ++ for pscont in n.split(','): ++ val = pscont.split() ++ if not val: ++ continue ++ if not len(val) < 2: ++ name = val[0].replace('--', '-') ++ proclist[name] = int(val[1]) + data.pstl[t.time] = proclist + continue + # find the end of resume +-- +2.29.2 + diff --git a/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb b/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb index 4526eeed3f..4d7a1b2d45 100644 --- a/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb +++ b/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb @@ -10,6 +10,7 @@ SRC_URI = "git://github.com/intel/pm-graph.git \ file://0001-Makefile-fix-multilib-build-failure.patch \ file://0001-sleepgraph.py-use-python3.patch \ file://0001-sleepgraph-add-support-for-RT-kernel-ftrace-flags.patch \ + file://0001-sleepgraph.py-parse-unfished-cpu-exec-line.patch \ " S = "${WORKDIR}/git" |