1*9f8e1810SJerin Jacob.. SPDX-License-Identifier: BSD-3-Clause 2*9f8e1810SJerin Jacob Copyright(C) 2020 Marvell International Ltd. 3*9f8e1810SJerin Jacob 4*9f8e1810SJerin JacobTrace Library 5*9f8e1810SJerin Jacob============= 6*9f8e1810SJerin Jacob 7*9f8e1810SJerin JacobOverview 8*9f8e1810SJerin Jacob-------- 9*9f8e1810SJerin Jacob 10*9f8e1810SJerin Jacob*Tracing* is a technique used to understand what goes on in a running software 11*9f8e1810SJerin Jacobsystem. The software used for tracing is called a *tracer*, which is 12*9f8e1810SJerin Jacobconceptually similar to a tape recorder. 13*9f8e1810SJerin JacobWhen recording, specific instrumentation points placed in the software source 14*9f8e1810SJerin Jacobcode generate events that are saved on a giant tape: a trace file. 15*9f8e1810SJerin JacobThe trace file then later can be opened in *trace viewers* to visualize and 16*9f8e1810SJerin Jacobanalyze the trace events with timestamps and multi-core views. 17*9f8e1810SJerin JacobSuch a mechanism will be useful for resolving a wide range of problems such as 18*9f8e1810SJerin Jacobmulti-core synchronization issues, latency measurements, finding out the 19*9f8e1810SJerin Jacobpost analysis information like CPU idle time, etc that would otherwise be 20*9f8e1810SJerin Jacobextremely challenging to get. 21*9f8e1810SJerin Jacob 22*9f8e1810SJerin JacobTracing is often compared to *logging*. However, tracers and loggers are two 23*9f8e1810SJerin Jacobdifferent tools, serving two different purposes. 24*9f8e1810SJerin JacobTracers are designed to record much lower-level events that occur much more 25*9f8e1810SJerin Jacobfrequently than log messages, often in the range of thousands per second, with 26*9f8e1810SJerin Jacobvery little execution overhead. 27*9f8e1810SJerin JacobLogging is more appropriate for a very high-level analysis of less frequent 28*9f8e1810SJerin Jacobevents: user accesses, exceptional conditions (errors and warnings, for 29*9f8e1810SJerin Jacobexample), database transactions, instant messaging communications, and such. 30*9f8e1810SJerin JacobSimply put, logging is one of the many use cases that can be satisfied with 31*9f8e1810SJerin Jacobtracing. 32*9f8e1810SJerin Jacob 33*9f8e1810SJerin JacobDPDK tracing library features 34*9f8e1810SJerin Jacob----------------------------- 35*9f8e1810SJerin Jacob 36*9f8e1810SJerin Jacob- A framework to add tracepoints in control and fast path APIs with minimum 37*9f8e1810SJerin Jacob impact on performance. 38*9f8e1810SJerin Jacob Typical trace overhead is ~20 cycles and instrumentation overhead is 1 cycle. 39*9f8e1810SJerin Jacob- Enable and disable the tracepoints at runtime. 40*9f8e1810SJerin Jacob- Save the trace buffer to the filesystem at any point in time. 41*9f8e1810SJerin Jacob- Support ``overwrite`` and ``discard`` trace mode operations. 42*9f8e1810SJerin Jacob- String-based tracepoint object lookup. 43*9f8e1810SJerin Jacob- Enable and disable a set of tracepoints based on regular expression and/or 44*9f8e1810SJerin Jacob globbing. 45*9f8e1810SJerin Jacob- Generate trace in ``Common Trace Format (CTF)``. ``CTF`` is an open-source 46*9f8e1810SJerin Jacob trace format and is compatible with ``LTTng``. 47*9f8e1810SJerin Jacob For detailed information, refer to 48*9f8e1810SJerin Jacob `Common Trace Format <https://diamon.org/ctf/>`_. 49*9f8e1810SJerin Jacob 50*9f8e1810SJerin JacobHow to add a tracepoint? 51*9f8e1810SJerin Jacob------------------------ 52*9f8e1810SJerin Jacob 53*9f8e1810SJerin JacobThis section steps you through the details of adding a simple tracepoint. 54*9f8e1810SJerin Jacob 55*9f8e1810SJerin Jacob.. _create_provider_header_file: 56*9f8e1810SJerin Jacob 57*9f8e1810SJerin JacobCreate the tracepoint provider header file 58*9f8e1810SJerin Jacob~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59*9f8e1810SJerin Jacob 60*9f8e1810SJerin Jacob.. code-block:: c 61*9f8e1810SJerin Jacob 62*9f8e1810SJerin Jacob #include <rte_trace_point.h> 63*9f8e1810SJerin Jacob 64*9f8e1810SJerin Jacob RTE_TRACE_POINT( 65*9f8e1810SJerin Jacob app_trace_string, 66*9f8e1810SJerin Jacob RTE_TRACE_POINT_ARGS(const char *str), 67*9f8e1810SJerin Jacob rte_trace_point_emit_string(str); 68*9f8e1810SJerin Jacob ) 69*9f8e1810SJerin Jacob 70*9f8e1810SJerin JacobThe above macro creates ``app_trace_string`` tracepoint. 71*9f8e1810SJerin JacobThe user can choose any name for the tracepoint. 72*9f8e1810SJerin JacobHowever, when adding a tracepoint in the DPDK library, the 73*9f8e1810SJerin Jacob``rte_<library_name>_trace_[<domain>_]<name>`` naming convention must be 74*9f8e1810SJerin Jacobfollowed. 75*9f8e1810SJerin JacobThe examples are ``rte_eal_trace_generic_str``, ``rte_mempool_trace_create``. 76*9f8e1810SJerin Jacob 77*9f8e1810SJerin JacobThe ``RTE_TRACE_POINT`` macro expands from above definition as the following 78*9f8e1810SJerin Jacobfunction template: 79*9f8e1810SJerin Jacob 80*9f8e1810SJerin Jacob.. code-block:: c 81*9f8e1810SJerin Jacob 82*9f8e1810SJerin Jacob static __rte_always_inline void 83*9f8e1810SJerin Jacob app_trace_string(const char *str) 84*9f8e1810SJerin Jacob { 85*9f8e1810SJerin Jacob /* Trace subsystem hooks */ 86*9f8e1810SJerin Jacob ... 87*9f8e1810SJerin Jacob rte_trace_point_emit_string(str); 88*9f8e1810SJerin Jacob } 89*9f8e1810SJerin Jacob 90*9f8e1810SJerin JacobThe consumer of this tracepoint can invoke 91*9f8e1810SJerin Jacob``app_trace_string(const char *str)`` to emit the trace event to the trace 92*9f8e1810SJerin Jacobbuffer. 93*9f8e1810SJerin Jacob 94*9f8e1810SJerin JacobRegister the tracepoint 95*9f8e1810SJerin Jacob~~~~~~~~~~~~~~~~~~~~~~~ 96*9f8e1810SJerin Jacob 97*9f8e1810SJerin Jacob.. code-block:: c 98*9f8e1810SJerin Jacob 99*9f8e1810SJerin Jacob /* Select tracepoint register macros */ 100*9f8e1810SJerin Jacob #define RTE_TRACE_POINT_REGISTER_SELECT 101*9f8e1810SJerin Jacob 102*9f8e1810SJerin Jacob #include <my_tracepoint_provider.h> 103*9f8e1810SJerin Jacob 104*9f8e1810SJerin Jacob RTE_TRACE_POINT_DEFINE(app_trace_string); 105*9f8e1810SJerin Jacob 106*9f8e1810SJerin Jacob RTE_INIT(app_trace_init) 107*9f8e1810SJerin Jacob { 108*9f8e1810SJerin Jacob RTE_TRACE_POINT_REGISTER(app_trace_string, app.trace.string); 109*9f8e1810SJerin Jacob } 110*9f8e1810SJerin Jacob 111*9f8e1810SJerin JacobThe above code snippet registers the ``app_trace_string`` tracepoint to 112*9f8e1810SJerin Jacobtrace library. Here, the ``my_tracepoint_provider.h`` is the header file 113*9f8e1810SJerin Jacobthat the user created in the first step :ref:`create_provider_header_file`. 114*9f8e1810SJerin Jacob 115*9f8e1810SJerin JacobThe second argument for the ``RTE_TRACE_POINT_REGISTER`` is the name for the 116*9f8e1810SJerin Jacobtracepoint. This string will be used for tracepoint lookup or regular 117*9f8e1810SJerin Jacobexpression and/or glob based tracepoint operations. 118*9f8e1810SJerin JacobThere is no requirement for the tracepoint function and its name to be similar. 119*9f8e1810SJerin JacobHowever, it is recommended to have a similar name for a better naming 120*9f8e1810SJerin Jacobconvention. 121*9f8e1810SJerin Jacob 122*9f8e1810SJerin JacobThe user must register the tracepoint before the ``rte_eal_init`` invocation. 123*9f8e1810SJerin JacobThe user can use the ``RTE_INIT`` construction scheme to achieve this. 124*9f8e1810SJerin Jacob 125*9f8e1810SJerin Jacob.. note:: 126*9f8e1810SJerin Jacob 127*9f8e1810SJerin Jacob The ``RTE_TRACE_POINT_REGISTER_SELECT`` must be defined before including the 128*9f8e1810SJerin Jacob header for the tracepoint registration to work properly. 129*9f8e1810SJerin Jacob 130*9f8e1810SJerin Jacob.. note:: 131*9f8e1810SJerin Jacob 132*9f8e1810SJerin Jacob The ``RTE_TRACE_POINT_DEFINE`` defines the placeholder for the 133*9f8e1810SJerin Jacob ``rte_trace_point_t`` tracepoint object. The user must export a 134*9f8e1810SJerin Jacob ``__<trace_function_name>`` symbol in the library ``.map`` file for this 135*9f8e1810SJerin Jacob tracepoint to be used out of the library, in shared builds. 136*9f8e1810SJerin Jacob For example, ``__app_trace_string`` will be the exported symbol in the 137*9f8e1810SJerin Jacob above example. 138*9f8e1810SJerin Jacob 139*9f8e1810SJerin JacobFast path tracepoint 140*9f8e1810SJerin Jacob-------------------- 141*9f8e1810SJerin Jacob 142*9f8e1810SJerin JacobIn order to avoid performance impact in fast path code, the library introduced 143*9f8e1810SJerin Jacob``RTE_TRACE_POINT_FP``. When adding the tracepoint in fast path code, 144*9f8e1810SJerin Jacobthe user must use ``RTE_TRACE_POINT_FP`` instead of ``RTE_TRACE_POINT``. 145*9f8e1810SJerin Jacob 146*9f8e1810SJerin Jacob``RTE_TRACE_POINT_FP`` is compiled out by default and it can be enabled using 147*9f8e1810SJerin Jacob``CONFIG_RTE_ENABLE_TRACE_FP`` configuration parameter. 148*9f8e1810SJerin JacobThe ``enable_trace_fp`` option shall be used for the same for meson build. 149*9f8e1810SJerin Jacob 150*9f8e1810SJerin JacobEvent record mode 151*9f8e1810SJerin Jacob----------------- 152*9f8e1810SJerin Jacob 153*9f8e1810SJerin JacobEvent record mode is an attribute of trace buffers. Trace library exposes the 154*9f8e1810SJerin Jacobfollowing modes: 155*9f8e1810SJerin Jacob 156*9f8e1810SJerin JacobOverwrite 157*9f8e1810SJerin Jacob When the trace buffer is full, new trace events overwrites the existing 158*9f8e1810SJerin Jacob captured events in the trace buffer. 159*9f8e1810SJerin JacobDiscard 160*9f8e1810SJerin Jacob When the trace buffer is full, new trace events will be discarded. 161*9f8e1810SJerin Jacob 162*9f8e1810SJerin JacobThe mode can be configured either using EAL command line parameter 163*9f8e1810SJerin Jacob``--trace-mode`` on application boot up or use ``rte_trace_mode_set()`` API to 164*9f8e1810SJerin Jacobconfigure at runtime. 165*9f8e1810SJerin Jacob 166*9f8e1810SJerin JacobTrace file location 167*9f8e1810SJerin Jacob------------------- 168*9f8e1810SJerin Jacob 169*9f8e1810SJerin JacobOn ``rte_trace_save()`` or ``rte_eal_cleanup()`` invocation, the library saves 170*9f8e1810SJerin Jacobthe trace buffers to the filesystem. By default, the trace files are stored in 171*9f8e1810SJerin Jacob``$HOME/dpdk-traces/rte-yyyy-mm-dd-[AP]M-hh-mm-ss/``. 172*9f8e1810SJerin JacobIt can be overridden by the ``--trace-dir=<directory path>`` EAL command line 173*9f8e1810SJerin Jacoboption. 174*9f8e1810SJerin Jacob 175*9f8e1810SJerin JacobFor more information, refer to :doc:`../linux_gsg/linux_eal_parameters` for 176*9f8e1810SJerin Jacobtrace EAL command line options. 177*9f8e1810SJerin Jacob 178*9f8e1810SJerin JacobView and analyze the recorded events 179*9f8e1810SJerin Jacob------------------------------------ 180*9f8e1810SJerin Jacob 181*9f8e1810SJerin JacobOnce the trace directory is available, the user can view/inspect the recorded 182*9f8e1810SJerin Jacobevents. 183*9f8e1810SJerin Jacob 184*9f8e1810SJerin JacobThere are many tools you can use to read DPDK traces: 185*9f8e1810SJerin Jacob 186*9f8e1810SJerin Jacob1. ``babeltrace`` is a command-line utility that converts trace formats; it 187*9f8e1810SJerin Jacobsupports the format that DPDK trace library produces, CTF, as well as a 188*9f8e1810SJerin Jacobbasic text output that can be grep'ed. 189*9f8e1810SJerin JacobThe babeltrace command is part of the Open Source Babeltrace project. 190*9f8e1810SJerin Jacob 191*9f8e1810SJerin Jacob2. ``Trace Compass`` is a graphical user interface for viewing and analyzing 192*9f8e1810SJerin Jacobany type of logs or traces, including DPDK traces. 193*9f8e1810SJerin Jacob 194*9f8e1810SJerin JacobUse the babeltrace command-line tool 195*9f8e1810SJerin Jacob~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 196*9f8e1810SJerin Jacob 197*9f8e1810SJerin JacobThe simplest way to list all the recorded events of a trace is to pass its path 198*9f8e1810SJerin Jacobto babeltrace with no options:: 199*9f8e1810SJerin Jacob 200*9f8e1810SJerin Jacob babeltrace </path-to-trace-events/rte-yyyy-mm-dd-[AP]M-hh-mm-ss/> 201*9f8e1810SJerin Jacob 202*9f8e1810SJerin Jacob``babeltrace`` finds all traces recursively within the given path and prints 203*9f8e1810SJerin Jacoball their events, merging them in chronological order. 204*9f8e1810SJerin Jacob 205*9f8e1810SJerin JacobYou can pipe the output of the babeltrace into a tool like grep(1) for further 206*9f8e1810SJerin Jacobfiltering. Below example grep the events for ``ethdev`` only:: 207*9f8e1810SJerin Jacob 208*9f8e1810SJerin Jacob babeltrace /tmp/my-dpdk-trace | grep ethdev 209*9f8e1810SJerin Jacob 210*9f8e1810SJerin JacobYou can pipe the output of babeltrace into a tool like wc(1) to count the 211*9f8e1810SJerin Jacobrecorded events. Below example count the number of ``ethdev`` events:: 212*9f8e1810SJerin Jacob 213*9f8e1810SJerin Jacob babeltrace /tmp/my-dpdk-trace | grep ethdev | wc --lines 214*9f8e1810SJerin Jacob 215*9f8e1810SJerin JacobUse the tracecompass GUI tool 216*9f8e1810SJerin Jacob~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 217*9f8e1810SJerin Jacob 218*9f8e1810SJerin Jacob``Tracecompass`` is another tool to view/analyze the DPDK traces which gives 219*9f8e1810SJerin Jacoba graphical view of events. Like ``babeltrace``, tracecompass also provides 220*9f8e1810SJerin Jacoban interface to search for a particular event. 221*9f8e1810SJerin JacobTo use ``tracecompass``, following are the minimum required steps: 222*9f8e1810SJerin Jacob 223*9f8e1810SJerin Jacob- Install ``tracecompass`` to the localhost. Variants are available for Linux, 224*9f8e1810SJerin Jacob Windows, and OS-X. 225*9f8e1810SJerin Jacob- Launch ``tracecompass`` which will open a graphical window with trace 226*9f8e1810SJerin Jacob management interfaces. 227*9f8e1810SJerin Jacob- Open a trace using ``File->Open Trace`` option and select metadata file which 228*9f8e1810SJerin Jacob is to be viewed/analyzed. 229*9f8e1810SJerin Jacob 230*9f8e1810SJerin JacobFor more details, refer 231*9f8e1810SJerin Jacob`Trace Compass <https://www.eclipse.org/tracecompass/>`_. 232*9f8e1810SJerin Jacob 233*9f8e1810SJerin JacobQuick start 234*9f8e1810SJerin Jacob----------- 235*9f8e1810SJerin Jacob 236*9f8e1810SJerin JacobThis section steps you through the details of generating trace and viewing it. 237*9f8e1810SJerin Jacob 238*9f8e1810SJerin Jacob- Start the dpdk-test:: 239*9f8e1810SJerin Jacob 240*9f8e1810SJerin Jacob echo "quit" | ./build/app/test/dpdk-test --no-huge --trace=.* 241*9f8e1810SJerin Jacob 242*9f8e1810SJerin Jacob- View the traces with babeltrace viewer:: 243*9f8e1810SJerin Jacob 244*9f8e1810SJerin Jacob babeltrace $HOME/dpdk-traces/rte-yyyy-mm-dd-[AP]M-hh-mm-ss/ 245*9f8e1810SJerin Jacob 246*9f8e1810SJerin JacobImplementation details 247*9f8e1810SJerin Jacob---------------------- 248*9f8e1810SJerin Jacob 249*9f8e1810SJerin JacobAs DPDK trace library is designed to generate traces that uses ``Common Trace 250*9f8e1810SJerin JacobFormat (CTF)``. ``CTF`` specification consists of the following units to create 251*9f8e1810SJerin Jacoba trace. 252*9f8e1810SJerin Jacob 253*9f8e1810SJerin Jacob- ``Stream`` Sequence of packets. 254*9f8e1810SJerin Jacob- ``Packet`` Header and one or more events. 255*9f8e1810SJerin Jacob- ``Event`` Header and payload. 256*9f8e1810SJerin Jacob 257*9f8e1810SJerin JacobFor detailed information, refer to 258*9f8e1810SJerin Jacob`Common Trace Format <https://diamon.org/ctf/>`_. 259*9f8e1810SJerin Jacob 260*9f8e1810SJerin JacobThe implementation details broadly divided into the following areas: 261*9f8e1810SJerin Jacob 262*9f8e1810SJerin JacobTrace metadata creation 263*9f8e1810SJerin Jacob~~~~~~~~~~~~~~~~~~~~~~~ 264*9f8e1810SJerin Jacob 265*9f8e1810SJerin JacobBased on the ``CTF`` specification, one of a CTF trace's streams is mandatory: 266*9f8e1810SJerin Jacobthe metadata stream. It contains exactly what you would expect: data about the 267*9f8e1810SJerin Jacobtrace itself. The metadata stream contains a textual description of the binary 268*9f8e1810SJerin Jacoblayouts of all the other streams. 269*9f8e1810SJerin Jacob 270*9f8e1810SJerin JacobThis description is written using the Trace Stream Description Language (TSDL), 271*9f8e1810SJerin Jacoba declarative language that exists only in the realm of CTF. 272*9f8e1810SJerin JacobThe purpose of the metadata stream is to make CTF readers know how to parse a 273*9f8e1810SJerin Jacobtrace's binary streams of events without CTF specifying any fixed layout. 274*9f8e1810SJerin JacobThe only stream layout known in advance is, in fact, the metadata stream's one. 275*9f8e1810SJerin Jacob 276*9f8e1810SJerin JacobThe internal ``trace_metadata_create()`` function generates the metadata. 277*9f8e1810SJerin Jacob 278*9f8e1810SJerin JacobTrace memory 279*9f8e1810SJerin Jacob~~~~~~~~~~~~ 280*9f8e1810SJerin Jacob 281*9f8e1810SJerin JacobThe trace memory will be allocated through an internal function 282*9f8e1810SJerin Jacob``__rte_trace_mem_per_thread_alloc()``. The trace memory will be allocated 283*9f8e1810SJerin Jacobper thread to enable lock less trace-emit function. 284*9f8e1810SJerin JacobThe memory for the trace memory for DPDK lcores will be allocated on 285*9f8e1810SJerin Jacob``rte_eal_init()`` if the trace is enabled through a EAL option. 286*9f8e1810SJerin JacobFor non DPDK threads, on the first trace emission, the memory will be 287*9f8e1810SJerin Jacoballocated. 288*9f8e1810SJerin Jacob 289*9f8e1810SJerin JacobTrace memory layout 290*9f8e1810SJerin Jacob~~~~~~~~~~~~~~~~~~~ 291*9f8e1810SJerin Jacob 292*9f8e1810SJerin Jacob.. _table_trace_mem_layout: 293*9f8e1810SJerin Jacob 294*9f8e1810SJerin Jacob.. table:: Trace memory layout. 295*9f8e1810SJerin Jacob 296*9f8e1810SJerin Jacob +-------------------+ 297*9f8e1810SJerin Jacob | packet.header | 298*9f8e1810SJerin Jacob +-------------------+ 299*9f8e1810SJerin Jacob | packet.context | 300*9f8e1810SJerin Jacob +-------------------+ 301*9f8e1810SJerin Jacob | trace 0 header | 302*9f8e1810SJerin Jacob +-------------------+ 303*9f8e1810SJerin Jacob | trace 0 payload | 304*9f8e1810SJerin Jacob +-------------------+ 305*9f8e1810SJerin Jacob | trace 1 header | 306*9f8e1810SJerin Jacob +-------------------+ 307*9f8e1810SJerin Jacob | trace 1 payload | 308*9f8e1810SJerin Jacob +-------------------+ 309*9f8e1810SJerin Jacob | trace N header | 310*9f8e1810SJerin Jacob +-------------------+ 311*9f8e1810SJerin Jacob | trace N payload | 312*9f8e1810SJerin Jacob +-------------------+ 313*9f8e1810SJerin Jacob 314*9f8e1810SJerin Jacobpacket.header 315*9f8e1810SJerin Jacob^^^^^^^^^^^^^ 316*9f8e1810SJerin Jacob 317*9f8e1810SJerin Jacob.. _table_packet_header: 318*9f8e1810SJerin Jacob 319*9f8e1810SJerin Jacob.. table:: Packet header layout. 320*9f8e1810SJerin Jacob 321*9f8e1810SJerin Jacob +-------------------+ 322*9f8e1810SJerin Jacob | uint32_t magic | 323*9f8e1810SJerin Jacob +-------------------+ 324*9f8e1810SJerin Jacob | rte_uuid_t uuid | 325*9f8e1810SJerin Jacob +-------------------+ 326*9f8e1810SJerin Jacob 327*9f8e1810SJerin Jacobpacket.context 328*9f8e1810SJerin Jacob^^^^^^^^^^^^^^ 329*9f8e1810SJerin Jacob 330*9f8e1810SJerin Jacob.. _table_packet_context: 331*9f8e1810SJerin Jacob 332*9f8e1810SJerin Jacob.. table:: Packet context layout. 333*9f8e1810SJerin Jacob 334*9f8e1810SJerin Jacob +----------------------+ 335*9f8e1810SJerin Jacob | uint32_t thread_id | 336*9f8e1810SJerin Jacob +----------------------+ 337*9f8e1810SJerin Jacob | char thread_name[32] | 338*9f8e1810SJerin Jacob +----------------------+ 339*9f8e1810SJerin Jacob 340*9f8e1810SJerin Jacobtrace.header 341*9f8e1810SJerin Jacob^^^^^^^^^^^^ 342*9f8e1810SJerin Jacob 343*9f8e1810SJerin Jacob.. _table_trace_header: 344*9f8e1810SJerin Jacob 345*9f8e1810SJerin Jacob.. table:: Trace header layout. 346*9f8e1810SJerin Jacob 347*9f8e1810SJerin Jacob +----------------------+ 348*9f8e1810SJerin Jacob | event_id [63:48] | 349*9f8e1810SJerin Jacob +----------------------+ 350*9f8e1810SJerin Jacob | timestamp [47:0] | 351*9f8e1810SJerin Jacob +----------------------+ 352*9f8e1810SJerin Jacob 353*9f8e1810SJerin JacobThe trace header is 64 bits, it consists of 48 bits of timestamp and 16 bits 354*9f8e1810SJerin Jacobevent ID. 355*9f8e1810SJerin Jacob 356*9f8e1810SJerin JacobThe ``packet.header`` and ``packet.context`` will be written in the slow path 357*9f8e1810SJerin Jacobat the time of trace memory creation. The ``trace.header`` and trace payload 358*9f8e1810SJerin Jacobwill be emitted when the tracepoint function is invoked. 359