Commit 94786b67 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri Olsa <jolsa@kernel.org>
Acked-by: default avatarDavid 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 94c0655f
...@@ -58,17 +58,19 @@ struct report { ...@@ -58,17 +58,19 @@ struct report {
const char *symbol_filter_str; const char *symbol_filter_str;
float min_percent; float min_percent;
u64 nr_entries; u64 nr_entries;
u64 queue_size;
DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
}; };
static int report__config(const char *var, const char *value, void *cb) static int report__config(const char *var, const char *value, void *cb)
{ {
struct report *rep = cb;
if (!strcmp(var, "report.group")) { if (!strcmp(var, "report.group")) {
symbol_conf.event_group = perf_config_bool(var, value); symbol_conf.event_group = perf_config_bool(var, value);
return 0; return 0;
} }
if (!strcmp(var, "report.percent-limit")) { if (!strcmp(var, "report.percent-limit")) {
struct report *rep = cb;
rep->min_percent = strtof(value, NULL); rep->min_percent = strtof(value, NULL);
return 0; return 0;
} }
...@@ -76,6 +78,10 @@ static int report__config(const char *var, const char *value, void *cb) ...@@ -76,6 +78,10 @@ static int report__config(const char *var, const char *value, void *cb)
symbol_conf.cumulate_callchain = perf_config_bool(var, value); symbol_conf.cumulate_callchain = perf_config_bool(var, value);
return 0; return 0;
} }
if (!strcmp(var, "report.queue-size")) {
rep->queue_size = perf_config_u64(var, value);
return 0;
}
return perf_default_config(var, value, cb); return perf_default_config(var, value, cb);
} }
...@@ -714,6 +720,11 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) ...@@ -714,6 +720,11 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
if (session == NULL) if (session == NULL)
return -ENOMEM; return -ENOMEM;
if (report.queue_size) {
ordered_events__set_alloc_size(&session->ordered_events,
report.queue_size);
}
report.session = session; report.session = session;
has_br_stack = perf_header__has_feat(&session->header, has_br_stack = perf_header__has_feat(&session->header,
......
...@@ -40,4 +40,10 @@ int ordered_events__flush(struct perf_session *s, struct perf_tool *tool, ...@@ -40,4 +40,10 @@ int ordered_events__flush(struct perf_session *s, struct perf_tool *tool,
enum oe_flush how); enum oe_flush how);
void ordered_events__init(struct ordered_events *oe); void ordered_events__init(struct ordered_events *oe);
void ordered_events__free(struct ordered_events *oe); void ordered_events__free(struct ordered_events *oe);
static inline
void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)
{
oe->max_alloc_size = size;
}
#endif /* __ORDERED_EVENTS_H */ #endif /* __ORDERED_EVENTS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment