<div dir="ltr">Hi Jonathan,<div><br></div><div>Thank you very much !</div><div><br></div><div>Best regards,</div><div>Zvika </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 19, 2019 at 11:48 PM Jonathan Rajotte-Julien <<a href="mailto:jonathan.rajotte-julien@efficios.com">jonathan.rajotte-julien@efficios.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Zvi,<br>
<br>
On Fri, Jul 19, 2019 at 05:28:48PM +0300, Zvi Vered wrote:<br>
> Hello,<br>
> <br>
> Using babeltrace I created a text trace.<br>
> How can I understand it ?<br>
<br>
Here lies the heavy work!<br>
<br>
> <br>
> For example:<br>
> I logged userspace events. One of my threads is called: RSPOn3<br>
<br>
As far as I can tell sched_* are not userspace events they are "kernelspace"<br>
events.<br>
<br>
> I can see the following lines:<br>
> <br>
> sched_switch: { cpu_id = 0 }, { prev_comm = "RSPOn3", prev_tid = 27307,<br>
> prev_prio = -58, prev_state = 1, next_comm = "swapper/0", next_tid = 0,<br>
> next_prio = 20 }<br>
> <br>
> sched_wakeup: { cpu_id = 0 }, { comm = "RSPOn3", tid = 27307, prio = -58,<br>
> success = 1, target_cpu = 0 }<br>
> <br>
> sched_switch: { cpu_id = 0 }, { prev_comm = "swapper/0", prev_tid = 0,<br>
> prev_prio = 20, prev_state = 0, next_comm = "RSPOn3", next_tid = 27307,<br>
> next_prio = -58 }<br>
> <br>
> sched_switch: { cpu_id = 0 }, { prev_comm = "RSPOn3", prev_tid = 27307,<br>
> prev_prio = -58, prev_state = 1, next_comm = "swapper/0", next_tid = 0,<br>
> next_prio = 20 }<br>
> <br>
> How can I know the meaning of each field in each line ?<br>
<br>
You will need to understand the kernel state transition of the scheduler. There<br>
is multiple ways to go about it.<br>
<br>
You could use TraceCompass[1][2] or lttng-analyses[3] to ease/complement your<br>
learning experience a bit.<br>
<br>
You could dive in the kernel source code and understand the control flow<br>
surrounding each events and understand the significance of the events payload.<br>
<br>
Another interesting place to look is the kernel trace documentation [4]. Some<br>
subsystems have clear explanation regarding each tracepoint [5].<br>
<br>
> 1. sched_switch, sched_wakeup<br>
> 2. prev_comm<br>
> 3. prev_state<br>
> 4. next_comm<br>
> <br>
> If a task is blocked (e.g waiting for TCP) and then runs for some time and<br>
> then waits again, how this will be logged ?<br>
<br>
Babeltrace is a trace converter, it does not perform any analysis. TraceCompass<br>
and lttng-analyses might have analysis fitting your needs.<br>
<br>
Cheers<br>
<br>
[1] <a href="https://www.eclipse.org/tracecompass/" rel="noreferrer" target="_blank">https://www.eclipse.org/tracecompass/</a><br>
[2] <a href="https://archive.eclipse.org/tracecompass/doc/stable/org.eclipse.tracecompass.doc.user/LTTng-Kernel-Analysis.html#LTTng_Kernel_Analysis" rel="noreferrer" target="_blank">https://archive.eclipse.org/tracecompass/doc/stable/org.eclipse.tracecompass.doc.user/LTTng-Kernel-Analysis.html#LTTng_Kernel_Analysis</a><br>
[3] <a href="https://github.com/lttng/lttng-analyses" rel="noreferrer" target="_blank">https://github.com/lttng/lttng-analyses</a><br>
[4] <a href="https://www.kernel.org/doc/Documentation/trace/" rel="noreferrer" target="_blank">https://www.kernel.org/doc/Documentation/trace/</a><br>
[5] <a href="https://www.kernel.org/doc/Documentation/trace/events-kmem.txt" rel="noreferrer" target="_blank">https://www.kernel.org/doc/Documentation/trace/events-kmem.txt</a><br>
<br>
-- <br>
Jonathan Rajotte-Julien<br>
EfficiOS<br>
</blockquote></div>