File perf-intel-pt-Fix-parsing-of-VM-time-correlation-arguments.patch of Package perf
xxxxxxxxxx
1
From: Adrian Hunter <adrian.hunter@intel.com>
2
Date: Wed, 15 Dec 2021 10:06:34 +0200
3
Subject: perf intel-pt: Fix parsing of VM time correlation arguments
4
Git-commit: a78abde220243d6f44a265fe36c49957f6fa9851
5
Patch-mainline: v5.16-rc8
6
References: git-fixes
7
8
Parser did not take ':' into account.
9
10
Example:
11
12
Before:
13
14
$ perf record -e intel_pt//u uname
15
Linux
16
[ perf record: Woken up 1 times to write data ]
17
[ perf record: Captured and wrote 0.026 MB perf.data ]
18
$ perf inject -i perf.data --vm-time-correlation="dry-run 123"
19
$ perf inject -i perf.data --vm-time-correlation="dry-run 123:456"
20
Failed to parse VM Time Correlation options
21
0x620 [0x98]: failed to process type: 70 [Invalid argument]
22
$
23
24
After:
25
26
$ perf inject -i perf.data --vm-time-correlation="dry-run 123:456"
27
$
28
29
Fixes: e3ff42bdebcfeb5f ("perf intel-pt: Parse VM Time Correlation options and set up decoding")
30
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
31
Acked-by: Namhyung Kim <namhyung@kernel.org>
32
Cc: Jiri Olsa <jolsa@redhat.com>
33
Cc: Riccardo Mancini <rickyman7@gmail.com>
34
Cc: stable@vger.kernel.org
35
Link: https://lore.kernel.org/r/20211215080636.149562-2-adrian.hunter@intel.com
36
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
37
Signed-off-by: Tony Jones <tonyj@suse.de>
38
---
39
tools/perf/util/intel-pt.c | 1 +
40
1 file changed, 1 insertion(+)
41
42
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
43
index 10c3187e4c5a..e8613cbda331 100644
44
--- a/tools/perf/util/intel-pt.c
45
+++ b/tools/perf/util/intel-pt.c
46
47
*args = p;
48
return 0;
49
}
50
+ p += 1;
51
while (1) {
52
vmcs = strtoull(p, &p, 0);
53
if (errno)
54
55