xiaoxiang781216 commented on code in PR #21128:
URL: https://github.com/apache/nuttx/pull/21128#discussion_r4431327842


##########
drivers/syslog/syslog.h:
##########
@@ -53,6 +59,58 @@ const
 #endif
 g_syslog_channel[CONFIG_SYSLOG_MAX_CHANNELS];
 
+/****************************************************************************
+ * Inline Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: syslog_add_openlog
+ *
+ * Description:
+ *   Output the ident that the task group set with openlog() and, with
+ *   LOG_PID, its process ID: "ident: " or "ident[pid]: ".  The caller is
+ *   in a syslog() call of that task group, so its task information is in
+ *   memory.  openlog() does not lock out this reader: the ident is read up
+ *   to its maximum length.  Nothing in an interrupt handler.
+ *
+ ****************************************************************************/
+
+static inline int syslog_add_openlog(FAR struct lib_outstream_s *stream)
+{
+  FAR struct task_info_s *info;
+  FAR struct tcb_s *tcb;
+  int option;
+
+  if (up_interrupt_context())
+    {
+      return 0;
+    }
+
+  tcb = nxsched_self();
+  if (tcb == NULL || tcb->group == NULL || tcb->group->tg_info == NULL)
+    {
+      return 0;
+    }
+
+  info   = tcb->group->tg_info;
+  option = info->ta_openlog.ol_option;
+  if ((option & LOG_PID) != 0)

Review Comment:
   ok, but why not merge to the same place where tid output?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to