]>
Commit | Line | Data |
---|---|---|
5a5e98ca GKH |
1 | From 33da54fa86e29b87fe1e83bd0f15b4ef2be53ecb Mon Sep 17 00:00:00 2001 |
2 | From: Jiri Olsa <jolsa@kernel.org> | |
3 | Date: Thu, 11 Aug 2016 10:50:57 +0200 | |
4 | Subject: perf tools mem: Fix -t store option for record command | |
5 | ||
6 | From: Jiri Olsa <jolsa@kernel.org> | |
7 | ||
8 | commit 33da54fa86e29b87fe1e83bd0f15b4ef2be53ecb upstream. | |
9 | ||
10 | Michael reported 'perf mem -t store record' being broken. The reason is | |
11 | latest rework of this area: | |
12 | ||
13 | commit acbe613e0c03 ("perf tools: Add monitored events array") | |
14 | ||
15 | We don't mark perf_mem_events store record when -t store option is | |
16 | specified. | |
17 | ||
18 | Committer notes: | |
19 | ||
20 | Before: | |
21 | ||
22 | # perf mem -t store record usleep 1 | |
23 | [ perf record: Woken up 1 times to write data ] | |
24 | [ perf record: Captured and wrote 0.020 MB perf.data (7 samples) ] | |
25 | # perf evlist | |
26 | cycles:ppp | |
27 | # | |
28 | ||
29 | After: | |
30 | ||
31 | # perf mem -t store record usleep 1 | |
32 | [ perf record: Woken up 1 times to write data ] | |
33 | [ perf record: Captured and wrote 0.020 MB perf.data (7 samples) ] | |
34 | # perf evlist | |
35 | cpu/mem-stores/P | |
36 | # | |
37 | ||
38 | Reported-by: Michael Petlan <mpetlan@redhat.com> | |
39 | Signed-off-by: Jiri Olsa <jolsa@redhat.com> | |
40 | Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> | |
41 | Cc: David Ahern <dsahern@gmail.com> | |
42 | Cc: Namhyung Kim <namhyung@kernel.org> | |
43 | Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
44 | Fixes: acbe613e0c03 ("perf tools: Add monitored events array") | |
45 | Link: http://lkml.kernel.org/r/1470905457-18311-1-git-send-email-jolsa@kernel.org | |
46 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> | |
47 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
48 | ||
49 | --- | |
50 | tools/perf/builtin-mem.c | 3 +++ | |
51 | 1 file changed, 3 insertions(+) | |
52 | ||
53 | --- a/tools/perf/builtin-mem.c | |
54 | +++ b/tools/perf/builtin-mem.c | |
55 | @@ -87,6 +87,9 @@ static int __cmd_record(int argc, const | |
56 | if (mem->operation & MEM_OPERATION_LOAD) | |
57 | perf_mem_events[PERF_MEM_EVENTS__LOAD].record = true; | |
58 | ||
59 | + if (mem->operation & MEM_OPERATION_STORE) | |
60 | + perf_mem_events[PERF_MEM_EVENTS__STORE].record = true; | |
61 | + | |
62 | if (perf_mem_events[PERF_MEM_EVENTS__LOAD].record) | |
63 | rec_argv[i++] = "-W"; | |
64 |