public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Jiri Olsa <jolsa@redhat.com>,
	linux-kernel@vger.kernel.org,
	Dominique Toupin <dominique.toupin@ericsson.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Tom Zanussi <tzanussi@gmail.com>,
	Jeremie Galarneau <jgalar@efficios.com>,
	David Ahern <dsahern@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: FW: [RFC 0/5] perf tools: Add perf data CTF conversion
Date: Thu, 06 Nov 2014 04:25:43 +0100	[thread overview]
Message-ID: <545AEA37.601@voxpopuli.im> (raw)
In-Reply-To: <20141105125028.GA30087@linutronix.de>


On 11/05/2014 01:50 PM, Sebastian Andrzej Siewior wrote:
> [...]
>> If the trace events from both LTTng and perf represent the same thing
>> (and I assume they should, since they come from the same tracepoints,
>> right?), then we could just add a wrapper on the viewer side to
>> decide which event/field names to use, depending on the trace type.
>>
>> Right now, we only define LTTng event and field names:
>> http://git.eclipse.org/c/tracecompass/org.eclipse.tracecompass.git/tree/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/LttngStrings.java
> Okay. So I found this file for linuxtools now let me try tracecompass.
> The basic renaming should do the job. Then I have to figure out how to
> compile this thingy…

"mvn clean install". It is the Maven equivalent of "./configure && make" ;)

Or if you want to build a standalone application (RCP):
mvn clean install -Pbuild-rcp -Dmaven.test.skip=true

see the README file in the git tree for details.

>
> There is this one thing where you go for "tid" while perf says "pid". I
> guess I could figure that out once I have the rename done.
> We don't have lttng_statedump_process_state, this look lttng specific. I
> would have to look if there is a replacement event in perf.

Yes, the state dump is something specific to LTTng. It allows us to know 
about processes that exist on the system, even if they are sleeping for 
the whole duration of the trace (and thus, would not show up in the 
trace at all).

But even if these events are not present, we can still know about active 
processes when they do shed_switch's for example.

> I have no idea what we could do about the "unknown" events, say someone
> enbales skb tracing. But this is probably something for once we are
> done with the basic integration.
>
>> But if you could for example tell me the perf equivalents of all the
>> strings in that file, I could hack together such wrapper. With that,
>> in theory, perf traces should behave exactly the same as LTTng traces
>> in the viewer!
> Oooh, that would be awesome. So I installed maven but didn't get much
> further. Let me gather this for you.

Awesome, thanks!

I am travelling this week, so I'm a bit busy, but I will try to 
prototype a "wrapper" for the kernel analysis, and adding support for 
the perf events, whenever I have a chance. I'll keep you posted.

