You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/12/14 03:22:26 UTC

[incubator-nuttx-apps] branch master updated: trace dump: add string and binary

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new cc8dd03  trace dump: add string and binary
cc8dd03 is described below

commit cc8dd03b9ce763540f5520e9fed6332efd2ec154
Author: zhanghu6 <zh...@xiaomi.com>
AuthorDate: Thu Nov 25 17:43:53 2021 +0800

    trace dump: add string and binary
    
    NOTE_DUMP_STRING
    NOTE_DUMP_BINARY
    
    And incubator-nuttx[trace: and sched note dump #4963] is together
---
 system/trace/trace_dump.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/system/trace/trace_dump.c b/system/trace/trace_dump.c
index 897bbdf..9e18c80 100644
--- a/system/trace/trace_dump.c
+++ b/system/trace/trace_dump.c
@@ -608,6 +608,39 @@ static int trace_dump_one(FAR FILE *out,
         break;
 #endif
 
+#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
+      case NOTE_DUMP_STRING:
+        {
+          FAR struct note_string_s *nst;
+
+          nst = (FAR struct note_string_s *)p;
+          trace_dump_header(out, note, ctx);
+          fprintf(out, "dump_string: %s\n",
+                  nst->nst_data);
+        }
+        break;
+
+      case NOTE_DUMP_BINARY:
+        {
+          FAR struct note_binary_s *nbi;
+          uint8_t count;
+          int i;
+
+          nbi = (FAR struct note_binary_s *)p;
+          trace_dump_header(out, note, ctx);
+          count = note->nc_length - sizeof(struct note_binary_s) + 1;
+          fprintf(out, "dump_binary: module=%u event=%u count=%u",
+                  nbi->nbi_module, nbi->nbi_event, count);
+          for (i = 0; i < count; i++)
+            {
+              fprintf(out, " 0x%x", nbi->nbi_data[i]);
+            }
+
+          fprintf(out, "\n");
+        }
+        break;
+#endif
+
       default:
         break;
     }