William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 1 | From 9bbc991a927722439cad38c892fc9f57207089d3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Liwei Song <liwei.song@windriver.com> |
| 3 | Date: Mon, 24 May 2021 08:27:28 +0000 |
| 4 | Subject: [PATCH] sleepgraph.py: parse unfished cpu exec line |
| 5 | |
| 6 | exist the below case in ftrace file: |
| 7 | sleepgraph-6508 [003] .... 18197.824037: tracing_mark_write: ps - xxx..., lock_torture_wr-94 169,lock_torture_wr-95 143,lock_tort |
| 8 | 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 |
| 9 | |
| 10 | lock_torture_wr-96 was split to different line due to limited buffer |
| 11 | size(1k) set in kernel, check this case and re-parse the unfinished |
| 12 | line. |
| 13 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame^] | 14 | Upstream-Status: Submitted [https://github.com/intel/pm-graph/pull/20] |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 15 | |
| 16 | Signed-off-by: Liwei Song <liwei.song@windriver.com> |
| 17 | --- |
| 18 | sleepgraph.py | 17 +++++++++++++++-- |
| 19 | 1 file changed, 15 insertions(+), 2 deletions(-) |
| 20 | |
| 21 | diff --git a/sleepgraph.py b/sleepgraph.py |
| 22 | index e340d5b3f03b..38b4439db8eb 100755 |
| 23 | --- a/sleepgraph.py |
| 24 | +++ b/sleepgraph.py |
| 25 | @@ -3365,8 +3365,21 @@ def parseTraceLog(live=False): |
| 26 | val = ps.split() |
| 27 | if not val: |
| 28 | continue |
| 29 | - name = val[0].replace('--', '-') |
| 30 | - proclist[name] = int(val[1]) |
| 31 | + if not len(val) < 2: |
| 32 | + name = val[0].replace('--', '-') |
| 33 | + proclist[name] = int(val[1]) |
| 34 | + else: |
| 35 | + proclist = dict() |
| 36 | + nextline = next(tf) |
| 37 | + mcont = re.match(tp.ftrace_line_fmt, nextline) |
| 38 | + n = m.group('ps') + mcont.group('msg').split(': ')[1] |
| 39 | + for pscont in n.split(','): |
| 40 | + val = pscont.split() |
| 41 | + if not val: |
| 42 | + continue |
| 43 | + if not len(val) < 2: |
| 44 | + name = val[0].replace('--', '-') |
| 45 | + proclist[name] = int(val[1]) |
| 46 | data.pstl[t.time] = proclist |
| 47 | continue |
| 48 | # find the end of resume |
| 49 | -- |
| 50 | 2.29.2 |
| 51 | |