aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/callchain.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2014-01-14 10:37:16 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-01-17 09:25:24 -0500
commit2a29190c040c0b11e39197c67abf6f87e0a61f9a (patch)
tree68187bf0c9d8a1eb653d230dbd0d38ffd0046a27 /tools/perf/util/callchain.c
parentb965bb41061ad8d3eafda6e7feef89279fcd3916 (diff)
perf tools: Remove unnecessary callchain cursor state restore on unmatch
If a new callchain branch doesn't match a single entry of the node that it is given against comparison in append_chain(), then the cursor is expected to be at the same position as it was before the comparison loop. As such, there is no need to restore the cursor position on exit in case of non matching branches. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1389713836-13375-4-git-send-email-fweisbec@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/callchain.c')
-rw-r--r--tools/perf/util/callchain.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 662867d5c374..8d9db454f1a9 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -388,7 +388,6 @@ append_chain(struct callchain_node *root,
388 struct callchain_cursor *cursor, 388 struct callchain_cursor *cursor,
389 u64 period) 389 u64 period)
390{ 390{
391 struct callchain_cursor_node *curr_snap = cursor->curr;
392 struct callchain_list *cnode; 391 struct callchain_list *cnode;
393 u64 start = cursor->pos; 392 u64 start = cursor->pos;
394 bool found = false; 393 bool found = false;
@@ -420,8 +419,6 @@ append_chain(struct callchain_node *root,
420 /* matches not, relay no the parent */ 419 /* matches not, relay no the parent */
421 if (!found) { 420 if (!found) {
422 WARN_ONCE(!cmp, "Chain comparison error\n"); 421 WARN_ONCE(!cmp, "Chain comparison error\n");
423 cursor->curr = curr_snap;
424 cursor->pos = start;
425 return cmp; 422 return cmp;
426 } 423 }
427 424