aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2014-06-05 05:00:20 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-12 11:03:01 -0400
commit94786b67b5f4577c16486e8eb10ff045e59f80ef (patch)
treef3d0bfa3496ebfdf82bd260f01393fd63df8af35
parent94c0655fc16b0c09edc21cadddbeef95c408f3e7 (diff)
perf tools: Add report.queue-size config file option
Adding report.queue-size config file option to setup the maximum allocation size for session's struct ordered_events object. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: David Ahern <dsahern@gmail.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jean Pihet <jean.pihet@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-lm42mbpu0cwljpyy8vw5y26n@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-report.c13
-rw-r--r--tools/perf/util/ordered-events.h6
2 files changed, 18 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c72cc5a12144..041e93da13e4 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -58,17 +58,19 @@ struct report {
58 const char *symbol_filter_str; 58 const char *symbol_filter_str;
59 float min_percent; 59 float min_percent;
60 u64 nr_entries; 60 u64 nr_entries;
61 u64 queue_size;
61 DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); 62 DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
62}; 63};
63 64
64static int report__config(const char *var, const char *value, void *cb) 65static int report__config(const char *var, const char *value, void *cb)
65{ 66{
67 struct report *rep = cb;
68
66 if (!strcmp(var, "report.group")) { 69 if (!strcmp(var, "report.group")) {
67 symbol_conf.event_group = perf_config_bool(var, value); 70 symbol_conf.event_group = perf_config_bool(var, value);
68 return 0; 71 return 0;
69 } 72 }
70 if (!strcmp(var, "report.percent-limit")) { 73 if (!strcmp(var, "report.percent-limit")) {
71 struct report *rep = cb;
72 rep->min_percent = strtof(value, NULL); 74 rep->min_percent = strtof(value, NULL);
73 return 0; 75 return 0;
74 } 76 }
@@ -76,6 +78,10 @@ static int report__config(const char *var, const char *value, void *cb)
76 symbol_conf.cumulate_callchain = perf_config_bool(var, value); 78 symbol_conf.cumulate_callchain = perf_config_bool(var, value);
77 return 0; 79 return 0;
78 } 80 }
81 if (!strcmp(var, "report.queue-size")) {
82 rep->queue_size = perf_config_u64(var, value);
83 return 0;
84 }
79 85
80 return perf_default_config(var, value, cb); 86 return perf_default_config(var, value, cb);
81} 87}
@@ -714,6 +720,11 @@ repeat:
714 if (session == NULL) 720 if (session == NULL)
715 return -ENOMEM; 721 return -ENOMEM;
716 722
723 if (report.queue_size) {
724 ordered_events__set_alloc_size(&session->ordered_events,
725 report.queue_size);
726 }
727
717 report.session = session; 728 report.session = session;
718 729
719 has_br_stack = perf_header__has_feat(&session->header, 730 has_br_stack = perf_header__has_feat(&session->header,
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index 6036bd657073..2ce847fb48a5 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -40,4 +40,10 @@ int ordered_events__flush(struct perf_session *s, struct perf_tool *tool,
40 enum oe_flush how); 40 enum oe_flush how);
41void ordered_events__init(struct ordered_events *oe); 41void ordered_events__init(struct ordered_events *oe);
42void ordered_events__free(struct ordered_events *oe); 42void ordered_events__free(struct ordered_events *oe);
43
44static inline
45void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)
46{
47 oe->max_alloc_size = size;
48}
43#endif /* __ORDERED_EVENTS_H */ 49#endif /* __ORDERED_EVENTS_H */