Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-29 Thread Jiri Olsa
On Wed, Jan 28, 2015 at 05:37:56PM -0500, Jérémie Galarneau wrote:
> On Sun, Jan 25, 2015 at 8:43 AM, Jiri Olsa  wrote:
> > On Fri, Jan 16, 2015 at 11:46:36AM -0500, Jérémie Galarneau wrote:
> >> On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
> >>  wrote:
> >> > On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
> >> >> email). I can confirm that the generated CTF can be read correctly by 
> >> >> our
> >> >> tool, which enables many views and analyses (Control Flow, CPU usage 
> >> >> view,
> >> >> etc.) that were previously only available for LTTng traces.
> >> >>
> >> >> Some of our users also use perf extensively, and are looking forward to
> >> >> this feature! Is there any ETA as to when this will be merged upstream?
> >> >>
> >> >> Thanks,
> >> >> Alexandre
> >> >
> >> >
> >> > That was a bit too fast, it seems there are issues with very recent 
> >> > versions
> >> > of Babeltrace. You can follow the discussion at
> >> > http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
> >> >
> >>
> >> It's a regression introduced by a commit that was pushed to master
> >> yesterday. I'm working on a fix.
> >> In the meantime, testing against Babeltrace master 3baf0856 should be 
> >> alright.
> >
> > even on this HEAD I'm still getting the 3rd issue I described in earlier 
> > email:
> >
> > ---
> > the bt_ctf_trace_create_stream function tries to set ID on
> > stream_class which gets frozen just few moments ago in
> > bt_ctf_stream_create call..
> >
> > this trigers failure and close up of stream fd which is not set yet:
> >
> > if (close(stream->pos.fd)) {
> > perror("close");
> > }
> >
> > hence the 'close: Bad file descriptor' message
> > so this one looks like a bug to me, but we might be misusing the API 
> > also..
> > ---
> >
> > I need attached patch in perf code.. any idea?
> >
> 
> I have merged a patch addressing this problem. Thanks for reporting!

cool, seems to work perfectly.. thanks

I'll resend converter v4 shortly

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-29 Thread Jiri Olsa
On Wed, Jan 28, 2015 at 05:37:56PM -0500, Jérémie Galarneau wrote:
 On Sun, Jan 25, 2015 at 8:43 AM, Jiri Olsa jo...@redhat.com wrote:
  On Fri, Jan 16, 2015 at 11:46:36AM -0500, Jérémie Galarneau wrote:
  On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
  alexmon...@voxpopuli.im wrote:
   On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
  
   Hi,
  
   I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
   email). I can confirm that the generated CTF can be read correctly by 
   our
   tool, which enables many views and analyses (Control Flow, CPU usage 
   view,
   etc.) that were previously only available for LTTng traces.
  
   Some of our users also use perf extensively, and are looking forward to
   this feature! Is there any ETA as to when this will be merged upstream?
  
   Thanks,
   Alexandre
  
  
   That was a bit too fast, it seems there are issues with very recent 
   versions
   of Babeltrace. You can follow the discussion at
   http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
  
 
  It's a regression introduced by a commit that was pushed to master
  yesterday. I'm working on a fix.
  In the meantime, testing against Babeltrace master 3baf0856 should be 
  alright.
 
  even on this HEAD I'm still getting the 3rd issue I described in earlier 
  email:
 
  ---
  the bt_ctf_trace_create_stream function tries to set ID on
  stream_class which gets frozen just few moments ago in
  bt_ctf_stream_create call..
 
  this trigers failure and close up of stream fd which is not set yet:
 
  if (close(stream-pos.fd)) {
  perror(close);
  }
 
  hence the 'close: Bad file descriptor' message
  so this one looks like a bug to me, but we might be misusing the API 
  also..
  ---
 
  I need attached patch in perf code.. any idea?
 
 
 I have merged a patch addressing this problem. Thanks for reporting!

cool, seems to work perfectly.. thanks

I'll resend converter v4 shortly

jirka
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-28 Thread Jérémie Galarneau
On Sun, Jan 25, 2015 at 8:43 AM, Jiri Olsa  wrote:
> On Fri, Jan 16, 2015 at 11:46:36AM -0500, Jérémie Galarneau wrote:
>> On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
>>  wrote:
>> > On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
>> >>
>> >> Hi,
>> >>
>> >> I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
>> >> email). I can confirm that the generated CTF can be read correctly by our
>> >> tool, which enables many views and analyses (Control Flow, CPU usage view,
>> >> etc.) that were previously only available for LTTng traces.
>> >>
>> >> Some of our users also use perf extensively, and are looking forward to
>> >> this feature! Is there any ETA as to when this will be merged upstream?
>> >>
>> >> Thanks,
>> >> Alexandre
>> >
>> >
>> > That was a bit too fast, it seems there are issues with very recent 
>> > versions
>> > of Babeltrace. You can follow the discussion at
>> > http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
>> >
>>
>> It's a regression introduced by a commit that was pushed to master
>> yesterday. I'm working on a fix.
>> In the meantime, testing against Babeltrace master 3baf0856 should be 
>> alright.
>
> even on this HEAD I'm still getting the 3rd issue I described in earlier 
> email:
>
> ---
> the bt_ctf_trace_create_stream function tries to set ID on
> stream_class which gets frozen just few moments ago in
> bt_ctf_stream_create call..
>
> this trigers failure and close up of stream fd which is not set yet:
>
> if (close(stream->pos.fd)) {
> perror("close");
> }
>
> hence the 'close: Bad file descriptor' message
> so this one looks like a bug to me, but we might be misusing the API 
> also..
> ---
>
> I need attached patch in perf code.. any idea?
>

I have merged a patch addressing this problem. Thanks for reporting!

commit 29d9d76c476cbf3fdf6fa709bfbdc24309974f06
Author: Jérémie Galarneau 
Date:   Wed Jan 28 16:52:28 2015 -0500

Fix: lock stream class after assigning stream id

Fixes a bug that was introduced by 2f100782 which made it possible
to set custom stream class IDs.

The stream class is frozen when a stream of its type is instanciated.
However, the trace or writer must still assign a unique ID to the stream
class if none were set prior. This modification moves the stream class
locking (freeze) after the ID assignment check.

Reported-by: Jiri Olsa 
Signed-off-by: Jérémie Galarneau 

Jérémie

> thanks,
> jirka
>
>
> ---
> diff --git a/tools/perf/util/data-convert-bt.c 
> b/tools/perf/util/data-convert-bt.c
> index bdb493febff6..0d75e1ed348c 100644
> --- a/tools/perf/util/data-convert-bt.c
> +++ b/tools/perf/util/data-convert-bt.c
> @@ -960,6 +960,11 @@ static int ctf_writer__init(struct ctf_writer *cw, const 
> char *path)
> goto err_cleanup;
> }
>
> +   if (bt_ctf_stream_class_set_id(stream_class, 0)) {
> +   pr("Failed to set CTF stream class ID.\n");
> +   goto err_cleanup;
> +   }
> +
> cw->stream_class = stream_class;
>
> /* CTF clock stream setup */



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-28 Thread Jérémie Galarneau
On Sun, Jan 25, 2015 at 8:43 AM, Jiri Olsa jo...@redhat.com wrote:
 On Fri, Jan 16, 2015 at 11:46:36AM -0500, Jérémie Galarneau wrote:
 On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
 alexmon...@voxpopuli.im wrote:
  On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
 
  Hi,
 
  I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
  email). I can confirm that the generated CTF can be read correctly by our
  tool, which enables many views and analyses (Control Flow, CPU usage view,
  etc.) that were previously only available for LTTng traces.
 
  Some of our users also use perf extensively, and are looking forward to
  this feature! Is there any ETA as to when this will be merged upstream?
 
  Thanks,
  Alexandre
 
 
  That was a bit too fast, it seems there are issues with very recent 
  versions
  of Babeltrace. You can follow the discussion at
  http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
 

 It's a regression introduced by a commit that was pushed to master
 yesterday. I'm working on a fix.
 In the meantime, testing against Babeltrace master 3baf0856 should be 
 alright.

 even on this HEAD I'm still getting the 3rd issue I described in earlier 
 email:

 ---
 the bt_ctf_trace_create_stream function tries to set ID on
 stream_class which gets frozen just few moments ago in
 bt_ctf_stream_create call..

 this trigers failure and close up of stream fd which is not set yet:

 if (close(stream-pos.fd)) {
 perror(close);
 }

 hence the 'close: Bad file descriptor' message
 so this one looks like a bug to me, but we might be misusing the API 
 also..
 ---

 I need attached patch in perf code.. any idea?


