Thread (90 messages) flat view 90 messages, 8 authors, 2016-01-13
STALE3873d

[PATCH 49/53] perf tools: Consider TAILSIZE bit when caclulate is_pos

From: Wang Nan <hidden>
Date: 2016-01-11 13:49:55
Also in: lkml
Subsystem: performance events subsystem, the rest · Maintainers: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Linus Torvalds

evsel->is_pos indicates event id location in a event (count backward).
It is used to find id for tracking events (mmap, exit...). If TAILSIZE
is selected, this location should be changed accordingly.

Signed-off-by: Wang Nan <redacted>
Signed-off-by: He Kuang <redacted>
Cc: Arnaldo Carvalho de Melo <redacted>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <redacted>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <redacted>
Cc: pi3orama@163.com
---
 tools/perf/util/evsel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 6932b8b..c59ea34 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -144,10 +144,10 @@ static int __perf_evsel__calc_id_pos(u64 sample_type)
  */
 static int __perf_evsel__calc_is_pos(u64 sample_type)
 {
-	int idx = 1;
+	int idx = 1 + (sample_type & PERF_SAMPLE_TAILSIZE ? 1 : 0);
 
 	if (sample_type & PERF_SAMPLE_IDENTIFIER)
-		return 1;
+		return idx;
 
 	if (!(sample_type & PERF_SAMPLE_ID))
 		return -1;
-- 
1.8.3.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help