Selaa lähdekoodia

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>
Frederic Weisbecker 11 vuotta sitten
vanhempi
commit
2a29190c04
1 muutettua tiedostoa jossa 0 lisäystä ja 3 poistoa
  1. 0 3
      tools/perf/util/callchain.c

+ 0 - 3
tools/perf/util/callchain.c

@@ -388,7 +388,6 @@ append_chain(struct callchain_node *root,
 	     struct callchain_cursor *cursor,
 	     struct callchain_cursor *cursor,
 	     u64 period)
 	     u64 period)
 {
 {
-	struct callchain_cursor_node *curr_snap = cursor->curr;
 	struct callchain_list *cnode;
 	struct callchain_list *cnode;
 	u64 start = cursor->pos;
 	u64 start = cursor->pos;
 	bool found = false;
 	bool found = false;
@@ -420,8 +419,6 @@ append_chain(struct callchain_node *root,
 	/* matches not, relay no the parent */
 	/* matches not, relay no the parent */
 	if (!found) {
 	if (!found) {
 		WARN_ONCE(!cmp, "Chain comparison error\n");
 		WARN_ONCE(!cmp, "Chain comparison error\n");
-		cursor->curr = curr_snap;
-		cursor->pos = start;
 		return cmp;
 		return cmp;
 	}
 	}