I have merged a patch addressing this problem. Thanks for reporting!

commit 29d9d76c476cbf3fdf6fa709bfbdc24309974f06
Author: Jérémie Galarneau jeremie.galarn...@efficios.com
Date:   Wed Jan 28 16:52:28 2015 -0500

Fix: lock stream class after assigning stream id

Fixes a bug that was introduced by 2f100782 which made it possible
to set custom stream class IDs.

The stream class is frozen when a stream of its type is instanciated.
However, the trace or writer must still assign a unique ID to the stream
class if none were set prior. This modification moves the stream class
locking (freeze) after the ID assignment check.

Reported-by: Jiri Olsa jo...@redhat.com
Signed-off-by: Jérémie Galarneau jeremie.galarn...@efficios.com

Jérémie

 thanks,
 jirka


 ---
 diff --git a/tools/perf/util/data-convert-bt.c 
 b/tools/perf/util/data-convert-bt.c
 index bdb493febff6..0d75e1ed348c 100644
 --- a/tools/perf/util/data-convert-bt.c
 +++ b/tools/perf/util/data-convert-bt.c
 @@ -960,6 +960,11 @@ static int ctf_writer__init(struct ctf_writer *cw, const 
 char *path)
 goto err_cleanup;
 }

 +   if (bt_ctf_stream_class_set_id(stream_class, 0)) {
 +   pr(Failed to set CTF stream class ID.\n);
 +   goto err_cleanup;
 +   }
 +
 cw-stream_class = stream_class;

 /* CTF clock stream setup */



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-25 Thread Jiri Olsa
On Fri, Jan 16, 2015 at 11:46:36AM -0500, Jérémie Galarneau wrote:
> On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
>  wrote:
> > On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
> >>
> >> Hi,
> >>
> >> I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
> >> email). I can confirm that the generated CTF can be read correctly by our
> >> tool, which enables many views and analyses (Control Flow, CPU usage view,
> >> etc.) that were previously only available for LTTng traces.
> >>
> >> Some of our users also use perf extensively, and are looking forward to
> >> this feature! Is there any ETA as to when this will be merged upstream?
> >>
> >> Thanks,
> >> Alexandre
> >
> >
> > That was a bit too fast, it seems there are issues with very recent versions
> > of Babeltrace. You can follow the discussion at
> > http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
> >
> 
> It's a regression introduced by a commit that was pushed to master
> yesterday. I'm working on a fix.
> In the meantime, testing against Babeltrace master 3baf0856 should be alright.

even on this HEAD I'm still getting the 3rd issue I described in earlier email:

---
the bt_ctf_trace_create_stream function tries to set ID on
stream_class which gets frozen just few moments ago in
bt_ctf_stream_create call..

this trigers failure and close up of stream fd which is not set yet:

if (close(stream->pos.fd)) {
perror("close");
}

hence the 'close: Bad file descriptor' message
so this one looks like a bug to me, but we might be misusing the API also..
---

I need attached patch in perf code.. any idea?

thanks,
jirka


---
diff --git a/tools/perf/util/data-convert-bt.c 
b/tools/perf/util/data-convert-bt.c
index bdb493febff6..0d75e1ed348c 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -960,6 +960,11 @@ static int ctf_writer__init(struct ctf_writer *cw, const 
char *path)
goto err_cleanup;
}
 
+   if (bt_ctf_stream_class_set_id(stream_class, 0)) {
+   pr("Failed to set CTF stream class ID.\n");
+   goto err_cleanup;
+   }
+
cw->stream_class = stream_class;
 
/* CTF clock stream setup */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-25 Thread Jiri Olsa
On Fri, Jan 16, 2015 at 11:46:36AM -0500, Jérémie Galarneau wrote:
 On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
 alexmon...@voxpopuli.im wrote:
  On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
 
  Hi,
 
  I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
  email). I can confirm that the generated CTF can be read correctly by our
  tool, which enables many views and analyses (Control Flow, CPU usage view,
  etc.) that were previously only available for LTTng traces.
 
  Some of our users also use perf extensively, and are looking forward to
  this feature! Is there any ETA as to when this will be merged upstream?
 
  Thanks,
  Alexandre
 
 
  That was a bit too fast, it seems there are issues with very recent versions
  of Babeltrace. You can follow the discussion at
  http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
 
 
 It's a regression introduced by a commit that was pushed to master
 yesterday. I'm working on a fix.
 In the meantime, testing against Babeltrace master 3baf0856 should be alright.

even on this HEAD I'm still getting the 3rd issue I described in earlier email:

---
the bt_ctf_trace_create_stream function tries to set ID on
stream_class which gets frozen just few moments ago in
bt_ctf_stream_create call..

this trigers failure and close up of stream fd which is not set yet:

if (close(stream-pos.fd)) {
perror(close);
}

hence the 'close: Bad file descriptor' message
so this one looks like a bug to me, but we might be misusing the API also..
---

I need attached patch in perf code.. any idea?

thanks,
jirka


---
diff --git a/tools/perf/util/data-convert-bt.c 
b/tools/perf/util/data-convert-bt.c
index bdb493febff6..0d75e1ed348c 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -960,6 +960,11 @@ static int ctf_writer__init(struct ctf_writer *cw, const 
char *path)
goto err_cleanup;
}
 
+   if (bt_ctf_stream_class_set_id(stream_class, 0)) {
+   pr(Failed to set CTF stream class ID.\n);
+   goto err_cleanup;
+   }
+
cw-stream_class = stream_class;
 
/* CTF clock stream setup */
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-19 Thread Jiri Olsa
On Fri, Jan 16, 2015 at 11:46:36AM -0500, Jérémie Galarneau wrote:
> On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
>  wrote:
> > On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
> >>
> >> Hi,
> >>
> >> I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
> >> email). I can confirm that the generated CTF can be read correctly by our
> >> tool, which enables many views and analyses (Control Flow, CPU usage view,
> >> etc.) that were previously only available for LTTng traces.
> >>
> >> Some of our users also use perf extensively, and are looking forward to
> >> this feature! Is there any ETA as to when this will be merged upstream?
> >>
> >> Thanks,
> >> Alexandre
> >
> >
> > That was a bit too fast, it seems there are issues with very recent versions
> > of Babeltrace. You can follow the discussion at
> > http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
> >
> 
> It's a regression introduced by a commit that was pushed to master
> yesterday. I'm working on a fix.
> In the meantime, testing against Babeltrace master 3baf0856 should be alright.

yep.. works for me ;-)

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-19 Thread Jiri Olsa
On Fri, Jan 16, 2015 at 11:46:36AM -0500, Jérémie Galarneau wrote:
 On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
 alexmon...@voxpopuli.im wrote:
  On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
 
  Hi,
 
  I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
  email). I can confirm that the generated CTF can be read correctly by our
  tool, which enables many views and analyses (Control Flow, CPU usage view,
  etc.) that were previously only available for LTTng traces.
 
  Some of our users also use perf extensively, and are looking forward to
  this feature! Is there any ETA as to when this will be merged upstream?
 
  Thanks,
  Alexandre
 
 
  That was a bit too fast, it seems there are issues with very recent versions
  of Babeltrace. You can follow the discussion at
  http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
 
 
 It's a regression introduced by a commit that was pushed to master
 yesterday. I'm working on a fix.
 In the meantime, testing against Babeltrace master 3baf0856 should be alright.

