Skip to content

Commit

Permalink
perf tools: Remove unnecessary callchain cursor state restore on unmatch
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Namhyung Kim <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
fweisbec authored and acmel committed Jan 17, 2014
1 parent b965bb4 commit 2a29190
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tools/perf/util/callchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ append_chain(struct callchain_node *root,
struct callchain_cursor *cursor,
u64 period)
{
struct callchain_cursor_node *curr_snap = cursor->curr;
struct callchain_list *cnode;
u64 start = cursor->pos;
bool found = false;
Expand Down Expand Up @@ -420,8 +419,6 @@ append_chain(struct callchain_node *root,
/* matches not, relay no the parent */
if (!found) {
WARN_ONCE(!cmp, "Chain comparison error\n");
cursor->curr = curr_snap;
cursor->pos = start;
return cmp;
}

Expand Down

0 comments on commit 2a29190

Please sign in to comment.