[PATCH v3] Basic Support for Trace Compass

Chris Johns chrisj at rtems.org
Fri Aug 23 00:38:11 UTC 2019


hi,

I have decided to review the patch as Sebastian is away and I also wanted to
provide some focus on the issues related to merging it upstream to the RTEMS
master branch.

On 22/8/19 3:46 am, Ravindra Meena wrote:
> ---
>  user/tracing/eventrecording.rst | 86 ++++++++++++++++-----------------
>  1 file changed, 43 insertions(+), 43 deletions(-)
> 
> diff --git a/user/tracing/eventrecording.rst b/user/tracing/eventrecording.rst
> index d1e44df..39c0117 100644
> --- a/user/tracing/eventrecording.rst
> +++ b/user/tracing/eventrecording.rst
> @@ -55,7 +55,7 @@ function.
>  Recorded events can be sent to a host computer with a very simple record server
>  started by :c:func:`rtems_record_start_server` via a TCP connection.
>  
> -On the host computer you may use the command line tool :file:`rtems-record` to
> +On the host computer you may use the command line tool :file:`rtems-record-lttng` to
>  get recorded events from the record server running on the target system.
>  
>  .. _tracecompass:
> @@ -63,49 +63,49 @@ get recorded events from the record server running on the target system.
>  Trace Compass
>  =============
>  

Ah it took me a bit to figure out this patch is ...

https://github.com/rmeena840/rtems-docs/commit/6230eaf0d0f9f4968558c434bbc99459008049e8

It is confusing to review a patch like this on this list when it is sent as
pieces. It helps the review process if it is a complete patch set against the
RTEMS repos is sent.