yep.. works for me ;-)

thanks,
jirka
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-16 Thread Jérémie Galarneau
On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
 wrote:
> On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:
>>
>> Hi,
>>
>> I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
>> email). I can confirm that the generated CTF can be read correctly by our
>> tool, which enables many views and analyses (Control Flow, CPU usage view,
>> etc.) that were previously only available for LTTng traces.
>>
>> Some of our users also use perf extensively, and are looking forward to
>> this feature! Is there any ETA as to when this will be merged upstream?
>>
>> Thanks,
>> Alexandre
>
>
> That was a bit too fast, it seems there are issues with very recent versions
> of Babeltrace. You can follow the discussion at
> http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html
>

It's a regression introduced by a commit that was pushed to master
yesterday. I'm working on a fix.
In the meantime, testing against Babeltrace master 3baf0856 should be alright.

Jérémie

> Cheers,
> Alex
>
>
>>
>>
>> On 01/15/2015 11:15 AM, Jiri Olsa wrote:
>>>
>>> hi,
>>> this is follow up on original RFC patchset:
>>>http://marc.info/?t=14073273564=1=2
>>>
>>> Basically we are adding 'perf data convert' command to
>>> allow conversion of perf data file into CTF [1] data.
>>>
>>> v3 changes:
>>>- rebased to latest acme's perf/core
>>>
>>> v2 changes:
>>>- addressed comments from Namhyung
>>>- rebased to latest acme's perf/core
>>>
>>> Changes from RFC:
>>>- able to generate CTF data, that are possible to be displayed under
>>>  tracecompas GUI [3], please check several screenshots in here [4]
>>>- storing CTF data streams per cpu
>>>- several cleanups
>>>
>>> Examples:
>>> - Catch default perf data (cycles event):
>>>$ perf record ls
>>>[ perf record: Woken up 1 times to write data ]
>>>[ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]
>>>
>>> - To display converted CTF data run [2]:
>>>$ babeltrace ./ctf-data/
>>>[03:19:13.962125533] (+?.?) cycles: { }, { ip =
>>> 0x8105443A, tid = 20714, pid = 20714, period = 1 }
>>>[03:19:13.962130001] (+0.04468) cycles: { }, { ip =
>>> 0x8105443A, tid = 20714, pid = 20714, period = 1 }
>>>[03:19:13.962131936] (+0.01935) cycles: { }, { ip =
>>> 0x8105443A, tid = 20714, pid = 20714, period = 8 }
>>>[03:19:13.962133732] (+0.01796) cycles: { }, { ip =
>>> 0x8105443A, tid = 20714, pid = 20714, period = 114 }
>>>[03:19:13.962135557] (+0.01825) cycles: { }, { ip =
>>> 0x8105443A, tid = 20714, pid = 20714, period = 2087 }
>>>[03:19:13.962137627] (+0.02070) cycles: { }, { ip =
>>> 0x81361938, tid = 20714, pid = 20714, period = 37582 }
>>>[03:19:13.962161091] (+0.23464) cycles: { }, { ip =
>>> 0x8124218F, tid = 20714, pid = 20714, period = 600246 }
>>>[03:19:13.962517569] (+0.000356478) cycles: { }, { ip =
>>> 0x811A75DB, tid = 20714, pid = 20714, period = 1325731 }
>>>[03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2,
>>> tid = 20714, pid = 20714, period = 1144298 }
>>>
>>> - To get some nice output in tracecompas GUI [3], please capture sched:*
>>>and syscall tracepoints like:
>>># perf record -e 'sched:*,raw_syscalls:*' -a
>>>^C[ perf record: Woken up 0 times to write data ]
>>>[ perf record: Captured and wrote 412.347 MB perf.data (~18015721
>>> samples) ]
>>>
>>> - To convert perf data file run:
>>># perf data convert --to-ctf=./ctf
>>>[ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
>>>[ perf data convert: Converted and wrote 408.421 MB (3964792 samples)
>>> ]
>>>
>>> - To display converted CTF data run [2]:
>>># babeltrace ./ctf-data/
>>>[23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0
>>> }, { perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id =
>>> 462554, perf_period = 1, common_type = 265, ...
>>>[23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0
>>> }, { perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id =
>>> 462562, perf_period = 1, common_type = 263, ...
>>>[23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id
>>> = 0 }, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326,
>>> perf_id = 462610, perf_period = 11380, ...
>>>[23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0
>>> }, { perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id
>>> = 462562, perf_period = 1, common_type ...
>>>[23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id
>>> = 2 }, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821,
>>> perf_id = 462612, perf_period = 1000265, ...
>>>[23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id =
>>> 1 }, { perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155,

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-16 Thread Alexandre Montplaisir

On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:

Hi,

I'm a developer for the Trace Compass tool (see links [3], [4] in 
Jiri's email). I can confirm that the generated CTF can be read 
correctly by our tool, which enables many views and analyses (Control 
Flow, CPU usage view, etc.) that were previously only available for 
LTTng traces.


Some of our users also use perf extensively, and are looking forward 
to this feature! Is there any ETA as to when this will be merged 
upstream?


Thanks,
Alexandre


That was a bit too fast, it seems there are issues with very recent 
versions of Babeltrace. You can follow the discussion at

http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html

Cheers,
Alex




On 01/15/2015 11:15 AM, Jiri Olsa wrote:

hi,
this is follow up on original RFC patchset:
   http://marc.info/?t=14073273564=1=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v3 changes:
   - rebased to latest acme's perf/core

v2 changes:
   - addressed comments from Namhyung
   - rebased to latest acme's perf/core

Changes from RFC:
   - able to generate CTF data, that are possible to be displayed under
 tracecompas GUI [3], please check several screenshots in here [4]
   - storing CTF data streams per cpu
   - several cleanups

Examples:
- Catch default perf data (cycles event):
   $ perf record ls
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

- To display converted CTF data run [2]:
   $ babeltrace ./ctf-data/
   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 8 }
   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 114 }
   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 2087 }
   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 
0x81361938, tid = 20714, pid = 20714, period = 37582 }
   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 
0x8124218F, tid = 20714, pid = 20714, period = 600246 }
   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 
0x811A75DB, tid = 20714, pid = 20714, period = 1325731 }
   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 
0x34080917B2, tid = 20714, pid = 20714, period = 1144298 }


- To get some nice output in tracecompas GUI [3], please capture sched:*
   and syscall tracepoints like:
   # perf record -e 'sched:*,raw_syscalls:*' -a
   ^C[ perf record: Woken up 0 times to write data ]
   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 
samples) ]


- To convert perf data file run:
   # perf data convert --to-ctf=./ctf
   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
   [ perf data convert: Converted and wrote 408.421 MB (3964792 
samples) ]


- To display converted CTF data run [2]:
   # babeltrace ./ctf-data/
   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 
