Skip to content

Commit 2a29190

Browse files
fweisbecacmel
authored andcommitted
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>
1 parent b965bb4 commit 2a29190

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

tools/perf/util/callchain.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ append_chain(struct callchain_node *root,
388388
struct callchain_cursor *cursor,
389389
u64 period)
390390
{
391-
struct callchain_cursor_node *curr_snap = cursor->curr;
392391
struct callchain_list *cnode;
393392
u64 start = cursor->pos;
394393
bool found = false;
@@ -420,8 +419,6 @@ append_chain(struct callchain_node *root,
420419
/* matches not, relay no the parent */
421420
if (!found) {
422421
WARN_ONCE(!cmp, "Chain comparison error\n");
423-
cursor->curr = curr_snap;
424-
cursor->pos = start;
425422
return cmp;
426423
}
427424

0 commit comments

Comments
 (0)