Commit 8fa46753 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf data: Add support for setting ordered_events queue size

Adding support to limit the size of ordered_events queue, so we could
control allocation size of perf data files without proper finished round
events.
Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1429372220-6406-5-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 89e5fa88
...@@ -74,6 +74,9 @@ struct convert { ...@@ -74,6 +74,9 @@ struct convert {
u64 events_size; u64 events_size;
u64 events_count; u64 events_count;
/* Ordered events configured queue size. */
u64 queue_size;
}; };
static int value_set(struct bt_ctf_field_type *type, static int value_set(struct bt_ctf_field_type *type,
...@@ -968,6 +971,18 @@ static int ctf_writer__flush_streams(struct ctf_writer *cw) ...@@ -968,6 +971,18 @@ static int ctf_writer__flush_streams(struct ctf_writer *cw)
return ret; return ret;
} }
static int convert__config(const char *var, const char *value, void *cb)
{
struct convert *c = cb;
if (!strcmp(var, "convert.queue-size")) {
c->queue_size = perf_config_u64(var, value);
return 0;
}
return perf_default_config(var, value, cb);
}
int bt_convert__perf2ctf(const char *input, const char *path, bool force) int bt_convert__perf2ctf(const char *input, const char *path, bool force)
{ {
struct perf_session *session; struct perf_session *session;
...@@ -994,6 +1009,8 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force) ...@@ -994,6 +1009,8 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force)
struct ctf_writer *cw = &c.writer; struct ctf_writer *cw = &c.writer;
int err = -1; int err = -1;
perf_config(convert__config, &c);
/* CTF writer */ /* CTF writer */
if (ctf_writer__init(cw, path)) if (ctf_writer__init(cw, path))
return -1; return -1;
...@@ -1003,6 +1020,11 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force) ...@@ -1003,6 +1020,11 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force)
if (!session) if (!session)
goto free_writer; goto free_writer;
if (c.queue_size) {
ordered_events__set_alloc_size(&session->ordered_events,
c.queue_size);
}
/* CTF writer env/clock setup */ /* CTF writer env/clock setup */
if (ctf_writer__setup_env(cw, session)) if (ctf_writer__setup_env(cw, session))
goto free_session; goto free_session;
......
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