0 }, { perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, 
perf_id = 462554, perf_period = 1, common_type = 265, ...
   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 
0 }, { perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, 
perf_id = 462562, perf_period = 1, common_type = 263, ...
   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { 
cpu_id = 0 }, { perf_ip = 0x810C8AE5, perf_tid = 5326, 
perf_pid = 5326, perf_id = 462610, perf_period = 11380, ...
   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 
0 }, { perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 
5326, perf_id = 462562, perf_period = 1, common_type ...
   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { 
cpu_id = 2 }, { perf_ip = 0x810C8AE5, perf_tid = 11821, 
perf_pid = 11821, perf_id = 462612, perf_period = 1000265, ...
   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { 
cpu_id = 1 }, { perf_ip = 0x810230AF, perf_tid = 26155, 
perf_pid = 26155, perf_id = 462635, perf_period = 1, ...
   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { 
cpu_id = 1 }, { perf_ip = 0x810231D8, perf_tid = 26155, 
perf_pid = 26155, perf_id = 462639, perf_period = 1, ...


- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
   perf/core_ctf_convert

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-16 Thread Matthew Khouzam
As a Trace Compass developper, this opens a lot of possibilities for us,
like correlating PCAP, Perf and LTTng traces...

I hope it gets in soon as we already support it. :)
On 15-01-15 11:15 AM, Jiri Olsa wrote:
> hi,
> this is follow up on original RFC patchset:
>   http://marc.info/?t=14073273564=1=2
>
> Basically we are adding 'perf data convert' command to
> allow conversion of perf data file into CTF [1] data.
>
> v3 changes:
>   - rebased to latest acme's perf/core
>
> v2 changes:
>   - addressed comments from Namhyung
>   - rebased to latest acme's perf/core
>
> Changes from RFC:
>   - able to generate CTF data, that are possible to be displayed under
> tracecompas GUI [3], please check several screenshots in here [4]
>   - storing CTF data streams per cpu
>   - several cleanups
>
> Examples:
> - Catch default perf data (cycles event):
>   $ perf record ls
>   [ perf record: Woken up 1 times to write data ]
>   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]
>
> - To display converted CTF data run [2]:
>   $ babeltrace ./ctf-data/
>   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 1 }
>   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 1 }
>   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 8 }
>   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 114 }
>   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 2087 }
>   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
> tid = 20714, pid = 20714, period = 37582 }
>   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
> tid = 20714, pid = 20714, period = 600246 }
>   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
> tid = 20714, pid = 20714, period = 1325731 }
>   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
> 20714, pid = 20714, period = 1144298 }
>
> - To get some nice output in tracecompas GUI [3], please capture sched:*
>   and syscall tracepoints like:
>   # perf record -e 'sched:*,raw_syscalls:*' -a
>   ^C[ perf record: Woken up 0 times to write data ]
>   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]
>
> - To convert perf data file run:
>   # perf data convert --to-ctf=./ctf 
>   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
>   [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]
>
> - To display converted CTF data run [2]:
>   # babeltrace ./ctf-data/
>   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
> perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
> perf_period = 1, common_type = 265, ...
>   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
> perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
> perf_period = 1, common_type = 263, ...
>   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 
> }, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id 
> = 462610, perf_period = 11380, ...
>   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
> perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
> 462562, perf_period = 1, common_type  ...
>   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 
> }, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, 
> perf_id = 462612, perf_period = 1000265, ...
>   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, 
> { perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
> 462635, perf_period = 1, ...
>   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, 
> { perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
> 462639, perf_period = 1, ...
>
> - Or run tracecompass and open the CTF data ;-)
>
> Changes are also reachable in here:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
>   perf/core_ctf_convert
>
> thanks,
> jirka
>
> [1] Common Trace Format - http://www.efficios.com/ctf
> [2] babeltrace - http://www.efficios.com/babeltrace
> [3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
> [4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/
>
>
> Cc: Arnaldo Carvalho de Melo 
> Cc: David Ahern 
> Cc: Dominique Toupin 
> Cc: Frederic Weisbecker 
> Cc: Jeremie Galarneau 
> Cc: Jiri Olsa 
> Cc: Mathieu Desnoyers 
> Cc: Namhyung Kim 
> Cc: Paul Mackerras 
> Cc: Peter Zijlstra 
> Cc: Sebastian Andrzej Siewior 
> Cc: Tom Zanussi 
> ---
> Jiri Olsa (5):
>   perf tools: Add feature check for 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-16 Thread Jérémie Galarneau
On Fri, Jan 16, 2015 at 10:26 AM, Alexandre Montplaisir
alexmon...@voxpopuli.im wrote:
 On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:

 Hi,

 I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's
 email). I can confirm that the generated CTF can be read correctly by our
 tool, which enables many views and analyses (Control Flow, CPU usage view,
 etc.) that were previously only available for LTTng traces.

 Some of our users also use perf extensively, and are looking forward to
 this feature! Is there any ETA as to when this will be merged upstream?

 Thanks,
 Alexandre


 That was a bit too fast, it seems there are issues with very recent versions
 of Babeltrace. You can follow the discussion at
 http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html


It's a regression introduced by a commit that was pushed to master
yesterday. I'm working on a fix.
In the meantime, testing against Babeltrace master 3baf0856 should be alright.

Jérémie

 Cheers,
 Alex




 On 01/15/2015 11:15 AM, Jiri Olsa wrote:

 hi,
 this is follow up on original RFC patchset:
http://marc.info/?t=14073273564r=1w=2

 Basically we are adding 'perf data convert' command to
 allow conversion of perf data file into CTF [1] data.

 v3 changes:
- rebased to latest acme's perf/core

 v2 changes:
- addressed comments from Namhyung
- rebased to latest acme's perf/core

 Changes from RFC:
- able to generate CTF data, that are possible to be displayed under
  tracecompas GUI [3], please check several screenshots in here [4]
- storing CTF data streams per cpu
- several cleanups

 Examples:
 - Catch default perf data (cycles event):
$ perf record ls
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

 - To display converted CTF data run [2]:
$ babeltrace ./ctf-data/
[03:19:13.962125533] (+?.?) cycles: { }, { ip =
 0x8105443A, tid = 20714, pid = 20714, period = 1 }
[03:19:13.962130001] (+0.04468) cycles: { }, { ip =
 0x8105443A, tid = 20714, pid = 20714, period = 1 }
[03:19:13.962131936] (+0.01935) cycles: { }, { ip =
 0x8105443A, tid = 20714, pid = 20714, period = 8 }
[03:19:13.962133732] (+0.01796) cycles: { }, { ip =
 0x8105443A, tid = 20714, pid = 20714, period = 114 }
[03:19:13.962135557] (+0.01825) cycles: { }, { ip =
 0x8105443A, tid = 20714, pid = 20714, period = 2087 }
[03:19:13.962137627] (+0.02070) cycles: { }, { ip =
 0x81361938, tid = 20714, pid = 20714, period = 37582 }
[03:19:13.962161091] (+0.23464) cycles: { }, { ip =
 0x8124218F, tid = 20714, pid = 20714, period = 600246 }
[03:19:13.962517569] (+0.000356478) cycles: { }, { ip =
 0x811A75DB, tid = 20714, pid = 20714, period = 1325731 }
[03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2,
 tid = 20714, pid = 20714, period = 1144298 }

 - To get some nice output in tracecompas GUI [3], please capture sched:*
and syscall tracepoints like:
# perf record -e 'sched:*,raw_syscalls:*' -a
^C[ perf record: Woken up 0 times to write data ]
[ perf record: Captured and wrote 412.347 MB perf.data (~18015721
 samples) ]

 - To convert perf data file run:
# perf data convert --to-ctf=./ctf
[ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
[ perf data convert: Converted and wrote 408.421 MB (3964792 samples)
 ]

 - To display converted CTF data run [2]:
# babeltrace ./ctf-data/
[23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0
 }, { perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id =
 462554, perf_period = 1, common_type = 265, ...
[23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0
 }, { perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id =
 462562, perf_period = 1, common_type = 263, ...
[23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id
 = 0 }, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326,
 perf_id = 462610, perf_period = 11380, ...
[23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0
 }, { perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id
 = 462562, perf_period = 1, common_type ...
[23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id
 = 2 }, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821,
 perf_id = 462612, perf_period = 1000265, ...
[23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id =
 1 }, { perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155,
 perf_id = 462635, perf_period = 1, ...
[23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id =
 1 }, { perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155,
 perf_id = 462639, perf_period = 1, ...

 - Or run tracecompass and 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-16 Thread Matthew Khouzam
As a Trace Compass developper, this opens a lot of possibilities for us,
like correlating PCAP, Perf and LTTng traces...

I hope it gets in soon as we already support it. :)
On 15-01-15 11:15 AM, Jiri Olsa wrote:
 hi,
 this is follow up on original RFC patchset:
   http://marc.info/?t=14073273564r=1w=2

 Basically we are adding 'perf data convert' command to
 allow conversion of perf data file into CTF [1] data.

 v3 changes:
   - rebased to latest acme's perf/core

 v2 changes:
   - addressed comments from Namhyung
   - rebased to latest acme's perf/core

 Changes from RFC:
   - able to generate CTF data, that are possible to be displayed under
 tracecompas GUI [3], please check several screenshots in here [4]
   - storing CTF data streams per cpu
   - several cleanups

 Examples:
 - Catch default perf data (cycles event):
   $ perf record ls
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

 - To display converted CTF data run [2]:
   $ babeltrace ./ctf-data/
   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 8 }
   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 114 }
   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 2087 }
   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
 tid = 20714, pid = 20714, period = 37582 }
   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
 tid = 20714, pid = 20714, period = 600246 }
   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
 tid = 20714, pid = 20714, period = 1325731 }
   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
 20714, pid = 20714, period = 1144298 }

 - To get some nice output in tracecompas GUI [3], please capture sched:*
   and syscall tracepoints like:
   # perf record -e 'sched:*,raw_syscalls:*' -a
   ^C[ perf record: Woken up 0 times to write data ]
   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]

 - To convert perf data file run:
   # perf data convert --to-ctf=./ctf 
   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
   [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]

 - To display converted CTF data run [2]:
   # babeltrace ./ctf-data/
   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
 perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
 perf_period = 1, common_type = 265, ...
   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
 perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
 perf_period = 1, common_type = 263, ...
   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 
 }, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id 
 = 462610, perf_period = 11380, ...
   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
 perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
 462562, perf_period = 1, common_type  ...
   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 
 }, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, 
 perf_id = 462612, perf_period = 1000265, ...
   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, 
 { perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
 462635, perf_period = 1, ...
   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, 
 { perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
 462639, perf_period = 1, ...

 - Or run tracecompass and open the CTF data ;-)

 Changes are also reachable in here:
   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
   perf/core_ctf_convert

 thanks,
 jirka

 [1] Common Trace Format - http://www.efficios.com/ctf
 [2] babeltrace - http://www.efficios.com/babeltrace
 [3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
 [4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/


 Cc: Arnaldo Carvalho de Melo a...@redhat.com
 Cc: David Ahern dsah...@gmail.com
 Cc: Dominique Toupin dominique.tou...@ericsson.com
 Cc: Frederic Weisbecker fweis...@gmail.com
 Cc: Jeremie Galarneau jga...@efficios.com
 Cc: Jiri Olsa jo...@kernel.org
 Cc: Mathieu Desnoyers mathieu.desnoy...@efficios.com
 Cc: Namhyung Kim namhy...@gmail.com
 Cc: Paul Mackerras pau...@samba.org
 Cc: Peter Zijlstra pet...@infradead.org
 Cc: Sebastian Andrzej 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-16 Thread Alexandre Montplaisir

On 2015-01-15 03:57 PM, Alexandre Montplaisir wrote:

Hi,

I'm a developer for the Trace Compass tool (see links [3], [4] in 
Jiri's email). I can confirm that the generated CTF can be read 
correctly by our tool, which enables many views and analyses (Control 
Flow, CPU usage view, etc.) that were previously only available for 
LTTng traces.


Some of our users also use perf extensively, and are looking forward 
to this feature! Is there any ETA as to when this will be merged 
upstream?


Thanks,
Alexandre


That was a bit too fast, it seems there are issues with very recent 
versions of Babeltrace. You can follow the discussion at

http://lists.linuxfoundation.org/pipermail/diamon-discuss/2015-January/07.html

Cheers,
Alex




On 01/15/2015 11:15 AM, Jiri Olsa wrote:

hi,
this is follow up on original RFC patchset:
   http://marc.info/?t=14073273564r=1w=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v3 changes:
   - rebased to latest acme's perf/core

v2 changes:
   - addressed comments from Namhyung
   - rebased to latest acme's perf/core

Changes from RFC:
   - able to generate CTF data, that are possible to be displayed under
 tracecompas GUI [3], please check several screenshots in here [4]
   - storing CTF data streams per cpu
   - several cleanups

Examples:
- Catch default perf data (cycles event):
   $ perf record ls
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

- To display converted CTF data run [2]:
   $ babeltrace ./ctf-data/
   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 8 }
   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 114 }
   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 
0x8105443A, tid = 20714, pid = 20714, period = 2087 }
   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 
