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 2020/10/28 07:08:35 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2142: Add task name record for task trace

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



##########
File path: drivers/note/noteram_driver.c
##########
@@ -63,6 +64,26 @@ struct noteram_info_s
   uint8_t ni_buffer[CONFIG_DRIVER_NOTERAM_BUFSIZE];
 };
 
+#ifdef CONFIG_SCHED_INSTRUMENTATION_RECORD_TASKNAME
+struct noteram_taskname_info_s
+{
+  pid_t pid;
+  uint16_t offset;
+};
+
+struct noteram_taskname_s
+{
+  uint16_t buffer_used;
+  uint16_t n_tasks;
+  union
+    {
+      struct noteram_taskname_info_s task[0];
+      char buffer[CONFIG_DRIVER_NOTERAM_TASKNAME_BUFSIZE];

Review comment:
       can trace tool recovery the name from NOTE_START/NOTE_STOP info?

##########
File path: sched/sched/sched_note.c
##########
@@ -405,6 +405,10 @@ void sched_note_start(FAR struct tcb_s *tcb)
   strncpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
 
   length = SIZEOF_NOTE_START(namelen + 1);
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_RECORD_TASKNAME
+  sched_note_add_taskname(tcb->pid, tcb->name);

Review comment:
       Why need add new api sched_note_add_taskname? we can check NOTE_START in sched_note_add and then extract and save the name.




----------------------------------------------------------------
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.

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