Skip to content

Commit 94786b6

Browse files
olsajiriacmel
authored andcommitted
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>
1 parent 94c0655 commit 94786b6

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎tools/perf/builtin-report.c‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,30 @@ struct report {
5858
const char *symbol_filter_str;
5959
float min_percent;
6060
u64 nr_entries;
61+
u64 queue_size;
6162
DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
6263
};
6364

6465
static int report__config(const char *var, const char *value, void *cb)
6566
{
67+
struct report *rep = cb;
68+
6669
if (!strcmp(var, "report.group")) {
6770
symbol_conf.event_group = perf_config_bool(var, value);
6871
return 0;
6972
}
7073
if (!strcmp(var, "report.percent-limit")) {
71-
struct report *rep = cb;
7274
rep->min_percent = strtof(value, NULL);
7375
return 0;
7476
}
7577
if (!strcmp(var, "report.children")) {
7678
symbol_conf.cumulate_callchain = perf_config_bool(var, value);
7779
return 0;
7880
}
81+
if (!strcmp(var, "report.queue-size")) {
82+
rep->queue_size = perf_config_u64(var, value);
83+
return 0;
84+
}
7985

8086
return perf_default_config(var, value, cb);
8187
}
@@ -714,6 +720,11 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
714720
if (session == NULL)
715721
return -ENOMEM;
716722

723+
if (report.queue_size) {
724+
ordered_events__set_alloc_size(&session->ordered_events,
725+
report.queue_size);
726+
}
727+
717728
report.session = session;
718729

719730
has_br_stack = perf_header__has_feat(&session->header,

‎tools/perf/util/ordered-events.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,10 @@ int ordered_events__flush(struct perf_session *s, struct perf_tool *tool,
4040
enum oe_flush how);
4141
void ordered_events__init(struct ordered_events *oe);
4242
void ordered_events__free(struct ordered_events *oe);
43+
44+
static inline
45+
void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)
46+
{
47+
oe->max_alloc_size = size;
48+
}
4349
#endif /* __ORDERED_EVENTS_H */

0 commit comments

Comments
 (0)