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



##########
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:
       We might have no need to call sched_note_add_taskname() in 
sched_note_start() because trace dump already retrieves the task name in 
NOTE_START.
   But it still needs in sched_note_stop/suspend/resume() because we have no 
way to get the name of the task which is already exists before the trace 
starts. It is the reason I have added new API.
   
   As another solution, it can be solved by adding char name[] member in struct 
note_stop/suspend/resume_s like note_start_s. But it increases the size of 
trace data because each context switch records the task name and I think it is 
not a good idea.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to