Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 307cbb92 authored by David Ahern's avatar David Ahern Committed by Arnaldo Carvalho de Melo
Browse files

perf evsel: Add option to limit stack depth in callchain dumps



Option is used by upcoming timehist command.

Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@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/1375930261-77273-12-git-send-email-dsahern@gmail.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent b0b35f01
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -402,7 +402,8 @@ static void print_sample_bts(union perf_event *event,
		else
		else
			printf("\n");
			printf("\n");
		perf_evsel__print_ip(evsel, event, sample, machine,
		perf_evsel__print_ip(evsel, event, sample, machine,
				     output[attr->type].print_ip_opts);
				     output[attr->type].print_ip_opts,
				     PERF_MAX_STACK_DEPTH);
	}
	}


	printf(" => ");
	printf(" => ");
@@ -444,7 +445,8 @@ static void process_event(union perf_event *event, struct perf_sample *sample,
			printf("\n");
			printf("\n");


		perf_evsel__print_ip(evsel, event, sample, machine,
		perf_evsel__print_ip(evsel, event, sample, machine,
				     output[attr->type].print_ip_opts);
				     output[attr->type].print_ip_opts,
				     PERF_MAX_STACK_DEPTH);
	}
	}


	printf("\n");
	printf("\n");
+4 −2
Original line number Original line Diff line number Diff line
@@ -1489,7 +1489,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,


void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
			  struct perf_sample *sample, struct machine *machine,
			  struct perf_sample *sample, struct machine *machine,
			  unsigned int print_opts)
			  unsigned int print_opts, unsigned int stack_depth)
{
{
	struct addr_location al;
	struct addr_location al;
	struct callchain_cursor_node *node;
	struct callchain_cursor_node *node;
@@ -1517,7 +1517,7 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
		}
		}
		callchain_cursor_commit(&callchain_cursor);
		callchain_cursor_commit(&callchain_cursor);


		while (1) {
		while (stack_depth) {
			node = callchain_cursor_current(&callchain_cursor);
			node = callchain_cursor_current(&callchain_cursor);
			if (!node)
			if (!node)
				break;
				break;
@@ -1544,6 +1544,8 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
				printf("\n");
				printf("\n");


			callchain_cursor_advance(&callchain_cursor);
			callchain_cursor_advance(&callchain_cursor);

			stack_depth--;
		}
		}


	} else {
	} else {
+1 −1
Original line number Original line Diff line number Diff line
@@ -109,7 +109,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,


void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
			  struct perf_sample *sample, struct machine *machine,
			  struct perf_sample *sample, struct machine *machine,
			  unsigned int print_opts);
			  unsigned int print_opts, unsigned int stack_depth);


int perf_session__cpu_bitmap(struct perf_session *session,
int perf_session__cpu_bitmap(struct perf_session *session,
			     const char *cpu_list, unsigned long *cpu_bitmap);
			     const char *cpu_list, unsigned long *cpu_bitmap);