From 08ad202dfbcfe4f318523f9c9e72e826be6c377c Mon Sep 17 00:00:00 2001 From: "Nakamura, Yuuichi" Date: Wed, 28 Oct 2020 10:45:30 +0900 Subject: [PATCH] Update task trace document --- .../components/drivers/character/note.rst | 26 +++++++++++++++++++ Documentation/guides/tasktraceuser.rst | 19 +++++++++----- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/Documentation/components/drivers/character/note.rst b/Documentation/components/drivers/character/note.rst index cd2e942cf1..ca27d22de5 100644 --- a/Documentation/components/drivers/character/note.rst +++ b/Documentation/components/drivers/character/note.rst @@ -180,6 +180,23 @@ Noteram Device (``/dev/note``) The header file ``include/nuttx/note/noteram_driver.h`` provides the interface definitions of the device. +``/dev/note`` Data Structures +-------------------------------- + +.. c:struct:: noteram_get_taskname_s + + .. code-block:: c + + struct noteram_get_taskname_s + { + pid_t pid; + char taskname[CONFIG_TASK_NAME_SIZE + 1]; + }; + + - ``pid`` : Task ID to get the task name. + + - ``taskname`` : The task name string corresponding to given pid. + ``/dev/note`` Ioctls -------------------- @@ -222,6 +239,15 @@ Noteram Device (``/dev/note``) :return: If success, 0 (``OK``) is returned and the given overwriter mode is set as the current settings. If failed, a negated ``errno`` is returned. +.. c:macro:: NOTERAM_GETTASKNAME + + Get task name string + + :argument: A writable pointer to :c:struct:`noteram_get_taskname_s` + + :return: If success, 0 (``OK``) is returned and the task name corresponding to given pid is stored into the given pointer. + If failed, a negated ``errno`` is returned. + Filter control APIs =================== diff --git a/Documentation/guides/tasktraceuser.rst b/Documentation/guides/tasktraceuser.rst index a17657fb7c..293c3ffaae 100644 --- a/Documentation/guides/tasktraceuser.rst +++ b/Documentation/guides/tasktraceuser.rst @@ -43,20 +43,27 @@ The following configurations are configurable parameters for trace. - Bit 2 = Enable IRQ instrumentation - Bit 3 = Enable collecting syscall arguments -- ``CONFIG_SCHED_INSTRUMENTATION_NOTERAM_BUFSIZE`` +- ``CONFIG_SCHED_INSTRUMENTATION_HIRES`` + + - If enabled, use higher resolution system timer for instrumentation. + +- ``CONFIG_DRIVER_NOTERAM_BUFSIZE`` - Specify the note buffer size in bytes. Higher value can hold more note records, but consumes more kernel memory. -- ``CONFIG_SCHED_INSTRUMENTATION_NOTERAM_DEFAULT_NOOVERWRITE`` +- ``CONFIG_DRIVER_NOTERAM_TASKNAME_BUFSIZE`` + + - Specify the task name buffer size in bytes. + The buffer is used to hold the name of the task during instrumentation. + Trace dump can find and show a task name corresponding to given pid in the instrumentation data by using this buffer. + If 0 is specified, this feature is disabled and trace dump shows only the name of the newly created task. + +- ``CONFIG_DRIVER_NOTERAM_DEFAULT_NOOVERWRITE`` - If enabled, stop overwriting old notes in the circular buffer when the buffer is full by default. This is useful to keep instrumentation data of the beginning of a system boot. -- ``CONFIG_SCHED_INSTRUMENTATION_HIRES`` - - - If enabled, use higher resolution system timer for instrumentation. - After the configuration, rebuild the NuttX kernel and application. If the trace function is enabled, "``trace``" :doc:`../applications/nsh/builtin` will be available.