>
> So first the renaming:
> diff --git a/LttngStrings.java b/LttngStrings.java
> --- a/LttngStrings.java
> +++ b/LttngStrings.java
> @@ -27,17 +27,17 @@ public interface LttngStrings {
>   
>       /* Event names */
>       static final String EXIT_SYSCALL = "exit_syscall";
> -    static final String IRQ_HANDLER_ENTRY = "irq_handler_entry";
> -    static final String IRQ_HANDLER_EXIT = "irq_handler_exit";
> -    static final String SOFTIRQ_ENTRY = "softirq_entry";
> -    static final String SOFTIRQ_EXIT = "softirq_exit";
> -    static final String SOFTIRQ_RAISE = "softirq_raise";
> -    static final String SCHED_SWITCH = "sched_switch";
> -    static final String SCHED_WAKEUP = "sched_wakeup";
> -    static final String SCHED_WAKEUP_NEW = "sched_wakeup_new";
> -    static final String SCHED_PROCESS_FORK = "sched_process_fork";
> -    static final String SCHED_PROCESS_EXIT = "sched_process_exit";
> -    static final String SCHED_PROCESS_FREE = "sched_process_free";
> +    static final String IRQ_HANDLER_ENTRY = "irq:irq_handler_entry";
> +    static final String IRQ_HANDLER_EXIT = "irq:irq_handler_exit";
> +    static final String SOFTIRQ_ENTRY = "irq:softirq_entry";
> +    static final String SOFTIRQ_EXIT = "irq:softirq_exit";
> +    static final String SOFTIRQ_RAISE = "irq:softirq_raise";
> +    static final String SCHED_SWITCH = "sched:sched_switch";
> +    static final String SCHED_WAKEUP = "sched:sched_wakeup";
> +    static final String SCHED_WAKEUP_NEW = "sched:sched_wakeup_new";
> +    static final String SCHED_PROCESS_FORK = "sched:sched_process_fork";
> +    static final String SCHED_PROCESS_EXIT = "sched:sched_process_exit";
> +    static final String SCHED_PROCESS_FREE = "sched:sched_process_free";
>       static final String STATEDUMP_PROCESS_STATE = "lttng_statedump_process_state";
>   
>       /* System call names */
>
> I have no idea how exit_syscall is different from irq_handler_exit and I
> think we have to skip for now on STATEDUMP_PROCESS_STATE.
>
> For the syscalls:
>
> - static final String SYSCALL_PREFIX = "sys_";
>    It is bassicaly:
>      syscalls:sys_enter_
>      syscalls:sys_exit_
>    depending what you are looking for.
>
> - static final String COMPAT_SYSCALL_PREFIX = "compat_sys_";
>    I haven't found this. Could it be that we don't record the compat_sys
>    at all?

IIRC, compat_sys is for instance for 32-bit system calls on a 64-bit 
kernel. Perhaps the "compat" system calls are recorded as standard 
system call events with perf? We could test it once we get the base 
things working.

> - static final String SYS_CLONE = "sys_clone";
>    here we have
>      syscalls:sys_enter_clone
>      syscalls:sys_exit_clone
>    I guess the enter is what you are looking for.
>
> For the fields, this is one event with alle the members we have. Please
> note that lttng saves the members with the _ prefix and I haven't seen
> that prefix in that .java file.

As Mathieu explained in his reply, in LTTng-CTF they have a _ before 
field names. In our parser, we take out the first character if it is an 
underscore. So it should still work with underscore-less fields.


Cheers,
Alexandre

  parent reply	other threads:[~2014-11-06  3:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <53F38C74.4030300@voxpopuli.im>
2014-08-20  9:28 ` FW: [RFC 0/5] perf tools: Add perf data CTF conversion Jiri Olsa
2014-08-20 19:14   ` Alexandre Montplaisir
2014-08-21 16:58     ` Jiri Olsa
2014-08-21 20:03       ` Alexandre Montplaisir
2014-08-22 16:46         ` Jiri Olsa
2014-11-03 17:58     ` Sebastian Andrzej Siewior
2014-11-04  1:20       ` Alexandre Montplaisir
2014-11-05 12:50         ` Sebastian Andrzej Siewior
2014-11-05 17:21           ` Mathieu Desnoyers
2014-11-06  4:53             ` Alexandre Montplaisir
2014-11-13 19:24             ` Sebastian Andrzej Siewior
2014-11-14 15:51               ` Mathieu Desnoyers
2014-11-06  3:25           ` Alexandre Montplaisir [this message]
2014-11-10  1:31             ` FW: " Alexandre Montplaisir
2014-11-12 22:14               ` Support for Perf CTF traces now in master (was Re: FW: [RFC 0/5] perf tools: Add perf data CTF conversion) Alexandre Montplaisir
2014-11-26 17:37                 ` Sebastian Andrzej Siewior
2014-11-27  4:27                   ` Alexandre Montplaisir
2014-11-29  9:35                     ` [tracecompass-dev] " Jerome CORRENOZ
2014-11-28 11:26                   ` Jiri Olsa
2014-12-01 17:28                     ` Jérémie Galarneau
2014-12-01 20:44                       ` Jiri Olsa
2014-11-27 15:43                 ` Jiri Olsa
2014-11-27 16:20                   ` Sebastian Andrzej Siewior
2014-11-27 18:31                   ` Alexandre Montplaisir
2014-11-28  9:32                     ` Jiri Olsa
2014-11-13 19:24             ` FW: [RFC 0/5] perf tools: Add perf data CTF conversion Sebastian Andrzej Siewior
2014-11-14 11:50               ` 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=545AEA37.601@voxpopuli.im \
    --to=alexmonthy@voxpopuli.im \
    --cc=acme@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=dominique.toupin@ericsson.com \
    --cc=dsahern@gmail.com \
    --cc=jgalar@efficios.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=tzanussi@gmail.com \
    /path/to/YOUR_REPLY

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

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