You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/01 09:02:36 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #1114: sched/note: add support of trace section mark

xiaoxiang781216 commented on a change in pull request #1114:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1114#discussion_r840246478



##########
File path: system/trace/trace_dump.c
##########
@@ -140,6 +142,7 @@ static void trace_dump_init_context(FAR struct trace_dump_context_s *ctx,
       ctx->cpu[cpu].current_state = TSTATE_TASK_RUNNING;
       ctx->cpu[cpu].current_pid = -1;
       ctx->cpu[cpu].next_pid = -1;
+      ctx->cpu[cpu].next_priority = -1;

Review comment:
       set current_priority to -1 too

##########
File path: system/trace/trace_dump.c
##########
@@ -657,6 +633,35 @@ static int trace_dump_one(FAR FILE *out,
  * Public Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: trace_dump_unflatten
+ ****************************************************************************/
+
+void trace_dump_unflatten(FAR void *dst, FAR uint8_t *src, size_t len)

Review comment:
       move to private section

##########
File path: system/trace/trace.h
##########
@@ -37,6 +37,20 @@ extern "C"
 #define EXTERN extern
 #endif
 
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+typedef enum
+{
+  TRACE_TYPE_LTTNG_KERNEL = 0,  /* Common Trace Format : Linux Kernel Trace */
+  TRACE_TYPE_GENERIC_CTF  = 1,  /* Common Trace Format : Generic CTF Trace */
+  TRACE_TYPE_LTTNG_UST    = 2,  /* Common Trace Format : LTTng UST Trace */
+  TRACE_TYPE_CUSTOM_TEXT  = 3,  /* Custom Text :         TmfGeneric */
+  TRACE_TYPE_CUSTOM_XML   = 4,  /* Custom XML :          Custom XML Log */
+  TRACE_TYPE_ANDROID      = 5,  /* Custom Format :       Android ATrace */

Review comment:
       should we remove the unsupported format now?

##########
File path: system/trace/trace.h
##########
@@ -83,12 +83,23 @@ bool trace_dump_get_overwrite(void);
 
 void trace_dump_set_overwrite(bool mode);
 
+/****************************************************************************
+ * Name: trace_dump_unflatten
+ *
+ * Description:
+ *   unflatten the dump buffer
+ *
+ ****************************************************************************/
+
+void trace_dump_unflatten(FAR void *dst, FAR uint8_t *src, size_t len);

Review comment:
       remove

##########
File path: system/sched_note/note_main.c
##########
@@ -103,22 +103,14 @@ static void dump_notes(size_t nread)
   while (offset < nread)
     {
       note    = (FAR struct note_common_s *)&g_note_buffer[offset];
-      pid     =  (pid_t)note->nc_pid[0] +
-                ((pid_t)note->nc_pid[1] << 8);
+      trace_dump_unflatten(&pid, note->note->nc_pid, sizeof(pid));

Review comment:
       merge into the next patch




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org