0x81361938, tid = 20714, pid = 20714, period = 37582 }
   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 
0x8124218F, tid = 20714, pid = 20714, period = 600246 }
   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 
0x811A75DB, tid = 20714, pid = 20714, period = 1325731 }
   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 
0x34080917B2, tid = 20714, pid = 20714, period = 1144298 }


- To get some nice output in tracecompas GUI [3], please capture sched:*
   and syscall tracepoints like:
   # perf record -e 'sched:*,raw_syscalls:*' -a
   ^C[ perf record: Woken up 0 times to write data ]
   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 
samples) ]


- To convert perf data file run:
   # perf data convert --to-ctf=./ctf
   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
   [ perf data convert: Converted and wrote 408.421 MB (3964792 
samples) ]


- To display converted CTF data run [2]:
   # babeltrace ./ctf-data/
   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 
0 }, { perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, 
perf_id = 462554, perf_period = 1, common_type = 265, ...
   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 
0 }, { perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, 
perf_id = 462562, perf_period = 1, common_type = 263, ...
   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { 
cpu_id = 0 }, { perf_ip = 0x810C8AE5, perf_tid = 5326, 
perf_pid = 5326, perf_id = 462610, perf_period = 11380, ...
   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 
0 }, { perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 
5326, perf_id = 462562, perf_period = 1, common_type ...
   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { 
cpu_id = 2 }, { perf_ip = 0x810C8AE5, perf_tid = 11821, 
perf_pid = 11821, perf_id = 462612, perf_period = 1000265, ...
   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { 
cpu_id = 1 }, { perf_ip = 0x810230AF, perf_tid = 26155, 
perf_pid = 26155, perf_id = 462635, perf_period = 1, ...
   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { 
cpu_id = 1 }, { perf_ip = 0x810231D8, perf_tid = 26155, 
perf_pid = 26155, perf_id = 462639, perf_period = 1, ...


- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
   perf/core_ctf_convert

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-15 Thread Namhyung Kim
Hi Jiri,

On Thu, Jan 15, 2015 at 05:15:48PM +0100, Jiri Olsa wrote:
> hi,
> this is follow up on original RFC patchset:
>   http://marc.info/?t=14073273564=1=2
> 
> Basically we are adding 'perf data convert' command to
> allow conversion of perf data file into CTF [1] data.

I think I already gave my ACKs to this series, but let me repeat it.

Acked-by: Namhyung Kim 

Thanks,
Namhyung


> 
> v3 changes:
>   - rebased to latest acme's perf/core
> 
> v2 changes:
>   - addressed comments from Namhyung
>   - rebased to latest acme's perf/core
> 
> Changes from RFC:
>   - able to generate CTF data, that are possible to be displayed under
> tracecompas GUI [3], please check several screenshots in here [4]
>   - storing CTF data streams per cpu
>   - several cleanups
> 
> Examples:
> - Catch default perf data (cycles event):
>   $ perf record ls
>   [ perf record: Woken up 1 times to write data ]
>   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]
> 
> - To display converted CTF data run [2]:
>   $ babeltrace ./ctf-data/
>   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 1 }
>   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 1 }
>   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 8 }
>   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 114 }
>   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
> tid = 20714, pid = 20714, period = 2087 }
>   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
> tid = 20714, pid = 20714, period = 37582 }
>   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
> tid = 20714, pid = 20714, period = 600246 }
>   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
> tid = 20714, pid = 20714, period = 1325731 }
>   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
> 20714, pid = 20714, period = 1144298 }
> 
> - To get some nice output in tracecompas GUI [3], please capture sched:*
>   and syscall tracepoints like:
>   # perf record -e 'sched:*,raw_syscalls:*' -a
>   ^C[ perf record: Woken up 0 times to write data ]
>   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]
> 
> - To convert perf data file run:
>   # perf data convert --to-ctf=./ctf 
>   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
>   [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]
> 
> - To display converted CTF data run [2]:
>   # babeltrace ./ctf-data/
>   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
> perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
> perf_period = 1, common_type = 265, ...
>   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
> perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
> perf_period = 1, common_type = 263, ...
>   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 
> }, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id 
> = 462610, perf_period = 11380, ...
>   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
> perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
> 462562, perf_period = 1, common_type  ...
>   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 
> }, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, 
> perf_id = 462612, perf_period = 1000265, ...
>   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, 
> { perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
> 462635, perf_period = 1, ...
>   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, 
> { perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
> 462639, perf_period = 1, ...
> 
> - Or run tracecompass and open the CTF data ;-)
> 
> Changes are also reachable in here:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
>   perf/core_ctf_convert
> 
> thanks,
> jirka
> 
> [1] Common Trace Format - http://www.efficios.com/ctf
> [2] babeltrace - http://www.efficios.com/babeltrace
> [3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
> [4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/
> 
> 
> Cc: Arnaldo Carvalho de Melo 
> Cc: David Ahern 
> Cc: Dominique Toupin 
> Cc: Frederic Weisbecker 
> Cc: Jeremie Galarneau 
> Cc: Jiri Olsa 
> Cc: Mathieu Desnoyers 
> Cc: Namhyung Kim 
> Cc: Paul Mackerras 
> Cc: Peter Zijlstra 
> Cc: Sebastian Andrzej Siewior 
> Cc: Tom Zanussi 
> ---
> Jiri Olsa (5):
>   perf tools: Add feature check for libbabeltrace
> 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-15 Thread David Ahern

On 1/15/15 9:15 AM, Jiri Olsa wrote:

hi,
this is follow up on original RFC patchset:
   http://marc.info/?t=14073273564=1=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v3 changes:
   - rebased to latest acme's perf/core

v2 changes:
   - addressed comments from Namhyung
   - rebased to latest acme's perf/core

Changes from RFC:
   - able to generate CTF data, that are possible to be displayed under
 tracecompas GUI [3], please check several screenshots in here [4]
   - storing CTF data streams per cpu
   - several cleanups

Examples:
- Catch default perf data (cycles event):
   $ perf record ls
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

- To display converted CTF data run [2]:
   $ babeltrace ./ctf-data/
   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 8 }
   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 114 }
   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 2087 }
   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
