All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jeremie Galarneau <jgalar@efficios.com>,
	Namhyung Kim <namhyung@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Tom Zanussi <tzanussi@gmail.com>
Subject: [PATCH 8/8] perf data: Add support for setting ordered_events queue size
Date: Thu, 15 Jan 2015 17:15:56 +0100	[thread overview]
Message-ID: <1421338556-20498-9-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1421338556-20498-1-git-send-email-jolsa@kernel.org>

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.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 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 3d73e51ee10d..ddecce88bf6d 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,
@@ -966,6 +969,18 @@ static void ctf_writer__flush_streams(struct ctf_writer *cw)
 		ctf_stream__flush(cw->stream[cpu]);
 }
 
+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)
 {
 	struct perf_session *session;
@@ -991,6 +1006,8 @@ int bt_convert__perf2ctf(const char *input, const char *path)
 	struct ctf_writer *cw = &c.writer;
 	int err = -1;
 
+	perf_config(convert__config, &c);
+
 	/* CTF writer */
 	if (ctf_writer__init(cw, path))
 		return -1;
@@ -1000,6 +1017,11 @@ int bt_convert__perf2ctf(const char *input, const char *path)
 	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;
-- 
1.9.3


  parent reply	other threads:[~2015-01-15 16:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 16:15 [PATCHv3 0/8] perf tools: Add perf data CTF conversion Jiri Olsa
2015-01-15 16:15 ` [PATCH 1/8] perf tools: Add feature check for libbabeltrace Jiri Olsa
2015-01-15 16:15 ` [PATCH 2/8] perf tools: Add new perf data command Jiri Olsa
2015-01-15 16:15 ` [PATCH 3/8] perf data: Add perf data to CTF conversion support Jiri Olsa
2015-01-15 16:15 ` [PATCH 4/8] perf data: Add a 'perf' prefix to the generic fields Jiri Olsa
2015-01-15 16:15 ` [PATCH 5/8] perf data: Add tracepoint events fields CTF conversion support Jiri Olsa
2015-01-15 16:15 ` [PATCH 6/8] perf data: Switch to multiple cpu stream files Jiri Olsa
2015-01-15 16:15 ` [PATCH 7/8] perf data: Enable stream flush within processing Jiri Olsa
2015-01-15 16:15 ` Jiri Olsa [this message]
2015-01-15 20:57 ` [PATCHv3 0/8] perf tools: Add perf data CTF conversion Alexandre Montplaisir
2015-01-16 15:26   ` Alexandre Montplaisir
2015-01-16 16:46     ` Jérémie Galarneau
2015-01-19 12:49       ` Jiri Olsa
2015-01-25 13:43       ` Jiri Olsa
2015-01-28 22:37         ` Jérémie Galarneau
2015-01-29  8:55           ` Jiri Olsa
2015-01-15 21:36 ` David Ahern
2015-01-15 23:28 ` Namhyung Kim
2015-01-16 14:33 ` Matthew Khouzam
  -- strict thread matches above, loose matches on Subject: below --
2014-12-11 15:12 [PATCHv2 " Jiri Olsa
2014-12-11 15:12 ` [PATCH 8/8] perf data: Add support for setting ordered_events queue size Jiri Olsa
2014-12-03 16:23 [PATCH 0/8] perf tools: Add perf data CTF conversion Jiri Olsa
2014-12-03 16:24 ` [PATCH 8/8] perf data: Add support for setting ordered_events queue size Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421338556-20498-9-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=acme@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jgalar@efficios.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tzanussi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.