You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "Gary-Hobson (via GitHub)" <gi...@apache.org> on 2023/11/08 12:11:42 UTC

[PR] Note flatten [nuttx]

Gary-Hobson opened a new pull request, #11153:
URL: https://github.com/apache/nuttx/pull/11153

   ## Summary
   When we record data and dump data, they are all executed within the system, and there is no need to consider the issue of big or small endianness.
   
   ## Impact
   
   ## Testing
   sim:note
   


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


Re: [PR] Note flatten [nuttx]

Posted by "Gary-Hobson (via GitHub)" <gi...@apache.org>.
Gary-Hobson commented on code in PR #11153:
URL: https://github.com/apache/nuttx/pull/11153#discussion_r1387712727


##########
drivers/note/note_driver.c:
##########
@@ -580,8 +558,7 @@ static void note_record_taskname(pid_t pid, FAR const char *name)
       ti = (FAR struct note_taskname_info_s *)
             &g_note_taskname.buffer[g_note_taskname.head];
       ti->size = skiplen;
-      ti->pid[0] = 0xff;
-      ti->pid[1] = 0xff;
+      ti->pid = 0xffff;

Review Comment:
   Yes, it needs to be modified here
   But I think it would be better to change it to -1, which indicates an illegal pid



##########
drivers/note/note_driver.c:
##########
@@ -592,8 +569,7 @@ static void note_record_taskname(pid_t pid, FAR const char *name)
   ti = (FAR struct note_taskname_info_s *)
         &g_note_taskname.buffer[g_note_taskname.head];
   ti->size = tilen;
-  ti->pid[0] = pid & 0xff;
-  ti->pid[1] = (pid >> 8) & 0xff;
+  ti->pid = pid;

Review Comment:
   Here is the normal assignment of value to pid



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


Re: [PR] note: delete sched_note_flatten [nuttx]

Posted by "Gary-Hobson (via GitHub)" <gi...@apache.org>.
Gary-Hobson commented on code in PR #11153:
URL: https://github.com/apache/nuttx/pull/11153#discussion_r1390617952


##########
drivers/note/note_driver.c:
##########
@@ -1489,9 +1459,8 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip,
               length = sizeof(data);
             }
 
+          note->nst_ip = ip;

Review Comment:
   done



##########
drivers/note/noteram_driver.c:
##########
@@ -668,16 +650,15 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
   uint32_t sec;
   int ret;
 
-  noteram_dump_unflatten(&nsec, note->nc_systime_nsec, sizeof(nsec));
-  noteram_dump_unflatten(&sec, note->nc_systime_sec, sizeof(sec));
+  nsec = note->nc_systime_nsec;

Review Comment:
   done



##########
drivers/note/note_driver.c:
##########
@@ -1708,8 +1677,8 @@ void sched_note_vbprintf_ip(uint32_t tag, uintptr_t ip,
 
           length = SIZEOF_NOTE_BINARY(next);
 
+          note->nbi_ip = ip;

Review Comment:
   done



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


Re: [PR] Note flatten [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #11153:
URL: https://github.com/apache/nuttx/pull/11153#discussion_r1387921013


##########
drivers/note/note_driver.c:
##########
@@ -580,8 +558,7 @@ static void note_record_taskname(pid_t pid, FAR const char *name)
       ti = (FAR struct note_taskname_info_s *)
             &g_note_taskname.buffer[g_note_taskname.head];
       ti->size = skiplen;
-      ti->pid[0] = 0xff;
-      ti->pid[1] = 0xff;
+      ti->pid = 0xffff;

Review Comment:
   change to INVALID_PROCESS_ID



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


Re: [PR] note: delete sched_note_flatten [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #11153:
URL: https://github.com/apache/nuttx/pull/11153


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


Re: [PR] note: delete sched_note_flatten [nuttx]

Posted by "Gary-Hobson (via GitHub)" <gi...@apache.org>.
Gary-Hobson commented on code in PR #11153:
URL: https://github.com/apache/nuttx/pull/11153#discussion_r1390618014


##########
drivers/note/note_driver.c:
##########
@@ -1434,8 +1404,8 @@ void sched_note_event_ip(uint32_t tag, uintptr_t ip, uint8_t event,
               length = sizeof(data);
             }
 
+          note->nbi_ip = ip;

Review Comment:
   done



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


Re: [PR] Note flatten [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #11153:
URL: https://github.com/apache/nuttx/pull/11153#discussion_r1387089738


##########
drivers/note/note_driver.c:
##########
@@ -580,8 +558,7 @@ static void note_record_taskname(pid_t pid, FAR const char *name)
       ti = (FAR struct note_taskname_info_s *)
             &g_note_taskname.buffer[g_note_taskname.head];
       ti->size = skiplen;
-      ti->pid[0] = 0xff;
-      ti->pid[1] = 0xff;
+      ti->pid = 0xffff;

Review Comment:
   pid_t is defined as int in sys/types.h, so, shouldn't it be: ti->pid = INT_MAX; ?



##########
drivers/note/note_driver.c:
##########
@@ -592,8 +569,7 @@ static void note_record_taskname(pid_t pid, FAR const char *name)
   ti = (FAR struct note_taskname_info_s *)
         &g_note_taskname.buffer[g_note_taskname.head];
   ti->size = tilen;
-  ti->pid[0] = pid & 0xff;
-  ti->pid[1] = (pid >> 8) & 0xff;
+  ti->pid = pid;

Review Comment:
   Ditto



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


Re: [PR] note: delete sched_note_flatten [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #11153:
URL: https://github.com/apache/nuttx/pull/11153#discussion_r1390607108


##########
drivers/note/note_driver.c:
##########
@@ -1065,10 +1041,9 @@ void sched_note_premption(FAR struct tcb_s *tcb, bool locked)
       if (!formatted)
         {
           formatted = true;
+          note.npr_count = tcb->lockcount;

Review Comment:
   move after line 1045



##########
drivers/note/note_driver.c:
##########
@@ -1489,9 +1459,8 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip,
               length = sizeof(data);
             }
 
+          note->nst_ip = ip;

Review Comment:
   move after line 1463



##########
drivers/note/note_driver.c:
##########
@@ -1383,8 +1353,8 @@ void sched_note_string_ip(uint32_t tag, uintptr_t ip, FAR const char *buf)
               length = sizeof(data);
             }
 
+          note->nst_ip = ip;

Review Comment:
   move after line 1357



##########
drivers/note/note_driver.c:
##########
@@ -1434,8 +1404,8 @@ void sched_note_event_ip(uint32_t tag, uintptr_t ip, uint8_t event,
               length = sizeof(data);
             }
 
+          note->nbi_ip = ip;

Review Comment:
   move after line 1407



##########
drivers/note/note_driver.c:
##########
@@ -1708,8 +1677,8 @@ void sched_note_vbprintf_ip(uint32_t tag, uintptr_t ip,
 
           length = SIZEOF_NOTE_BINARY(next);
 
+          note->nbi_ip = ip;

Review Comment:
   move after line 1712



##########
drivers/note/noteram_driver.c:
##########
@@ -668,16 +650,15 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
   uint32_t sec;
   int ret;
 
-  noteram_dump_unflatten(&nsec, note->nc_systime_nsec, sizeof(nsec));
-  noteram_dump_unflatten(&sec, note->nc_systime_sec, sizeof(sec));
+  nsec = note->nc_systime_nsec;

Review Comment:
   merge to line 648-650



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