From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7D343454B2; Fri, 21 Jun 2024 04:33:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A4B442EAB; Fri, 21 Jun 2024 04:33:30 +0200 (CEST) Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) by mails.dpdk.org (Postfix) with ESMTP id 1023B42E92 for ; Fri, 21 Jun 2024 04:33:28 +0200 (CEST) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-2598a57b2c1so793567fac.0 for ; Thu, 20 Jun 2024 19:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718937207; x=1719542007; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=PHVNW4mnJ5LGFWkoMSG2ZReJQsaezFvbg5mMljcs8GQ=; b=I8J7kwVyt+7adlnrQ6nJhmTAzX0BFPyKlG3NaenU9V+By3XGSOvHFXRXUZ0vy3z3jn PvQWChww51+BEY7RF532KXRlyYGDjK96vUl8Ril3ORcP4VsUF4D9ZzseSefhPJktaR96 RLm4KemiNOOysUgTbrqkzKLlOaR9JcJs2RpfKS9tOKaQs4uBSj5J0QcLM6JnVa9L0KRN W+AEE2a/rXekrr9l3Frf3at58YO6nYf8a3ochCsZ6boPgQNR6FGlj97Rme1m2b0q3f23 qC52jNlIsD308wJxAySEjWUaB4pIk0Sta1O5Rdc0aY/C4JVANhJwsD6tyigw2Xyq79wH cdWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718937207; x=1719542007; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PHVNW4mnJ5LGFWkoMSG2ZReJQsaezFvbg5mMljcs8GQ=; b=ulJ1T+ocRZsXVo/DasZ/GnWRAakfKRA1xqZNh/vLaItt7rOlCTh0TQNqIDjPuF9Rt7 QcCNsY6OS7babMAUMbdZJVwNJWYFndB5W5iv2pdkFa2h4VuOymxv72mg/2PRyCHrLsmF bQ22RR2XYhAUjl0gzzQBA9/Cdvt9ksciP294XU/qglmCgOVBgRLQ2815Ixa4I+arVPeS NutmiY7uSrgOrYPoRdvQNynycXE2BrqTCXdIFYTX6i7PT7Glxk9xMKqvaXg6Oa4q+3Lv 6WdvFU3fHzLty8q2EtICm+XJgG67uZLAFOfIpGo0NjW+AVL7F/emqFNvb2DKM1XcOzcz sUYQ== X-Gm-Message-State: AOJu0YxnMPXA2QaB3q4ChAjYrQJmRYLkwvdZQ5EVjm6pnznH3JzfPRLA N2s0U3GGbHIO4KeDmn3dXsJ1jfiAkPoAkzwUWIRP8wi2VkuJ8oDrbLttinoa X-Google-Smtp-Source: AGHT+IGwexV2hHyJ2BGSbmvXpBR3M1FMKPkldtpcJxEP98wvisUuxW2i1sSMMh5RjLRw9rGa5FYnZQ== X-Received: by 2002:a05:6870:5490:b0:259:8156:c08f with SMTP id 586e51a60fabf-25c9498ecafmr7780322fac.15.1718937207071; Thu, 20 Jun 2024 19:33:27 -0700 (PDT) Received: from localhost.localdomain (syn-076-032-089-124.res.spectrum.com. [76.32.89.124]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7065124df73sm334482b3a.110.2024.06.20.19.33.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 19:33:26 -0700 (PDT) From: Nandini Persad To: dev@dpdk.org Subject: [PATCH v2 5/9] doc: reword trace library section in prog guide Date: Thu, 20 Jun 2024 19:32:50 -0700 Message-Id: <20240621023254.4258-5-nandinipersad361@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621023254.4258-1-nandinipersad361@gmail.com> References: <20240513155911.31872-1-nandinipersad361@gmail.com> <20240621023254.4258-1-nandinipersad361@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Minor syntax edits were made to sect the trace library section of prog guide. Signed-off-by: Nandini Persad --- doc/guides/prog_guide/trace_lib.rst | 50 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/doc/guides/prog_guide/trace_lib.rst b/doc/guides/prog_guide/trace_lib.rst index d9b17abe90..e2983017d8 100644 --- a/doc/guides/prog_guide/trace_lib.rst +++ b/doc/guides/prog_guide/trace_lib.rst @@ -14,29 +14,29 @@ When recording, specific instrumentation points placed in the software source code generate events that are saved on a giant tape: a trace file. The trace file then later can be opened in *trace viewers* to visualize and analyze the trace events with timestamps and multi-core views. -Such a mechanism will be useful for resolving a wide range of problems such as -multi-core synchronization issues, latency measurements, finding out the -post analysis information like CPU idle time, etc that would otherwise be -extremely challenging to get. +This mechanism will be useful for resolving a wide range of problems such as +multi-core synchronization issues, latency measurements, and finding +post analysis information like CPU idle time, etc., that would otherwise be +extremely challenging to gather. Tracing is often compared to *logging*. However, tracers and loggers are two -different tools, serving two different purposes. -Tracers are designed to record much lower-level events that occur much more +different tools serving two different purposes. +Tracers are designed to record much lower-level events that occur more frequently than log messages, often in the range of thousands per second, with very little execution overhead. Logging is more appropriate for a very high-level analysis of less frequent events: user accesses, exceptional conditions (errors and warnings, for -example), database transactions, instant messaging communications, and such. +example), database transactions, instant messaging communications, etc. Simply put, logging is one of the many use cases that can be satisfied with tracing. DPDK tracing library features ----------------------------- -- A framework to add tracepoints in control and fast path APIs with minimum +- Provides framework to add tracepoints in control and fast path APIs with minimum impact on performance. Typical trace overhead is ~20 cycles and instrumentation overhead is 1 cycle. -- Enable and disable the tracepoints at runtime. +- Enable and disable tracepoints at runtime. - Save the trace buffer to the filesystem at any point in time. - Support ``overwrite`` and ``discard`` trace mode operations. - String-based tracepoint object lookup. @@ -47,7 +47,7 @@ DPDK tracing library features For detailed information, refer to `Common Trace Format `_. -How to add a tracepoint? +How to add a Tracepoint ------------------------ This section steps you through the details of adding a simple tracepoint. @@ -67,14 +67,14 @@ Create the tracepoint header file rte_trace_point_emit_string(str); ) -The above macro creates ``app_trace_string`` tracepoint. +The above macro creates the ``app_trace_string`` tracepoint. The user can choose any name for the tracepoint. However, when adding a tracepoint in the DPDK library, the ``rte__trace_[_]`` naming convention must be followed. The examples are ``rte_eal_trace_generic_str``, ``rte_mempool_trace_create``. -The ``RTE_TRACE_POINT`` macro expands from above definition as the following +The ``RTE_TRACE_POINT`` macro expands from the above definition as the following function template: .. code-block:: c @@ -91,7 +91,7 @@ The consumer of this tracepoint can invoke ``app_trace_string(const char *str)`` to emit the trace event to the trace buffer. -Register the tracepoint +Register the Tracepoint ~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: c @@ -122,40 +122,40 @@ convention. The ``RTE_TRACE_POINT_REGISTER`` defines the placeholder for the ``rte_trace_point_t`` tracepoint object. - For generic tracepoint or for tracepoint used in public header files, + For a generic tracepoint or for the tracepoint used in public header files, the user must export a ``__`` symbol in the library ``.map`` file for this tracepoint - to be used out of the library, in shared builds. + to be used out of the library in shared builds. For example, ``__app_trace_string`` will be the exported symbol in the above example. -Fast path tracepoint +Fast Path Tracepoint -------------------- In order to avoid performance impact in fast path code, the library introduced ``RTE_TRACE_POINT_FP``. When adding the tracepoint in fast path code, the user must use ``RTE_TRACE_POINT_FP`` instead of ``RTE_TRACE_POINT``. -``RTE_TRACE_POINT_FP`` is compiled out by default and it can be enabled using +``RTE_TRACE_POINT_FP`` is compiled by default and can be enabled using the ``enable_trace_fp`` option for meson build. -Event record mode +Event Record Mode ----------------- -Event record mode is an attribute of trace buffers. Trace library exposes the +Event record mode is an attribute of trace buffers. The trace library exposes the following modes: Overwrite - When the trace buffer is full, new trace events overwrites the existing + When the trace buffer is full, new trace events overwrite the existing captured events in the trace buffer. Discard When the trace buffer is full, new trace events will be discarded. -The mode can be configured either using EAL command line parameter -``--trace-mode`` on application boot up or use ``rte_trace_mode_set()`` API to +The mode can be configured either using the EAL command line parameter +``--trace-mode`` on application boot up or use the ``rte_trace_mode_set()`` API to configure at runtime. -Trace file location +Trace File Location ------------------- On ``rte_trace_save()`` or ``rte_eal_cleanup()`` invocation, the library saves @@ -167,7 +167,7 @@ option. For more information, refer to :doc:`../linux_gsg/linux_eal_parameters` for trace EAL command line options. -View and analyze the recorded events +View and Analyze Recorded Events ------------------------------------ Once the trace directory is available, the user can view/inspect the recorded @@ -176,7 +176,7 @@ events. There are many tools you can use to read DPDK traces: #. ``babeltrace`` is a command-line utility that converts trace formats; it - supports the format that DPDK trace library produces, CTF, as well as a + supports the format that the DPDK trace library produces, CTF, as well as a basic text output that can be grep'ed. The babeltrace command is part of the Open Source Babeltrace project. -- 2.34.1