LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wang Nan <wangnan0@huawei.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>, <linux-kernel@vger.kernel.org>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	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>,
	Tom Zanussi <tzanussi@gmail.com>, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH 06/11] perf data: Switch to multiple cpu stream files
Date: Thu, 12 Mar 2015 21:40:09 +0800	[thread overview]
Message-ID: <55019739.5080400@huawei.com> (raw)
In-Reply-To: <20150312123425.GF8369@krava.redhat.com>

On 2015/3/12 20:34, Jiri Olsa wrote:
> On Thu, Mar 12, 2015 at 07:37:02PM +0800, Wang Nan wrote:
>> Hi Jiri,
>>
>> Have you noticed that this patch causes a endianess problem?
>>
>> Without this patch:
>>
>> $ perf  data convert --to-ctf ./out.ctf
>> [ perf data convert: Converted 'perf.data' into CTF data './out.ctf' ]
>> [ perf data convert: Converted and wrote 0.000 MB (11 samples) ]
>>
>> With this patch:
>>
>> $ perf  data convert --to-ctf ./out.ctf
>> perf: event-types.c:1855: bt_ctf_field_type_set_native_byte_order: Assertion `byte_order == 1234 || byte_order == 4321' failed.
>> Aborted
>>
>> I'll look into this problem if you haven't solved it yet. Please let me know if you have already
>> have some solutions.
> 
> hum, never seen this.. any other details?



My perf is -tip tree (commit 4b52a8d), with patch 'perf data: Add tracepoint events fields CTF conversion support'
applied. Babeltrace is fresh new git clone (commit 48d711a).

you moved perf.data
> through different endian server or something like that?
> 

Never.

> jirka
> 
---
I think I find the problem, but I fill strange whether you and others never hit it.

The problem is that, in babeltrace, stream_class->byte_order is never setup until someone calls bt_ctf_trace_create_stream(),
which do it by bt_ctf_stream_class_set_byte_order(), set stream_class->byte_order according to trace->byte_order.

(However, according to the name of bt_ctf_trace_create_stream, people (like me) believe stream_class
should be a fully initialized structure, bt_ctf_trace_create_stream() is used to create a bt_ctf_stream,
it should not be a part of initialization of bt_ctf_stream_class().)

After applying patch 6/11, such call (bt_ctf_writer_create_stream()) is moved from ctf_writer__init()
to ctf_stream(), that is, later than bt_ctf_event_create(). However, bt_ctf_event_create() -> bt_ctf_stream_class_freeze()
requires stream_class->byte_order been set.

At the bottom of this mail is a workable workaround (an ugly workaround since I'm not sure which part is responsible
for the problem) and my SOB.

Thank you.

Signed-off-by: Wang Nan <wangnan0@huawei.com>

---
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -557,6 +557,8 @@ static int process_sample_event(struct perf_tool *tool,

	pr_time2(sample->time, "sample %" PRIu64 "\n", c->events_count);

+	cs = ctf_stream(cw, get_sample_cpu(cw, sample, evsel));
+
	event = bt_ctf_event_create(event_class);
	if (!event) {
		pr_err("Failed to create an CTF event\n");
@@ -576,7 +578,6 @@ static int process_sample_event(struct perf_tool *tool,
			return -1;
	}

-	cs = ctf_stream(cw, get_sample_cpu(cw, sample, evsel));
	if (cs)
		bt_ctf_stream_append_event(cs->stream, event);



  reply	other threads:[~2015-03-12 13:41 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 22:16 [PATCHv5 00/11] perf tools: Add perf data CTF conversion Jiri Olsa
2015-02-20 22:16 ` [PATCH 01/11] perf tools: Add feature check for libbabeltrace Jiri Olsa
2015-02-26 11:35   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-02-28  9:25     ` Ingo Molnar
2015-02-28 12:28       ` Jiri Olsa
2015-02-20 22:16 ` [PATCH 02/11] perf tools: Add new perf data command Jiri Olsa
2015-02-26 11:36   ` [tip:perf/core] perf tools: Add new 'perf data' command tip-bot for Jiri Olsa
2015-02-20 22:17 ` [PATCH 03/11] perf data: Add perf data to CTF conversion support Jiri Olsa
2015-02-26 11:36   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-02-20 22:17 ` [PATCH 04/11] perf data: Add a 'perf' prefix to the generic fields Jiri Olsa
2015-02-26 11:36   ` [tip:perf/core] " tip-bot for Sebastian Andrzej Siewior
2015-02-20 22:17 ` [PATCH 05/11] perf data: Add tracepoint events fields CTF conversion support Jiri Olsa
2015-02-25 19:23   ` Arnaldo Carvalho de Melo
2015-03-01 13:20     ` Jiri Olsa
2015-03-02 15:32       ` Arnaldo Carvalho de Melo
2015-03-09 12:12         ` Jiri Olsa
2015-03-09 21:51           ` Arnaldo Carvalho de Melo
2015-03-09 23:11             ` Arnaldo Carvalho de Melo
2015-03-09 23:28               ` Arnaldo Carvalho de Melo
2015-03-10 12:00                 ` [PATCH] perf build: Fix libbabeltrace detection Jiri Olsa
2015-03-10 14:01                   ` Arnaldo Carvalho de Melo
2015-03-10 14:11                     ` Jiri Olsa
2015-03-10 14:44                       ` Jérémie Galarneau
2015-03-10 15:01                         ` Arnaldo Carvalho de Melo
2015-03-26  9:25                         ` Jiri Olsa
2015-03-26 15:05                           ` Arnaldo Carvalho de Melo
2015-03-10 15:03                       ` Arnaldo Carvalho de Melo
2015-03-10 16:04                       ` Arnaldo Carvalho de Melo
2015-03-11  8:45                         ` Jiri Olsa
2015-03-11 13:18                           ` Arnaldo Carvalho de Melo
2015-03-14  7:03                   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-03-14  7:07   ` [tip:perf/core] perf data: Add tracepoint events fields CTF conversion support tip-bot for Sebastian Andrzej Siewior
2015-02-20 22:17 ` [PATCH 06/11] perf data: Switch to multiple cpu stream files Jiri Olsa
2015-03-12 11:37   ` Wang Nan
2015-03-12 12:34     ` Jiri Olsa
2015-03-12 13:40       ` Wang Nan [this message]
2015-03-12 19:17         ` Arnaldo Carvalho de Melo
2015-03-12 19:59           ` Jérémie Galarneau
2015-03-13  6:02             ` Wang Nan
2015-03-13 16:46           ` Jérémie Galarneau
2015-02-20 22:17 ` [PATCH 07/11] perf data: Enable stream flush within processing Jiri Olsa
2015-02-20 22:17 ` [PATCH 08/11] perf data: Add support for setting ordered_events queue size Jiri Olsa
2015-02-20 22:17 ` [PATCH 09/11] tools lib traceevent: Add alias field to struct format_field Jiri Olsa
2015-02-24 22:54   ` Steven Rostedt
2015-02-24 23:12     ` Jiri Olsa
2015-02-20 22:17 ` [PATCH 10/11] perf data: Fix duplicate field names and avoid reserved keywords Jiri Olsa
2015-02-20 22:17 ` [PATCH 11/11] perf data: Fix signess of value Jiri Olsa
  -- strict thread matches above, loose matches on Subject: below --
2015-01-30 10:42 [PATCHv4 00/11] perf tools: Add perf data CTF conversion Jiri Olsa
2015-01-30 10:43 ` [PATCH 06/11] perf data: Switch to multiple cpu stream files 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=55019739.5080400@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=acme@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jgalar@efficios.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tzanussi@gmail.com \
    --subject='Re: [PATCH 06/11] perf data: Switch to multiple cpu stream files' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).