tid = 20714, pid = 20714, period = 37582 }
   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
tid = 20714, pid = 20714, period = 600246 }
   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
tid = 20714, pid = 20714, period = 1325731 }
   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
20714, pid = 20714, period = 1144298 }

- To get some nice output in tracecompas GUI [3], please capture sched:*
   and syscall tracepoints like:
   # perf record -e 'sched:*,raw_syscalls:*' -a
   ^C[ perf record: Woken up 0 times to write data ]
   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]

- To convert perf data file run:
   # perf data convert --to-ctf=./ctf
   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
   [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]

- To display converted CTF data run [2]:
   # babeltrace ./ctf-data/
   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
perf_period = 1, common_type = 265, ...
   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
perf_period = 1, common_type = 263, ...
   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 
}, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id = 
462610, perf_period = 11380, ...
   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
462562, perf_period = 1, common_type  ...
   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 
}, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, perf_id 
= 462612, perf_period = 1000265, ...
   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, 
{ perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
462635, perf_period = 1, ...
   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, { 
perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
462639, perf_period = 1, ...

- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
   perf/core_ctf_convert

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
[4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/


Cc: Arnaldo Carvalho de Melo 
Cc: David Ahern 
Cc: Dominique Toupin 
Cc: Frederic Weisbecker 
Cc: Jeremie Galarneau 
Cc: Jiri Olsa 
Cc: Mathieu Desnoyers 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Sebastian Andrzej Siewior 
Cc: Tom Zanussi 
---
Jiri Olsa (5):
   perf tools: Add feature check for libbabeltrace
   perf tools: Add new perf data command
   perf data: Add perf data to CTF conversion support
   perf data: Enable stream flush within processing
   perf data: Add support for setting ordered_events queue size

Sebastian Andrzej Siewior (3):
   perf data: Add a 'perf' prefix to the generic fields
   perf 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-15 Thread Alexandre Montplaisir

Hi,

I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's 
email). I can confirm that the generated CTF can be read correctly by 
our tool, which enables many views and analyses (Control Flow, CPU usage 
view, etc.) that were previously only available for LTTng traces.


Some of our users also use perf extensively, and are looking forward to 
this feature! Is there any ETA as to when this will be merged upstream?


Thanks,
Alexandre


On 01/15/2015 11:15 AM, Jiri Olsa wrote:

hi,
this is follow up on original RFC patchset:
   http://marc.info/?t=14073273564=1=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v3 changes:
   - rebased to latest acme's perf/core

v2 changes:
   - addressed comments from Namhyung
   - rebased to latest acme's perf/core

Changes from RFC:
   - able to generate CTF data, that are possible to be displayed under
 tracecompas GUI [3], please check several screenshots in here [4]
   - storing CTF data streams per cpu
   - several cleanups

Examples:
- Catch default perf data (cycles event):
   $ perf record ls
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

- To display converted CTF data run [2]:
   $ babeltrace ./ctf-data/
   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 8 }
   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 114 }
   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 2087 }
   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
tid = 20714, pid = 20714, period = 37582 }
   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
tid = 20714, pid = 20714, period = 600246 }
   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
tid = 20714, pid = 20714, period = 1325731 }
   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
20714, pid = 20714, period = 1144298 }

- To get some nice output in tracecompas GUI [3], please capture sched:*
   and syscall tracepoints like:
   # perf record -e 'sched:*,raw_syscalls:*' -a
   ^C[ perf record: Woken up 0 times to write data ]
   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]

- To convert perf data file run:
   # perf data convert --to-ctf=./ctf
   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
   [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]

- To display converted CTF data run [2]:
   # babeltrace ./ctf-data/
   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
perf_period = 1, common_type = 265, ...
   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
perf_period = 1, common_type = 263, ...
   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 
}, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id = 
462610, perf_period = 11380, ...
   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
