aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2013-08-07 22:50:53 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-08-12 09:31:08 -0400
commit307cbb92aa2bdc9eed7c74409ff4d5fc9135b4e2 (patch)
tree6bb79444961ea376caaa27ccd8ce01e37068f684 /tools
parentb0b35f0179161a5e256eebffa274b0b6f023f451 (diff)
perf evsel: Add option to limit stack depth in callchain dumps
Option is used by upcoming timehist command. Signed-off-by: David 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: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-script.c6
-rw-r--r--tools/perf/util/session.c6
-rw-r--r--tools/perf/util/session.h2
3 files changed, 9 insertions, 5 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index ee5d6f8b7415..33b2d830eabd 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -402,7 +402,8 @@ static void print_sample_bts(union perf_event *event,
402 else 402 else
403 printf("\n"); 403 printf("\n");
404 perf_evsel__print_ip(evsel, event, sample, machine, 404 perf_evsel__print_ip(evsel, event, sample, machine,
405 output[attr->type].print_ip_opts); 405 output[attr->type].print_ip_opts,
406 PERF_MAX_STACK_DEPTH);
406 } 407 }
407 408
408 printf(" => "); 409 printf(" => ");
@@ -444,7 +445,8 @@ static void process_event(union perf_event *event, struct perf_sample *sample,
444 printf("\n"); 445 printf("\n");
445 446
446 perf_evsel__print_ip(evsel, event, sample, machine, 447 perf_evsel__print_ip(evsel, event, sample, machine,
447 output[attr->type].print_ip_opts); 448 output[attr->type].print_ip_opts,
449 PERF_MAX_STACK_DEPTH);
448 } 450 }
449 451
450 printf("\n"); 452 printf("\n");
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 0d895e7040e4..5a8996493d94 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1489,7 +1489,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
1489 1489
1490void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event, 1490void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
1491 struct perf_sample *sample, struct machine *machine, 1491 struct perf_sample *sample, struct machine *machine,
1492 unsigned int print_opts) 1492 unsigned int print_opts, unsigned int stack_depth)
1493{ 1493{
1494 struct addr_location al; 1494 struct addr_location al;
1495 struct callchain_cursor_node *node; 1495 struct callchain_cursor_node *node;
@@ -1517,7 +1517,7 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
1517 } 1517 }
1518 callchain_cursor_commit(&callchain_cursor); 1518 callchain_cursor_commit(&callchain_cursor);
1519 1519
1520 while (1) { 1520 while (stack_depth) {
1521 node = callchain_cursor_current(&callchain_cursor); 1521 node = callchain_cursor_current(&callchain_cursor);
1522 if (!node) 1522 if (!node)
1523 break; 1523 break;
@@ -1544,6 +1544,8 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
1544 printf("\n"); 1544 printf("\n");
1545 1545
1546 callchain_cursor_advance(&callchain_cursor); 1546 callchain_cursor_advance(&callchain_cursor);
1547
1548 stack_depth--;
1547 } 1549 }
1548 1550
1549 } else { 1551 } else {
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 7c00ccb1173e..3aa75fb2225f 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -109,7 +109,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
109 109
110void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event, 110void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
111 struct perf_sample *sample, struct machine *machine, 111 struct perf_sample *sample, struct machine *machine,
112 unsigned int print_opts); 112 unsigned int print_opts, unsigned int stack_depth);
113 113
114int perf_session__cpu_bitmap(struct perf_session *session, 114int perf_session__cpu_bitmap(struct perf_session *session,
115 const char *cpu_list, unsigned long *cpu_bitmap); 115 const char *cpu_list, unsigned long *cpu_bitmap);