> -`Trace Compass <https://www.eclipse.org/tracecompass/>`_ is a tool to analyse 
> -and display trace data graphically. Trace data can be gathered from  RTEMS 
> +`Trace Compass <https://www.eclipse.org/tracecompass/>`_ is a tool to analyse
> +and display trace data graphically. Trace data can be gathered from  RTEMS
>  applications via various means, for example:
>  
>  - :ref:`RTEMS Trace Linker <TraceLinker>`
>  - :ref:`RTEMS Capture Engine <CaptureEngine>`
>  - :ref:`RTEMS Event Recording <EventRecording>`
>  
> -Event Recording Infrastructure is used to analyse and display some basic 
> -information. The basic information is defined by the Linux kernel trace 
> +Event Recording Infrastructure is used to analyse and display some basic
> +information. The basic information is defined by the Linux kernel trace
>  support ( `LTTng <https://lttng.org/>`_ ) and includes CPU Usage, IRQ Analysis
> -( IRQ Statistics, IRQ Table etc.), Linux Kernel( Control Flow, Resources etc. 
> +( IRQ Statistics, IRQ Table etc.), Linux Kernel ( Control Flow, Resources etc.
>  )

This should be ...

 (IRQ Statistics, IRQ Table etc.), Linux Kernel (Control Flow, Resources etc.)

No spaces after '(' or before ')'.

>  
>  Advanced support for `Trace Compass <https://www.eclipse.org/
>  tracecompass/>`_ includes dynamic memory traces, stack usage,
>  network packet flow, etc.
>  
> -Event Recording Infrastructure generates the trace stream and converted into 
> -`LTTng <https://lttng.org/>`_ format at host which is easily understood by 
> +Event Recording Infrastructure generates the trace stream and converted into
> +`LTTng <https://lttng.org/>`_ format at host which is easily understood by
>  `Trace Compass <https://www.eclipse.org/tracecompass/>`_.
>  
>  This scheme of tracing goes through the flow of events described in a subsequent
> -flowchart. This requires the environment setup of 
> -`rtems-libbsd <https://github.com/RTEMS/rtems-libbsd>`_  and 
> +flowchart. This requires the environment setup of
> +`rtems-libbsd <https://github.com/RTEMS/rtems-libbsd>`_  and
>  `rtems-tools <https://github.com/RTEMS/rtems-tools>`_:
>  
>  Step 1: The QEMU simulator is used to run a LibBSD based application and connect
>  it to a virtual network on host. This requires to create a TAP virtual Ethernet
>  interface for this. 

What is a TAP virtual ethernet interface? On which hosts?

> The QEMU command line is used for board support package, e.g
> -the arm/xilinx_zynq_a9_qemu BSP etc. The host can be connected to target via 
> +the arm/xilinx_zynq_a9_qemu BSP etc. The host can be connected to target via

Is this a white space change? I suppose it does not mean anything as it is a
patch of a patch.

>  telnet.
>  
>  Step 2: On the host computer the command line tool rtems-record can be used to
> -get recorded events from the record server running on the target system. 
> +get recorded events from the record server running on the target system.

White space.

>  Recorded events can be sent to a host computer with a very simple record server
> -started by rtems_record_start_server() via a TCP connection.
> +started by :c:func:`rtems_record_start_server` via a TCP connection.
>  
> -Step 3: The trace data received at host from QEMU target is converted into 
> -`LTTng <https://lttng.org/>`_ trace. The 
> -`Babeltrace <https://diamon.org/babeltrace/>`_ and 
> -`Trace Compass <https://www.eclipse.org/tracecompass/>`_ are two compatible 
> -software which can read `LTTng <https://lttng.org/>`_ trace. The converted 
> +Step 3: The trace data received at host from QEMU target is converted into
> +`LTTng <https://lttng.org/>`_ trace. The
> +`Babeltrace <https://diamon.org/babeltrace/>`_ and
> +`Trace Compass <https://www.eclipse.org/tracecompass/>`_ are two compatible
> +software which can read `LTTng <https://lttng.org/>`_ trace. The converted
>  `LTTng <https://lttng.org/>`_ trace can be passed to any of these softwares.
>  
>  .. figure:: ../../images/user/event-recording-trace.png
> @@ -116,7 +116,7 @@ RTEMS LTTng Trace Generation Example
>  ====================================
>  
>  Step 1: Clone the repositories 
> -`rtems-libbsd <https://github.com/rmeena840/rtems-libbsd/tree/ravindra-rtems>`_  
> +`rtems-libbsd <https://github.com/rmeena840/rtems-libbsd/tree/ravindra-rtems>`_
>  and 
>  `rtems-tools <https://github.com/rmeena840/rtems-tools/tree/ravindra-rtems>`_
>  and set up the environment, if haven't done already.

Links to personal github repos cannot appear in the User Manual. Links have to
be to the RTEMS hosted repos. If this is against code in your github libbsd repo
it is OK to assume a documentation patch like this is merged after the code is
merged and so it is OK to reference the RTEMS repo.

> @@ -145,23 +145,23 @@ Step 3: This requires to TAP virtual Ethernet interface for this:
>  After some seconds it will acquire a IPv4 link-local address, e.g.

Should this be "After the target has booted it will acquire ..."

>  .. code-block:: none
> -  
> +
>    info: cgem0: probing for an IPv4LL address
>    debug: cgem0: checking for 169.254.XXX.XXX
>  
>  Use telnet command to connect host to target.
>  
>  .. code-block:: none
> -  
> +
>    telnet 169.254.XXX.XXX
>  
> -Step 4: After successfully connected to the target, the trace can be 
> +Step 4: After successfully connected to the target, the trace can be
>  generated by target by using the following command:
>  
>  .. code-block:: none
>  
>    cd rtems-tools

Is this in the clone rtems-tools repo? What if a user have installed the tools?

> -  ./build/misc/rtems-record -H 169.254.XXX.XXX -p 1234 | head
> +  ./build/trace/rtems-record-lttng -H 169.254.XXX.XXX -p 1234 | head
>  
>  Alternatively, if user have the raw data then the trace can be generated
>  from raw data without TCP connection by following command:
> @@ -169,26 +169,26 @@ from raw data without TCP connection by following command:
>  .. code-block:: none
>  
>    cd rtems-tools
> -  ./build/misc/rtems-record --input=<raw-data-path>
> +  ./build/trace/rtems-record-lttng --input=<raw-data-path>

This references the tool in the build tree.

>  
>  Here, <raw-data-path> is the path of raw data.
>  
>  Step 5: Set up the `Trace Compass <https://www.eclipse.org/
> -tracecompass/>`_ and install the `Add-Ons 
> +tracecompass/>`_ and install the `Add-Ons
>  <https://github.com/tuxology/tracevizlab/tree/master/labs/006-installing-tracecompass#task-3-install-the-required-add-ons-for-this-tutorial>`_
>  , if haven't done already.
>  
> -Step 6: The `Babeltrace <https://diamon.org/babeltrace/>`_ and `Trace Compass 
> -<https://www.eclipse.org/tracecompass/>`_ are two compatible software which 
> -can read `LTTng <https://lttng.org/>`_ trace. This step demonstrates the 
> +Step 6: The `Babeltrace <https://diamon.org/babeltrace/>`_ and `Trace Compass
> +<https://www.eclipse.org/tracecompass/>`_ are two compatible software which
> +can read `LTTng <https://lttng.org/>`_ trace. This step demonstrates the
>  trace visualization in `Trace Compass <https://www.eclipse.org/tracecompass/>`_:
>  
> -Move the trace from target/raw data and metadata generated in 
> -common folder, e.g CTF folder and follow the steps given `here 
> +Move the trace from target/raw data and metadata generated in
> +common folder, e.g CTF folder and follow the steps given `here
>  <https://github.com/tuxology/tracevizlab/tree/master/labs/006-installing-tracecompass#task-4-import-the-traces-for-the-tutorial>`_
>  to import the `LTTng <https://lttng.org/>`_ trace.
>  
> -The `LTTng <https://lttng.org/>`_ trace Visualization in `Trace Compass 
> +The `LTTng <https://lttng.org/>`_ trace Visualization in `Trace Compass
>  <https://www.eclipse.org/tracecompass/>`_ should look something like this:
>  
>  .. figure:: ../../images/user/Trace-Compass-Visualization.png
> @@ -196,12 +196,12 @@ The `LTTng <https://lttng.org/>`_ trace Visualization in `Trace Compass
>    :width: 100%
>  
>  Currently, `Trace Compass <https://www.eclipse.org/tracecompass/>`_ can only
> -display a proper CPU Load, Resources view and thread 
> -state( IDLE/RUNNING ) with thread names in trace visualization.
> +display a proper CPU Load, Resources view and thread
> +state ( IDLE/RUNNING ) with thread names in trace visualization.
>  
>  Alternatively, `Babeltrace <https://diamon.org/babeltrace/>`_ can be used if
> -user is only interested in reading the `LTTng <https://lttng.org/>`_ trace. 
> -Move the trace and metadata generated in common folder, e.g CTF folder and 
> +user is only interested in reading the `LTTng <https://lttng.org/>`_ trace.
> +Move the trace and metadata generated in common folder, e.g CTF folder and
>  run following command:
>  
>  .. code-block:: none
> @@ -209,23 +209,23 @@ run following command:
>    cd CTF
>    babeltrace .
>  
> -The `Babeltrace <https://diamon.org/babeltrace/>`_ output should look 
> +The `Babeltrace <https://diamon.org/babeltrace/>`_ output should look
>  something like this:
>  
>  .. code-block:: none
>  
> -  [19:22:08.679021917] (+0.000004377) Record_Item sched_switch: { cpu_id = 4 }, 
> -  { prev_comm = "IRQS", prev_tid = 167837706, prev_prio = 0, prev_state = 0, 
> +  [19:22:08.679021917] (+0.000004377) Record_Item sched_switch: { cpu_id = 4 },
> +  { prev_comm = "IRQS", prev_tid = 167837706, prev_prio = 0, prev_state = 0,
>    next_comm = "IDLE", next_tid = 0, next_prio = 0 }
> -  [19:22:08.679022700] (+0.000000783) Record_Item sched_switch: { cpu_id = 5 }, 
> -  { prev_comm = "IRQS", prev_tid = 167837707, prev_prio = 0, prev_state = 0, 
> +  [19:22:08.679022700] (+0.000000783) Record_Item sched_switch: { cpu_id = 5 },
> +  { prev_comm = "IRQS", prev_tid = 167837707, prev_prio = 0, prev_state = 0,
>    next_comm = "IDLE", next_tid = 0, next_prio = 0 }
>    [19:22:08.679030770] (+0.000008070) Record_Item sched_switch: { cpu_id = 4 },
> -  { prev_comm = "IDLE", prev_tid = 0, prev_prio = 0, prev_state = 1026, 
> +  { prev_comm = "IDLE", prev_tid = 0, prev_prio = 0, prev_state = 1026,
>    next_comm = "IDLE", next_tid = 0, next_prio = 0 }
>    [19:22:08.679030912] (+0.000000142) Record_Item sched_switch: { cpu_id = 5 },
> -  { prev_comm = "IDLE", prev_tid = 0, prev_prio = 0, prev_state = 1026, 
> +  { prev_comm = "IDLE", prev_tid = 0, prev_prio = 0, prev_state = 1026,
>    next_comm = "IRQS", next_tid = 167837707, next_prio = 0 }
>  
> -The above output displays the timestamp, thread state( IDLE/RUNNING ), cpu_id
> +The above output displays the timestamp, thread state ( IDLE/RUNNING ), cpu_id

  (IDLE/RUNNING)

Chris


More information about the devel mailing list