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 2022/04/01 03:33:53 UTC

[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5915: sched/note: add support of trace section mark

anchao commented on a change in pull request #5915:
URL: https://github.com/apache/incubator-nuttx/pull/5915#discussion_r840203982



##########
File path: include/nuttx/sched_note.h
##########
@@ -105,16 +105,32 @@
   memset((s), 0, sizeof(struct note_filter_irq_s))
 #endif
 
-/* Note dump module tag definitions */
-
 #ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
-#  define NOTE_MODULE(a, b, c, d)  \
-  ((uint32_t)((a) & 0xff)        | \
-  ((uint32_t)((b) & 0xff) << 8)  | \
-  ((uint32_t)((c) & 0xff) << 16) | \
-  ((uint32_t)((d) & 0xff) << 24))
+#  define SCHED_NOTE_IP \
+          ({__label__ sched_note_here; sched_note_here: (uintptr_t)&&sched_note_here;})

Review comment:
       This seems dose not to work, __label__ can ensure the uniqueness of the current label, it can be guaranteed that the definition will not be duplicate in the code scope:
   `: error: duplicate label ‘sched_note_here’`
   this practice is very common, you can see that the linux kernel uses this extension a lot
   https://github.com/torvalds/linux/blob/master/include/linux/instruction_pointer.h#L6




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