Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756356AbbEFC6B (ORCPT ); Tue, 5 May 2015 22:58:01 -0400 Received: from terminus.zytor.com ([198.137.202.10]:35554 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756329AbbEFC5z (ORCPT ); Tue, 5 May 2015 22:57:55 -0400 Date: Tue, 5 May 2015 19:57:34 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: bigeasy@linutronix.de, paulus@samba.org, dsahern@gmail.com, jolsa@kernel.org, jgalar@efficios.com, tzanussi@gmail.com, tglx@linutronix.de, fweisbec@gmail.com, a.p.zijlstra@chello.nl, namhyung@kernel.org, mingo@kernel.org, hpa@zytor.com, wangnan0@huawei.com, hekuang@huawei.com, acme@redhat.com, linux-kernel@vger.kernel.org Reply-To: paulus@samba.org, dsahern@gmail.com, jgalar@efficios.com, tzanussi@gmail.com, jolsa@kernel.org, bigeasy@linutronix.de, wangnan0@huawei.com, hekuang@huawei.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, acme@redhat.com, tglx@linutronix.de, fweisbec@gmail.com, namhyung@kernel.org, a.p.zijlstra@chello.nl In-Reply-To: <1429372220-6406-5-git-send-email-jolsa@kernel.org> References: <1429372220-6406-5-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf data: Add support for setting ordered_events queue size Git-Commit-ID: 8fa46753fe2ca96b0fc175efb6c9ed5c001fb554 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3003 Lines: 90 Commit-ID: 8fa46753fe2ca96b0fc175efb6c9ed5c001fb554 Gitweb: http://git.kernel.org/tip/8fa46753fe2ca96b0fc175efb6c9ed5c001fb554 Author: Jiri Olsa AuthorDate: Sat, 18 Apr 2015 17:50:17 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 29 Apr 2015 10:37:48 -0300 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: David Ahern Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Cc: David Ahern Cc: Frederic Weisbecker Cc: He Kuang Cc: Jeremie Galarneau Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Tom Zanussi Cc: Wang Nan Link: http://lkml.kernel.org/r/1429372220-6406-5-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/data-convert-bt.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index 4f942b3..b35c8d6 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -74,6 +74,9 @@ struct convert { u64 events_size; u64 events_count; + + /* Ordered events configured queue size. */ + u64 queue_size; }; static int value_set(struct bt_ctf_field_type *type, @@ -968,6 +971,18 @@ static int ctf_writer__flush_streams(struct ctf_writer *cw) 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) { struct perf_session *session; @@ -994,6 +1009,8 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force) struct ctf_writer *cw = &c.writer; int err = -1; + perf_config(convert__config, &c); + /* CTF writer */ if (ctf_writer__init(cw, path)) return -1; @@ -1003,6 +1020,11 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force) if (!session) goto free_writer; + if (c.queue_size) { + ordered_events__set_alloc_size(&session->ordered_events, + c.queue_size); + } + /* CTF writer env/clock setup */ if (ctf_writer__setup_env(cw, session)) goto free_session; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/