From 539a0338dd3b3c5fcc25cefcbb0f7633397a7c33 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 10 Sep 2020 20:59:38 -0700 Subject: [PATCH] sched: Refine the comment for SCHED_INSTRUMENTATION_EXTERNAL Signed-off-by: Xiang Xiao --- sched/Kconfig | 11 ++++++++++- sched/sched/Make.defs | 2 ++ sched/sched/sched_note.c | 2 -- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sched/Kconfig b/sched/Kconfig index 572d2ecfec..1ff89697d4 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -920,7 +920,16 @@ config SCHED_INSTRUMENTATION_EXTERNAL bool "System performance monitor endpoints are external" default n ---help--- - Monitor only CPUs in the bitset. Bit 0=CPU0, Bit1=CPU1, etc. + When this option is enabled, the board specific logic must implment all + callbacks listed in SCHED_INSTRUMENTATION, SCHED_INSTRUMENTATION_CSECTION, + SCHED_INSTRUMENTATION_SPINLOCKS, SCHED_INSTRUMENTATION_SYSCALL and + SCHED_INSTRUMENTATION_IRQHANDLER. Otherwise the common code will implement + these callbacks and packet the arguments into note_ struct. Then the board + -specific logic just need to implement one callback: + + void sched_note_add(FAR const void *note, size_t notelen); + + and send the data to the suitable transport hardware. config SCHED_INSTRUMENTATION_CPUSET hex "CPU bit set" diff --git a/sched/sched/Make.defs b/sched/sched/Make.defs index 57546acdd0..21dd5cc06e 100644 --- a/sched/sched/Make.defs +++ b/sched/sched/Make.defs @@ -90,8 +90,10 @@ CSRCS += sched_thistask.c endif ifeq ($(CONFIG_SCHED_INSTRUMENTATION),y) +ifeq ($(CONFIG_SCHED_INSTRUMENTATION_EXTERNAL),) CSRCS += sched_note.c endif +endif ifeq ($(CONFIG_SCHED_CRITMONITOR),y) CSRCS += sched_critmonitor.c diff --git a/sched/sched/sched_note.c b/sched/sched/sched_note.c index efbc57abee..71425b0694 100644 --- a/sched/sched/sched_note.c +++ b/sched/sched/sched_note.c @@ -36,7 +36,6 @@ #include "sched/sched.h" -#if !defined(CONFIG_SCHED_INSTRUMENTATION_EXTERNAL) /**************************************************************************** * Private Types ****************************************************************************/ @@ -611,4 +610,3 @@ void sched_note_irqhandler(int irq, FAR void *handler, bool enter) note_add((FAR const uint8_t *)¬e, sizeof(struct note_irqhandler_s)); } #endif -#endif /* CONFIG_SCHED_INSTRUMENTATION_EXTERNAL */