462562, perf_period = 1, common_type  ...
   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 
}, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, perf_id 
= 462612, perf_period = 1000265, ...
   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, 
{ perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
462635, perf_period = 1, ...
   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, { 
perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
462639, perf_period = 1, ...

- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
   perf/core_ctf_convert

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
[4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/


Cc: Arnaldo Carvalho de Melo 
Cc: David Ahern 
Cc: Dominique Toupin 
Cc: Frederic Weisbecker 
Cc: Jeremie Galarneau 
Cc: Jiri Olsa 
Cc: Mathieu Desnoyers 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter 

[PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-15 Thread Jiri Olsa
hi,
this is follow up on original RFC patchset:
  http://marc.info/?t=14073273564=1=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v3 changes:
  - rebased to latest acme's perf/core

v2 changes:
  - addressed comments from Namhyung
  - rebased to latest acme's perf/core

Changes from RFC:
  - able to generate CTF data, that are possible to be displayed under
tracecompas GUI [3], please check several screenshots in here [4]
  - storing CTF data streams per cpu
  - several cleanups

Examples:
- Catch default perf data (cycles event):
  $ perf record ls
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

- To display converted CTF data run [2]:
  $ babeltrace ./ctf-data/
  [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
  [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
  [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 8 }
  [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 114 }
  [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 2087 }
  [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
tid = 20714, pid = 20714, period = 37582 }
  [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
tid = 20714, pid = 20714, period = 600246 }
  [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
tid = 20714, pid = 20714, period = 1325731 }
  [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
20714, pid = 20714, period = 1144298 }

- To get some nice output in tracecompas GUI [3], please capture sched:*
  and syscall tracepoints like:
  # perf record -e 'sched:*,raw_syscalls:*' -a
  ^C[ perf record: Woken up 0 times to write data ]
  [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]

- To convert perf data file run:
  # perf data convert --to-ctf=./ctf 
  [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
  [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]

- To display converted CTF data run [2]:
  # babeltrace ./ctf-data/
  [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
perf_period = 1, common_type = 265, ...
  [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
perf_period = 1, common_type = 263, ...
  [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 }, 
{ perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id = 
462610, perf_period = 11380, ...
  [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
462562, perf_period = 1, common_type  ...
  [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 }, 
{ perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, perf_id = 
462612, perf_period = 1000265, ...
  [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, { 
perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
462635, perf_period = 1, ...
  [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, { 
perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
462639, perf_period = 1, ...

- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/core_ctf_convert

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
[4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/


Cc: Arnaldo Carvalho de Melo 
Cc: David Ahern 
Cc: Dominique Toupin 
Cc: Frederic Weisbecker 
Cc: Jeremie Galarneau 
Cc: Jiri Olsa 
Cc: Mathieu Desnoyers 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Sebastian Andrzej Siewior 
Cc: Tom Zanussi 
---
Jiri Olsa (5):
  perf tools: Add feature check for libbabeltrace
  perf tools: Add new perf data command
  perf data: Add perf data to CTF conversion support
  perf data: Enable stream flush within processing
  perf data: Add support for setting ordered_events queue size

Sebastian Andrzej Siewior (3):
  perf data: Add a 'perf' prefix to the generic fields
  perf data: Add tracepoint events fields CTF conversion support
  perf data: Switch to 

[PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-15 Thread Jiri Olsa
hi,
this is follow up on original RFC patchset:
  http://marc.info/?t=14073273564r=1w=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v3 changes:
  - rebased to latest acme's perf/core

v2 changes:
  - addressed comments from Namhyung
  - rebased to latest acme's perf/core

Changes from RFC:
  - able to generate CTF data, that are possible to be displayed under
tracecompas GUI [3], please check several screenshots in here [4]
  - storing CTF data streams per cpu
  - several cleanups

Examples:
- Catch default perf data (cycles event):
  $ perf record ls
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

- To display converted CTF data run [2]:
  $ babeltrace ./ctf-data/
  [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
  [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
  [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 8 }
  [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 114 }
  [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 2087 }
  [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
tid = 20714, pid = 20714, period = 37582 }
  [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
tid = 20714, pid = 20714, period = 600246 }
  [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
tid = 20714, pid = 20714, period = 1325731 }
  [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
20714, pid = 20714, period = 1144298 }

- To get some nice output in tracecompas GUI [3], please capture sched:*
  and syscall tracepoints like:
  # perf record -e 'sched:*,raw_syscalls:*' -a
  ^C[ perf record: Woken up 0 times to write data ]
  [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]

- To convert perf data file run:
  # perf data convert --to-ctf=./ctf 
  [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
  [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]

- To display converted CTF data run [2]:
  # babeltrace ./ctf-data/
  [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
perf_period = 1, common_type = 265, ...
  [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
perf_period = 1, common_type = 263, ...
  [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 }, 
{ perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id = 
462610, perf_period = 11380, ...
  [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
462562, perf_period = 1, common_type  ...
  [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 }, 
{ perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, perf_id = 
462612, perf_period = 1000265, ...
  [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, { 
perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
462635, perf_period = 1, ...
  [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, { 
perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
462639, perf_period = 1, ...

- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/core_ctf_convert

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
[4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/


Cc: Arnaldo Carvalho de Melo a...@redhat.com
Cc: David Ahern dsah...@gmail.com
Cc: Dominique Toupin dominique.tou...@ericsson.com
Cc: Frederic Weisbecker fweis...@gmail.com
Cc: Jeremie Galarneau jga...@efficios.com
Cc: Jiri Olsa jo...@kernel.org
Cc: Mathieu Desnoyers mathieu.desnoy...@efficios.com
Cc: Namhyung Kim namhy...@gmail.com
Cc: Paul Mackerras pau...@samba.org
Cc: Peter Zijlstra pet...@infradead.org
Cc: Sebastian Andrzej Siewior bige...@linutronix.de
Cc: Tom Zanussi tzanu...@gmail.com
---
Jiri Olsa (5):
  perf tools: Add feature check for libbabeltrace
  perf tools: Add new perf data command
  perf data: Add perf data to CTF conversion support
  perf data: Enable stream flush within processing
  perf 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-15 Thread Alexandre Montplaisir

Hi,

I'm a developer for the Trace Compass tool (see links [3], [4] in Jiri's 
email). I can confirm that the generated CTF can be read correctly by 
our tool, which enables many views and analyses (Control Flow, CPU usage 
view, etc.) that were previously only available for LTTng traces.


Some of our users also use perf extensively, and are looking forward to 
this feature! Is there any ETA as to when this will be merged upstream?


Thanks,
Alexandre


On 01/15/2015 11:15 AM, Jiri Olsa wrote:

hi,
this is follow up on original RFC patchset:
   http://marc.info/?t=14073273564r=1w=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v3 changes:
   - rebased to latest acme's perf/core

v2 changes:
   - addressed comments from Namhyung
   - rebased to latest acme's perf/core

Changes from RFC:
   - able to generate CTF data, that are possible to be displayed under
 tracecompas GUI [3], please check several screenshots in here [4]
   - storing CTF data streams per cpu
   - several cleanups

Examples:
- Catch default perf data (cycles event):
   $ perf record ls
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

- To display converted CTF data run [2]:
   $ babeltrace ./ctf-data/
   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 8 }
   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 114 }
   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 2087 }
   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
tid = 20714, pid = 20714, period = 37582 }
   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
tid = 20714, pid = 20714, period = 600246 }
   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
tid = 20714, pid = 20714, period = 1325731 }
   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
20714, pid = 20714, period = 1144298 }

- To get some nice output in tracecompas GUI [3], please capture sched:*
   and syscall tracepoints like:
   # perf record -e 'sched:*,raw_syscalls:*' -a
   ^C[ perf record: Woken up 0 times to write data ]
   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]

- To convert perf data file run:
   # perf data convert --to-ctf=./ctf
   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
   [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]

- To display converted CTF data run [2]:
   # babeltrace ./ctf-data/
   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
perf_period = 1, common_type = 265, ...
   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
perf_period = 1, common_type = 263, ...
   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 
}, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id = 
462610, perf_period = 11380, ...
   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
462562, perf_period = 1, common_type  ...
   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 
}, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, perf_id 
= 462612, perf_period = 1000265, ...
   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, 
{ perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
462635, perf_period = 1, ...
   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, { 
perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
462639, perf_period = 1, ...

- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
   perf/core_ctf_convert

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
[4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/


Cc: Arnaldo Carvalho de Melo a...@redhat.com
Cc: David Ahern dsah...@gmail.com
Cc: Dominique Toupin dominique.tou...@ericsson.com
Cc: Frederic Weisbecker fweis...@gmail.com
Cc: Jeremie Galarneau 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-15 Thread David Ahern

On 1/15/15 9:15 AM, Jiri Olsa wrote:

hi,
this is follow up on original RFC patchset:
   http://marc.info/?t=14073273564r=1w=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v3 changes:
   - rebased to latest acme's perf/core

v2 changes:
   - addressed comments from Namhyung
   - rebased to latest acme's perf/core

Changes from RFC:
   - able to generate CTF data, that are possible to be displayed under
 tracecompas GUI [3], please check several screenshots in here [4]
   - storing CTF data streams per cpu
   - several cleanups

Examples:
- Catch default perf data (cycles event):
   $ perf record ls
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]

- To display converted CTF data run [2]:
   $ babeltrace ./ctf-data/
   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 8 }
   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 114 }
   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
tid = 20714, pid = 20714, period = 2087 }
   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
tid = 20714, pid = 20714, period = 37582 }
   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
tid = 20714, pid = 20714, period = 600246 }
   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
tid = 20714, pid = 20714, period = 1325731 }
   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
20714, pid = 20714, period = 1144298 }

- To get some nice output in tracecompas GUI [3], please capture sched:*
   and syscall tracepoints like:
   # perf record -e 'sched:*,raw_syscalls:*' -a
   ^C[ perf record: Woken up 0 times to write data ]
   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]

- To convert perf data file run:
   # perf data convert --to-ctf=./ctf
   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
   [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]

- To display converted CTF data run [2]:
   # babeltrace ./ctf-data/
   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
perf_period = 1, common_type = 265, ...
   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
perf_period = 1, common_type = 263, ...
   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 
}, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id = 
462610, perf_period = 11380, ...
   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
462562, perf_period = 1, common_type  ...
   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 
}, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, perf_id 
= 462612, perf_period = 1000265, ...
   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, 
{ perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
462635, perf_period = 1, ...
   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, { 
perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
462639, perf_period = 1, ...

- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
   perf/core_ctf_convert

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
[4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/


Cc: Arnaldo Carvalho de Melo a...@redhat.com
Cc: David Ahern dsah...@gmail.com
Cc: Dominique Toupin dominique.tou...@ericsson.com
Cc: Frederic Weisbecker fweis...@gmail.com
Cc: Jeremie Galarneau jga...@efficios.com
Cc: Jiri Olsa jo...@kernel.org
Cc: Mathieu Desnoyers mathieu.desnoy...@efficios.com
Cc: Namhyung Kim namhy...@gmail.com
Cc: Paul Mackerras pau...@samba.org
Cc: Peter Zijlstra pet...@infradead.org
Cc: Sebastian Andrzej Siewior bige...@linutronix.de
Cc: Tom Zanussi tzanu...@gmail.com
---
Jiri Olsa (5):
   perf tools: Add feature check for libbabeltrace
   perf tools: Add new perf data command
   perf data: Add perf data to CTF 

Re: [PATCHv3 0/8] perf tools: Add perf data CTF conversion

2015-01-15 Thread Namhyung Kim
Hi Jiri,

On Thu, Jan 15, 2015 at 05:15:48PM +0100, Jiri Olsa wrote:
 hi,
 this is follow up on original RFC patchset:
   http://marc.info/?t=14073273564r=1w=2
 
 Basically we are adding 'perf data convert' command to
 allow conversion of perf data file into CTF [1] data.

I think I already gave my ACKs to this series, but let me repeat it.

Acked-by: Namhyung Kim namhy...@kernel.org

Thanks,
Namhyung


 
 v3 changes:
   - rebased to latest acme's perf/core
 
 v2 changes:
   - addressed comments from Namhyung
   - rebased to latest acme's perf/core
 
 Changes from RFC:
   - able to generate CTF data, that are possible to be displayed under
 tracecompas GUI [3], please check several screenshots in here [4]
   - storing CTF data streams per cpu
   - several cleanups
 
 Examples:
 - Catch default perf data (cycles event):
   $ perf record ls
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.012 MB perf.data (~546 samples) ]
 
 - To display converted CTF data run [2]:
   $ babeltrace ./ctf-data/
   [03:19:13.962125533] (+?.?) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962130001] (+0.04468) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 1 }
   [03:19:13.962131936] (+0.01935) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 8 }
   [03:19:13.962133732] (+0.01796) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 114 }
   [03:19:13.962135557] (+0.01825) cycles: { }, { ip = 0x8105443A, 
 tid = 20714, pid = 20714, period = 2087 }
   [03:19:13.962137627] (+0.02070) cycles: { }, { ip = 0x81361938, 
 tid = 20714, pid = 20714, period = 37582 }
   [03:19:13.962161091] (+0.23464) cycles: { }, { ip = 0x8124218F, 
 tid = 20714, pid = 20714, period = 600246 }
   [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0x811A75DB, 
 tid = 20714, pid = 20714, period = 1325731 }
   [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 
 20714, pid = 20714, period = 1144298 }
 
 - To get some nice output in tracecompas GUI [3], please capture sched:*
   and syscall tracepoints like:
   # perf record -e 'sched:*,raw_syscalls:*' -a
   ^C[ perf record: Woken up 0 times to write data ]
   [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]
 
 - To convert perf data file run:
   # perf data convert --to-ctf=./ctf 
   [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
   [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]
 
 - To display converted CTF data run [2]:
   # babeltrace ./ctf-data/
   [23:32:20.165354855] (+0.00507) sched:sched_wakeup: { cpu_id = 0 }, { 
 perf_ip = 0x810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, 
 perf_period = 1, common_type = 265, ...
   [23:32:20.165359078] (+0.01181) sched:sched_switch: { cpu_id = 0 }, { 
 perf_ip = 0x8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, 
 perf_period = 1, common_type = 263, ...
   [23:32:20.165364686] (+0.00328) sched:sched_stat_runtime: { cpu_id = 0 
 }, { perf_ip = 0x810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id 
 = 462610, perf_period = 11380, ...
   [23:32:20.165366067] (+0.01205) sched:sched_switch: { cpu_id = 0 }, { 
 perf_ip = 0x8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 
 462562, perf_period = 1, common_type  ...
   [23:32:20.165723312] (+0.01479) sched:sched_stat_runtime: { cpu_id = 2 
 }, { perf_ip = 0x810C8AE5, perf_tid = 11821, perf_pid = 11821, 
 perf_id = 462612, perf_period = 1000265, ...
   [23:32:20.065282391] (+?.?) raw_syscalls:sys_enter: { cpu_id = 1 }, 
 { perf_ip = 0x810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 
 462635, perf_period = 1, ...
   [23:32:20.065286422] (+0.04031) raw_syscalls:sys_exit: { cpu_id = 1 }, 
 { perf_ip = 0x810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 
 462639, perf_period = 1, ...
 
 - Or run tracecompass and open the CTF data ;-)
 
 Changes are also reachable in here:
   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
   perf/core_ctf_convert
 
 thanks,
 jirka
 
 [1] Common Trace Format - http://www.efficios.com/ctf
 [2] babeltrace - http://www.efficios.com/babeltrace
 [3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
 [4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/
 
 
 Cc: Arnaldo Carvalho de Melo a...@redhat.com
 Cc: David Ahern dsah...@gmail.com
 Cc: Dominique Toupin dominique.tou...@ericsson.com
 Cc: Frederic Weisbecker fweis...@gmail.com
 Cc: Jeremie Galarneau jga...@efficios.com
 Cc: Jiri Olsa jo...@kernel.org
 Cc: Mathieu Desnoyers mathieu.desnoy...@efficios.com
 Cc: Namhyung Kim namhy...@gmail.com
 Cc: Paul Mackerras pau...@samba.org
 Cc: Peter Zijlstra pet...@infradead.org
 Cc: Sebastian