YuuichiNakamura opened a new pull request #2142:
URL: https://github.com/apache/incubator-nuttx/pull/2142


   ## Summary
   Currently, trace dump can show the task name of only newly created task 
because only `struct note_start_s` has the task name information.
   This PR adds the interface to record the task name corresponding to the 
given pid which is used while instrumentation.
   By this extension, trace dump command can show all task names.
   
   Before:
   ```
   <noname>-3   [0]   2.300000000: sys_sched_unlock()
   <noname>-3   [0]   2.300000000: sys_sched_unlock -> 0x0
   <noname>-3   [0]   2.300000000: sys_nxsched_get_streams()
   <noname>-3   [0]   2.300000000: sys_nxsched_get_streams -> 0xd029edc
   <noname>-3   [0]   2.300000000: sys_ioctl(arg0: 0x1, arg1: 0x118, arg2: 0x5)
   <noname>-3   [0]   2.300000000: sys_ioctl -> 0xffffffff
   <noname>-3   [0]   2.300000000: sys_waitpid(arg0: 0x5, arg1: 0xd02a6e4, 
arg2: 0x4)
   <noname>-3   [0]   2.300000000: sched_switch: prev_comm=<noname> prev_pid=3 
prev_state=S ==> next_comm=trace next_pid=5
      trace-5   [0]   2.300000000: irq_handler_entry: irq=11
      trace-5   [0]   2.300000000: irq_handler_exit: irq=11
      trace-5   [0]   2.300000000: sys_open(arg0: 0xd01aa0c, arg1: 0x0, arg2: 
0x1)
      trace-5   [0]   2.300000000: sys_open -> 0x3
      trace-5   [0]   2.300000000: sys_nxsched_get_streams()
      trace-5   [0]   2.300000000: sys_nxsched_get_streams -> 0xd02bfcc
      trace-5   [0]   2.300000000: sys_ioctl(arg0: 0x3, arg1: 0x2c01, arg2: 
0xd02c888)
      trace-5   [0]   2.300000000: sys_ioctl -> 0x0
      trace-5   [0]   2.300000000: sys_ioctl(arg0: 0x3, arg1: 0x2c02, arg2: 
0xd02c888)
   ```
   
   After:
   ```
       init-3   [0]   1.660000000: sys_sched_unlock -> 0x0
       init-3   [0]   1.660000000: sys_nxsched_get_streams()
       init-3   [0]   1.660000000: sys_nxsched_get_streams -> 0xd029edc
       init-3   [0]   1.660000000: sys_ioctl(arg0: 0x1, arg1: 0x118, arg2: 0x5)
       init-3   [0]   1.660000000: sys_ioctl -> 0xffffffff
       init-3   [0]   1.660000000: sys_waitpid(arg0: 0x5, arg1: 0xd02a6e4, 
arg2: 0x4)
       init-3   [0]   1.660000000: sched_switch: prev_comm=init prev_pid=3 
prev_state=S ==> next_comm=trace next_pid=5
      trace-5   [0]   1.660000000: irq_handler_entry: irq=11
      trace-5   [0]   1.660000000: irq_handler_exit: irq=11
      trace-5   [0]   1.660000000: sys_open(arg0: 0xd01ab44, arg1: 0x0, arg2: 
0x1)
      trace-5   [0]   1.660000000: sys_open -> 0x3
      trace-5   [0]   1.660000000: sys_nxsched_get_streams()
      trace-5   [0]   1.660000000: sys_nxsched_get_streams -> 0xd02bfcc
      trace-5   [0]   1.660000000: sys_ioctl(arg0: 0x3, arg1: 0x2c01, arg2: 
0xd02c888)
      trace-5   [0]   1.660000000: sys_ioctl -> 0x0
      trace-5   [0]   1.660000000: sys_ioctl(arg0: 0x3, arg1: 0x2c02, arg2: 
0xd02c888)
   ```
   
   ## Impact
   - New kernel configuration `SCHED_INSTRUMENTATION_RECORD_TASKNAME` and 
`DRIVER_NOTERAM_TASKNAME_BUFSIZE` are added.
   - New note driver interface `sched_note_add_taskname` is added.
   
   ## Testing
   Tested with spresense:smp
   
   


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