mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
note:support filter for each note channel
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
This commit is contained in:
parent
c018be66bd
commit
7aa1871664
11 changed files with 459 additions and 213 deletions
|
|
@ -106,22 +106,6 @@
|
|||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
struct note_filter_s
|
||||
{
|
||||
struct note_filter_mode_s mode;
|
||||
# ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
|
||||
struct note_filter_tag_s tag_mask;
|
||||
# endif
|
||||
# ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
|
||||
struct note_filter_irq_s irq_mask;
|
||||
# endif
|
||||
# ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
|
||||
struct note_filter_syscall_s syscall_mask;
|
||||
# endif
|
||||
};
|
||||
#endif
|
||||
|
||||
struct note_startalloc_s
|
||||
{
|
||||
struct note_common_s nsa_cmn; /* Common note parameters */
|
||||
|
|
@ -157,16 +141,6 @@ struct note_taskname_s
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
static struct note_filter_s g_note_filter =
|
||||
{
|
||||
{
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE
|
||||
#ifdef CONFIG_SMP
|
||||
, (cpu_set_t)CONFIG_SCHED_INSTRUMENTATION_CPUSET
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
|
||||
static unsigned int g_note_disabled_irq_nest[CONFIG_SMP_NCPUS];
|
||||
#endif
|
||||
|
|
@ -251,17 +225,17 @@ static void note_common(FAR struct tcb_s *tcb,
|
|||
* Check whether the instrumentation is enabled.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
* driver - The channel of note driver
|
||||
*
|
||||
* Returned Value:
|
||||
* True is returned if the instrumentation is enabled.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline int note_isenabled(void)
|
||||
static inline int note_isenabled(FAR struct note_driver_s *driver)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
if (!(g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_ENABLE))
|
||||
if (!(driver->filter.mode.flag & NOTE_FILTER_MODE_FLAG_ENABLE))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -269,7 +243,7 @@ static inline int note_isenabled(void)
|
|||
#ifdef CONFIG_SMP
|
||||
/* Ignore notes that are not in the set of monitored CPUs */
|
||||
|
||||
if (CPU_ISSET(this_cpu(), &g_note_filter.mode.cpuset) == 0)
|
||||
if (CPU_ISSET(this_cpu(), &driver->filter.mode.cpuset) == 0)
|
||||
{
|
||||
/* Not in the set of monitored CPUs. Do not log the note. */
|
||||
|
||||
|
|
@ -288,7 +262,7 @@ static inline int note_isenabled(void)
|
|||
* Check whether the switch instrumentation is enabled.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
* driver - The channel of note driver
|
||||
*
|
||||
* Returned Value:
|
||||
* True is returned if the instrumentation is enabled.
|
||||
|
|
@ -296,17 +270,17 @@ static inline int note_isenabled(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
|
||||
static inline int note_isenabled_switch(void)
|
||||
static inline int note_isenabled_switch(FAR struct note_driver_s *driver)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
if (!note_isenabled())
|
||||
if (!note_isenabled(driver))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If the switch trace is disabled, do nothing. */
|
||||
|
||||
if ((g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_SWITCH) == 0)
|
||||
if ((driver->filter.mode.flag & NOTE_FILTER_MODE_FLAG_SWITCH) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -323,6 +297,7 @@ static inline int note_isenabled_switch(void)
|
|||
* Check whether the syscall instrumentation is enabled.
|
||||
*
|
||||
* Input Parameters:
|
||||
* driver - The channel of note driver
|
||||
* nr - syscall number
|
||||
*
|
||||
* Returned Value:
|
||||
|
|
@ -331,10 +306,11 @@ static inline int note_isenabled_switch(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
|
||||
static inline int note_isenabled_syscall(int nr)
|
||||
static inline int note_isenabled_syscall(FAR struct note_driver_s *driver,
|
||||
int nr)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
if (!note_isenabled())
|
||||
if (!note_isenabled(driver))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -361,9 +337,9 @@ static inline int note_isenabled_syscall(int nr)
|
|||
* do nothing.
|
||||
*/
|
||||
|
||||
if (!(g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_SYSCALL) ||
|
||||
if (!(driver->filter.mode.flag & NOTE_FILTER_MODE_FLAG_SYSCALL) ||
|
||||
NOTE_FILTER_SYSCALLMASK_ISSET(nr - CONFIG_SYS_RESERVED,
|
||||
&g_note_filter.syscall_mask))
|
||||
&driver->filter.syscall_mask))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -380,6 +356,7 @@ static inline int note_isenabled_syscall(int nr)
|
|||
* Check whether the interrupt handler instrumentation is enabled.
|
||||
*
|
||||
* Input Parameters:
|
||||
* driver - The channel of note driver
|
||||
* irq - IRQ number
|
||||
* enter - interrupt enter/leave flag
|
||||
*
|
||||
|
|
@ -389,10 +366,11 @@ static inline int note_isenabled_syscall(int nr)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
|
||||
static inline int note_isenabled_irq(int irq, bool enter)
|
||||
static inline int note_isenabled_irq(FAR struct note_driver_s *driver,
|
||||
int irq, bool enter)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
if (!note_isenabled())
|
||||
if (!note_isenabled(driver))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -401,8 +379,8 @@ static inline int note_isenabled_irq(int irq, bool enter)
|
|||
* subsequent syscall traces until leaving the interrupt handler
|
||||
*/
|
||||
|
||||
if (!(g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_IRQ) ||
|
||||
NOTE_FILTER_IRQMASK_ISSET(irq, &g_note_filter.irq_mask))
|
||||
if (!(driver->filter.mode.flag & NOTE_FILTER_MODE_FLAG_IRQ) ||
|
||||
NOTE_FILTER_IRQMASK_ISSET(irq, &driver->filter.irq_mask))
|
||||
{
|
||||
int cpu = this_cpu();
|
||||
|
||||
|
|
@ -430,6 +408,7 @@ static inline int note_isenabled_irq(int irq, bool enter)
|
|||
* Check whether the dump instrumentation is enabled.
|
||||
*
|
||||
* Input Parameters:
|
||||
* driver - The channel of note driver
|
||||
* tag: The dump instrumentation tag
|
||||
*
|
||||
* Returned Value:
|
||||
|
|
@ -438,18 +417,19 @@ static inline int note_isenabled_irq(int irq, bool enter)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
|
||||
static inline int note_isenabled_dump(uint32_t tag)
|
||||
static inline int note_isenabled_dump(FAR struct note_driver_s *driver,
|
||||
uint32_t tag)
|
||||
{
|
||||
# ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
if (!note_isenabled())
|
||||
if (!note_isenabled(driver))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If the dump trace is disabled, do nothing. */
|
||||
|
||||
if (!(g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_DUMP) ||
|
||||
NOTE_FILTER_TAGMASK_ISSET(tag, &g_note_filter.tag_mask))
|
||||
if (!(driver->filter.mode.flag & NOTE_FILTER_MODE_FLAG_DUMP) ||
|
||||
NOTE_FILTER_TAGMASK_ISSET(tag, &driver->filter.tag_mask))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -614,13 +594,13 @@ void sched_note_start(FAR struct tcb_s *tcb)
|
|||
int namelen;
|
||||
#endif
|
||||
|
||||
if (!note_isenabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_start(*driver, tcb))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -671,13 +651,13 @@ void sched_note_stop(FAR struct tcb_s *tcb)
|
|||
note_record_taskname(tcb->pid, tcb->name);
|
||||
#endif
|
||||
|
||||
if (!note_isenabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_stop(*driver, tcb))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -709,13 +689,13 @@ void sched_note_suspend(FAR struct tcb_s *tcb)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled_switch())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_switch(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_suspend(*driver, tcb))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -748,13 +728,13 @@ void sched_note_resume(FAR struct tcb_s *tcb)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled_switch())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_switch(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_resume(*driver, tcb))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -787,13 +767,13 @@ void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_cpu_start(*driver, tcb, cpu))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -826,13 +806,13 @@ void sched_note_cpu_started(FAR struct tcb_s *tcb)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_cpu_started(*driver, tcb))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -864,13 +844,13 @@ void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled_switch())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_switch(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_cpu_pause(*driver, tcb, cpu))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -903,13 +883,13 @@ void sched_note_cpu_paused(FAR struct tcb_s *tcb)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled_switch())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_switch(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_cpu_paused(*driver, tcb))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -941,13 +921,13 @@ void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled_switch())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_switch(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_cpu_resume(*driver, tcb, cpu))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -980,13 +960,13 @@ void sched_note_cpu_resumed(FAR struct tcb_s *tcb)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled_switch())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_switch(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_cpu_resumed(*driver, tcb))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1021,13 +1001,13 @@ void sched_note_premption(FAR struct tcb_s *tcb, bool locked)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_premption(*driver, tcb, locked))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1062,13 +1042,13 @@ void sched_note_csection(FAR struct tcb_s *tcb, bool enter)
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_csection(*driver, tcb, enter))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1122,13 +1102,13 @@ void sched_note_spinlock(FAR struct tcb_s *tcb,
|
|||
FAR struct note_driver_s **driver;
|
||||
bool formatted = false;
|
||||
|
||||
if (!note_isenabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_spinlock(*driver, tcb, spinlock, type))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1187,26 +1167,40 @@ void sched_note_syscall_enter(int nr, int argc, ...)
|
|||
FAR struct tcb_s *tcb = this_task();
|
||||
unsigned int length;
|
||||
uintptr_t arg;
|
||||
va_list ap;
|
||||
int argc_bak = argc;
|
||||
int i;
|
||||
|
||||
if (!note_isenabled_syscall(nr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
if (!(g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_SYSCALL_ARGS))
|
||||
{
|
||||
argc = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
va_start(ap, argc);
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
va_list copy;
|
||||
|
||||
if (!note_isenabled_syscall(*driver, nr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
if (!(*driver->filter.mode.flag & NOTE_FILTER_MODE_FLAG_SYSCALL_ARGS))
|
||||
{
|
||||
if (formatted && argc != 0)
|
||||
{
|
||||
formatted = false;
|
||||
}
|
||||
|
||||
argc = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (formatted && argc == 0)
|
||||
{
|
||||
formatted = false;
|
||||
}
|
||||
|
||||
argc = argc_bak;
|
||||
}
|
||||
#endif
|
||||
|
||||
va_copy(copy, ap);
|
||||
if (note_syscall_enter(*driver, nr, argc, ©))
|
||||
{
|
||||
|
|
@ -1258,13 +1252,13 @@ void sched_note_syscall_leave(int nr, uintptr_t result)
|
|||
bool formatted = false;
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
|
||||
if (!note_isenabled_syscall(nr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_syscall(*driver, nr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_syscall_leave(*driver, nr, result))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1303,13 +1297,13 @@ void sched_note_irqhandler(int irq, FAR void *handler, bool enter)
|
|||
bool formatted = false;
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
|
||||
if (!note_isenabled_irq(irq, enter))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_irq(*driver, irq, enter))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_irqhandler(*driver, irq, handler, enter))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1381,15 +1375,13 @@ void sched_note_heap(uint8_t event, FAR void *heap, FAR void *mem,
|
|||
bool formatted = false;
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
if (!note_isenabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled(*driver))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_heap(*driver, event, heap, mem, size, used))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1428,13 +1420,13 @@ void sched_note_event_ip(uint32_t tag, uintptr_t ip, uint8_t event,
|
|||
unsigned int length;
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
|
||||
if (!note_isenabled_dump(tag))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_dump(*driver, tag))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_event(*driver, ip, event, buf, len))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1478,13 +1470,13 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
|
|||
size_t length = 0;
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
|
||||
if (!note_isenabled_dump(tag))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (!note_isenabled_dump(*driver, tag))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (note_vprintf(*driver, ip, fmt, va))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1778,21 +1770,46 @@ void sched_note_printf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sched_note_filter_mode(FAR struct note_filter_mode_s *oldm,
|
||||
FAR struct note_filter_mode_s *newm)
|
||||
void sched_note_filter_mode(FAR struct note_filter_named_mode_s *oldm,
|
||||
FAR struct note_filter_named_mode_s *newm)
|
||||
{
|
||||
irqstate_t irq_mask;
|
||||
FAR struct note_driver_s **driver;
|
||||
|
||||
irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
|
||||
|
||||
if (oldm != NULL)
|
||||
{
|
||||
*oldm = g_note_filter.mode;
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (oldm->name[0] == '\0')
|
||||
{
|
||||
oldm->mode = (*driver)->filter.mode;
|
||||
strlcpy(oldm->name, (*driver)->name, NAME_MAX);
|
||||
break;
|
||||
}
|
||||
else if (strcmp((*driver)->name, oldm->name) == 0)
|
||||
{
|
||||
oldm->mode = (*driver)->filter.mode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (newm != NULL)
|
||||
{
|
||||
g_note_filter.mode = *newm;
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (newm->name[0] == '\0')
|
||||
{
|
||||
(*driver)->filter.mode = newm->mode;
|
||||
}
|
||||
else if (0 == strcmp((*driver)->name, newm->name))
|
||||
{
|
||||
(*driver)->filter.mode = newm->mode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
|
||||
|
|
@ -1819,25 +1836,46 @@ void sched_note_filter_mode(FAR struct note_filter_mode_s *oldm,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
|
||||
void sched_note_filter_syscall(FAR struct note_filter_syscall_s *oldf,
|
||||
FAR struct note_filter_syscall_s *newf)
|
||||
void sched_note_filter_syscall(FAR struct note_filter_named_syscall_s *oldf,
|
||||
FAR struct note_filter_named_syscall_s *newf)
|
||||
{
|
||||
irqstate_t irq_mask;
|
||||
FAR struct note_driver_s **driver;
|
||||
|
||||
irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
|
||||
|
||||
if (oldf != NULL)
|
||||
{
|
||||
/* Return the current filter setting */
|
||||
|
||||
*oldf = g_note_filter.syscall_mask;
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (oldf->name[0] == '\0')
|
||||
{
|
||||
oldf->syscall_mask = (*driver)->filter.syscall_mask;
|
||||
strlcpy(oldf->name, (*driver)->name, NAME_MAX);
|
||||
break;
|
||||
}
|
||||
else if (strcmp((*driver)->name, oldf->name) == 0)
|
||||
{
|
||||
oldf->syscall_mask = (*driver)->filter.syscall_mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (newf != NULL)
|
||||
{
|
||||
/* Replace the syscall filter mask by the provided setting */
|
||||
|
||||
g_note_filter.syscall_mask = *newf;
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (newf->name[0] == '\0')
|
||||
{
|
||||
(*driver)->filter.syscall_mask = newf->syscall_mask;
|
||||
}
|
||||
else if (0 == strcmp((*driver)->name, newf->name))
|
||||
{
|
||||
(*driver)->filter.syscall_mask = newf->syscall_mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
|
||||
|
|
@ -1865,25 +1903,46 @@ void sched_note_filter_syscall(FAR struct note_filter_syscall_s *oldf,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
|
||||
void sched_note_filter_irq(FAR struct note_filter_irq_s *oldf,
|
||||
FAR struct note_filter_irq_s *newf)
|
||||
void sched_note_filter_irq(FAR struct note_filter_named_irq_s *oldf,
|
||||
FAR struct note_filter_named_irq_s *newf)
|
||||
{
|
||||
irqstate_t irq_mask;
|
||||
FAR struct note_driver_s **driver;
|
||||
|
||||
irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
|
||||
|
||||
if (oldf != NULL)
|
||||
{
|
||||
/* Return the current filter setting */
|
||||
|
||||
*oldf = g_note_filter.irq_mask;
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (oldf->name[0] == '\0')
|
||||
{
|
||||
oldf->irq_mask = (*driver)->filter.irq_mask;
|
||||
strlcpy(oldf->name, (*driver)->name, NAME_MAX);
|
||||
break;
|
||||
}
|
||||
else if (strcmp((*driver)->name, oldf->name) == 0)
|
||||
{
|
||||
oldf->irq_mask = (*driver)->filter.irq_mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (newf != NULL)
|
||||
{
|
||||
/* Replace the syscall filter mask by the provided setting */
|
||||
|
||||
g_note_filter.irq_mask = *newf;
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (newf->name[0] == '\0')
|
||||
{
|
||||
(*driver)->filter.irq_mask = newf->irq_mask;
|
||||
}
|
||||
else if (0 == strcmp((*driver)->name, newf->name))
|
||||
{
|
||||
(*driver)->filter.irq_mask = newf->irq_mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
|
||||
|
|
@ -1911,25 +1970,46 @@ void sched_note_filter_irq(FAR struct note_filter_irq_s *oldf,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
|
||||
void sched_note_filter_tag(FAR struct note_filter_tag_s *oldf,
|
||||
FAR struct note_filter_tag_s *newf)
|
||||
void sched_note_filter_tag(FAR struct note_filter_named_tag_s *oldf,
|
||||
FAR struct note_filter_named_tag_s *newf)
|
||||
{
|
||||
irqstate_t falgs;
|
||||
FAR struct note_driver_s **driver;
|
||||
|
||||
falgs = spin_lock_irqsave_wo_note(&g_note_lock);
|
||||
|
||||
if (oldf != NULL)
|
||||
{
|
||||
/* Return the current filter setting */
|
||||
|
||||
*oldf = g_note_filter.tag_mask;
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (oldf->name[0] == '\0')
|
||||
{
|
||||
oldf->tag_mask = (*driver)->filter.tag_mask;
|
||||
strlcpy(oldf->name, (*driver)->name, NAME_MAX);
|
||||
break;
|
||||
}
|
||||
else if (strcmp((*driver)->name, oldf->name) == 0)
|
||||
{
|
||||
oldf->tag_mask = (*driver)->filter.tag_mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (newf != NULL)
|
||||
{
|
||||
/* Replace the dump filter mask by the provided setting */
|
||||
|
||||
g_note_filter.tag_mask = *newf;
|
||||
for (driver = g_note_drivers; *driver; driver++)
|
||||
{
|
||||
if (newf->name[0] == '\0')
|
||||
{
|
||||
(*driver)->filter.tag_mask = newf->tag_mask;
|
||||
}
|
||||
else if (0 == strcmp((*driver)->name, newf->name))
|
||||
{
|
||||
(*driver)->filter.tag_mask = newf->tag_mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore_wo_note(&g_note_lock, falgs);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int notectl_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int notectl_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -62,7 +62,7 @@ static const struct file_operations g_notectl_fops =
|
|||
* Name: notectl_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int notectl_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
static int notectl_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
int ret = -ENOSYS;
|
||||
|
||||
|
|
@ -77,7 +77,8 @@ static int notectl_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case NOTECTL_GETMODE:
|
||||
{
|
||||
struct note_filter_mode_s *mode = (struct note_filter_mode_s *)arg;
|
||||
FAR struct note_filter_named_mode_s *mode =
|
||||
(FAR struct note_filter_named_mode_s *)arg;
|
||||
|
||||
if (mode == NULL)
|
||||
{
|
||||
|
|
@ -98,7 +99,8 @@ static int notectl_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case NOTECTL_SETMODE:
|
||||
{
|
||||
struct note_filter_mode_s *mode = (struct note_filter_mode_s *)arg;
|
||||
FAR struct note_filter_named_mode_s *mode =
|
||||
(FAR struct note_filter_named_mode_s *)arg;
|
||||
|
||||
if (mode == NULL)
|
||||
{
|
||||
|
|
@ -120,8 +122,8 @@ static int notectl_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case NOTECTL_GETSYSCALLFILTER:
|
||||
{
|
||||
struct note_filter_syscall_s *filter;
|
||||
filter = (struct note_filter_syscall_s *)arg;
|
||||
FAR struct note_filter_named_syscall_s *filter;
|
||||
filter = (FAR struct note_filter_named_syscall_s *)arg;
|
||||
|
||||
if (filter == NULL)
|
||||
{
|
||||
|
|
@ -142,8 +144,8 @@ static int notectl_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case NOTECTL_SETSYSCALLFILTER:
|
||||
{
|
||||
struct note_filter_syscall_s *filter;
|
||||
filter = (struct note_filter_syscall_s *)arg;
|
||||
FAR struct note_filter_named_syscall_s *filter;
|
||||
filter = (FAR struct note_filter_named_syscall_s *)arg;
|
||||
|
||||
if (filter == NULL)
|
||||
{
|
||||
|
|
@ -166,8 +168,8 @@ static int notectl_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case NOTECTL_GETIRQFILTER:
|
||||
{
|
||||
struct note_filter_irq_s *filter;
|
||||
filter = (struct note_filter_irq_s *)arg;
|
||||
FAR struct note_filter_named_irq_s *filter;
|
||||
filter = (FAR struct note_filter_named_irq_s *)arg;
|
||||
|
||||
if (filter == NULL)
|
||||
{
|
||||
|
|
@ -189,8 +191,8 @@ static int notectl_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case NOTECTL_SETIRQFILTER:
|
||||
{
|
||||
struct note_filter_irq_s *filter;
|
||||
filter = (struct note_filter_irq_s *)arg;
|
||||
FAR struct note_filter_named_irq_s *filter;
|
||||
filter = (FAR struct note_filter_named_irq_s *)arg;
|
||||
|
||||
if (filter == NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -124,6 +124,17 @@ static const struct note_driver_ops_s g_notelog_ops =
|
|||
|
||||
struct note_driver_s g_notelog_driver =
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
"log",
|
||||
{
|
||||
{
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
|
||||
# ifdef CONFIG_SMP
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET
|
||||
# endif
|
||||
},
|
||||
},
|
||||
#endif
|
||||
&g_notelog_ops,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,20 @@ static const struct note_driver_ops_s g_noteram_ops =
|
|||
|
||||
struct noteram_driver_s g_noteram_driver =
|
||||
{
|
||||
{&g_noteram_ops},
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
"ram",
|
||||
{
|
||||
{
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
|
||||
# ifdef CONFIG_SMP
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET
|
||||
# endif
|
||||
},
|
||||
},
|
||||
#endif
|
||||
&g_noteram_ops
|
||||
},
|
||||
g_ramnote_buffer,
|
||||
CONFIG_DRIVERS_NOTERAM_BUFSIZE,
|
||||
#ifdef CONFIG_DRIVERS_NOTERAM_DEFAULT_NOOVERWRITE
|
||||
|
|
@ -1339,17 +1352,35 @@ FAR struct note_driver_s *
|
|||
noteram_initialize(FAR const char *devpath, size_t bufsize, bool overwrite)
|
||||
{
|
||||
FAR struct noteram_driver_s *drv;
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
size_t len = strlen(devpath) + 1;
|
||||
#else
|
||||
size_t len = 0;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
drv = kmm_malloc(sizeof(*drv) + bufsize);
|
||||
drv = kmm_malloc(sizeof(*drv) + len + bufsize);
|
||||
if (drv == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
|
||||
memcpy(drv + 1, devpath, len);
|
||||
drv->driver.name = (FAR const char *)(drv + 1);
|
||||
drv->driver.filter.mode.flag =
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE;
|
||||
|
||||
# ifdef CONFIG_SMP
|
||||
drv->driver.filter.mode.cpuset =
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
drv->driver.ops = &g_noteram_ops;
|
||||
drv->ni_bufsize = bufsize;
|
||||
drv->ni_buffer = (FAR uint8_t *)(drv + 1);
|
||||
drv->ni_buffer = (FAR uint8_t *)(drv + 1) + len;
|
||||
drv->ni_overwrite = overwrite;
|
||||
drv->ni_head = 0;
|
||||
drv->ni_tail = 0;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,20 @@ static const struct note_driver_ops_s g_noterpmsg_ops =
|
|||
|
||||
struct noterpmsg_driver_s g_noterpmsg_driver =
|
||||
{
|
||||
{&g_noterpmsg_ops},
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
"rpmsg",
|
||||
{
|
||||
{
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
|
||||
# ifdef CONFIG_SMP
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET
|
||||
# endif
|
||||
},
|
||||
},
|
||||
#endif
|
||||
&g_noterpmsg_ops
|
||||
},
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -150,7 +150,20 @@ static const struct note_driver_ops_s g_notesnap_ops =
|
|||
|
||||
static struct notesnap_s g_notesnap =
|
||||
{
|
||||
{&g_notesnap_ops}
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
"snap",
|
||||
{
|
||||
{
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
|
||||
# ifdef CONFIG_SMP
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET
|
||||
# endif
|
||||
},
|
||||
},
|
||||
#endif
|
||||
&g_notesnap_ops
|
||||
}
|
||||
};
|
||||
|
||||
static FAR const char *g_notesnap_type[] =
|
||||
|
|
|
|||
|
|
@ -65,6 +65,17 @@ static const struct note_driver_ops_s g_notestream_ops =
|
|||
struct notestream_driver_s g_notestream_lowerout =
|
||||
{
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
"lowerout",
|
||||
{
|
||||
{
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
|
||||
# ifdef CONFIG_SMP
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET
|
||||
# endif
|
||||
},
|
||||
},
|
||||
#endif
|
||||
&g_notestream_ops
|
||||
},
|
||||
&g_lowoutstream
|
||||
|
|
@ -91,14 +102,32 @@ static void notestream_add(FAR struct note_driver_s *drv,
|
|||
int notefile_register(FAR const char *filename)
|
||||
{
|
||||
FAR struct notestream_file_s *notefile;
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
size_t len = strlen(filename) + 1;
|
||||
#else
|
||||
size_t len = 0;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
notefile = kmm_zalloc(sizeof(struct notestream_file_s));
|
||||
notefile = kmm_zalloc(sizeof(struct notestream_file_s) + len);
|
||||
if (notefile == NULL)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
memcpy(notefile + 1, filename, len);
|
||||
notefile->driver.driver.name = (FAR const char *)(notefile + 1);
|
||||
notefile->driver.driver.filter.mode.flag =
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE;
|
||||
|
||||
# ifdef CONFIG_SMP
|
||||
notefile->driver.driver.filter.mode.cpuset =
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
notefile->driver.stream = ¬efile->filestream.common;
|
||||
ret = file_open(¬efile->file, filename, O_WRONLY);
|
||||
if (ret < 0)
|
||||
|
|
|
|||
|
|
@ -55,6 +55,17 @@ static const struct note_driver_ops_s g_notertt_ops =
|
|||
struct notertt_s g_notertt =
|
||||
{
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
"rtt",
|
||||
{
|
||||
{
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
|
||||
# ifdef CONFIG_SMP
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET
|
||||
# endif
|
||||
},
|
||||
},
|
||||
#endif
|
||||
&g_notertt_ops
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -45,9 +45,6 @@ struct note_sysview_driver_s
|
|||
{
|
||||
struct note_driver_s driver;
|
||||
unsigned int irq[CONFIG_SMP_NCPUS];
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
|
||||
struct note_filter_syscall_s syscall_marker;
|
||||
#endif
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -144,6 +141,17 @@ static const struct note_driver_ops_s g_note_sysview_ops =
|
|||
static struct note_sysview_driver_s g_note_sysview_driver =
|
||||
{
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
"sysview",
|
||||
{
|
||||
{
|
||||
CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
|
||||
# ifdef CONFIG_SMP
|
||||
CONFIG_SCHED_INSTRUMENTATION_CPUSET
|
||||
# endif
|
||||
},
|
||||
},
|
||||
#endif
|
||||
&g_note_sysview_ops
|
||||
}
|
||||
};
|
||||
|
|
@ -307,7 +315,8 @@ static void note_sysview_syscall_enter(FAR struct note_driver_s *drv, int nr,
|
|||
|
||||
/* Set the name marker if the current syscall nr is not active */
|
||||
|
||||
if (NOTE_FILTER_SYSCALLMASK_ISSET(nr, &driver->syscall_marker) == 0)
|
||||
if (NOTE_FILTER_SYSCALLMASK_ISSET(nr,
|
||||
&driver->driver.filter.syscall_mask) == 0)
|
||||
{
|
||||
/* Set the name marker */
|
||||
|
||||
|
|
@ -315,16 +324,18 @@ static void note_sysview_syscall_enter(FAR struct note_driver_s *drv, int nr,
|
|||
|
||||
/* Mark the syscall active */
|
||||
|
||||
NOTE_FILTER_SYSCALLMASK_SET(nr, &driver->syscall_marker);
|
||||
NOTE_FILTER_SYSCALLMASK_SET(nr, &driver->driver.filter.syscall_mask);
|
||||
|
||||
/* Use the Syscall "0" to identify whether the syscall is enabled,
|
||||
* if the host tool is closed abnormally, use this bit to clear
|
||||
* the active set.
|
||||
*/
|
||||
|
||||
if (NOTE_FILTER_SYSCALLMASK_ISSET(0, &driver->syscall_marker) == 0)
|
||||
if (NOTE_FILTER_SYSCALLMASK_ISSET(0,
|
||||
&driver->driver.filter.syscall_mask) == 0)
|
||||
{
|
||||
NOTE_FILTER_SYSCALLMASK_SET(0, &driver->syscall_marker);
|
||||
NOTE_FILTER_SYSCALLMASK_SET(0,
|
||||
&driver->driver.filter.syscall_mask);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -338,7 +349,7 @@ static void note_sysview_syscall_leave(FAR struct note_driver_s *drv,
|
|||
(FAR struct note_sysview_driver_s *)drv;
|
||||
nr -= CONFIG_SYS_RESERVED;
|
||||
|
||||
if (NOTE_FILTER_SYSCALLMASK_ISSET(nr, &driver->syscall_marker) != 0)
|
||||
if (NOTE_FILTER_SYSCALLMASK_ISSET(nr, &driver->driver.filter.syscall_mask))
|
||||
{
|
||||
SEGGER_SYSVIEW_MarkStop(nr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <stddef.h>
|
||||
|
||||
#include <nuttx/sched.h>
|
||||
#include <nuttx/sched_note.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
@ -108,8 +109,28 @@ struct note_driver_ops_s
|
|||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
struct note_filter_s
|
||||
{
|
||||
struct note_filter_mode_s mode;
|
||||
# ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
|
||||
struct note_filter_tag_s tag_mask;
|
||||
# endif
|
||||
# ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
|
||||
struct note_filter_irq_s irq_mask;
|
||||
# endif
|
||||
# ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
|
||||
struct note_filter_syscall_s syscall_mask;
|
||||
# endif
|
||||
};
|
||||
#endif
|
||||
|
||||
struct note_driver_s
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
FAR const char *name;
|
||||
struct note_filter_s filter;
|
||||
#endif
|
||||
FAR const struct note_driver_ops_s *ops;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -517,6 +517,12 @@ struct note_filter_mode_s
|
|||
#endif
|
||||
};
|
||||
|
||||
struct note_filter_named_mode_s
|
||||
{
|
||||
char name[NAME_MAX];
|
||||
struct note_filter_mode_s mode;
|
||||
};
|
||||
|
||||
/* This is the type of the argument passed to the NOTECTL_GETSYSCALLFILTER
|
||||
* and NOTECTL_SETSYSCALLFILTER ioctls
|
||||
*/
|
||||
|
|
@ -526,6 +532,12 @@ struct note_filter_syscall_s
|
|||
{
|
||||
uint8_t syscall_mask[(SYS_nsyscalls + 7) / 8];
|
||||
};
|
||||
|
||||
struct note_filter_named_syscall_s
|
||||
{
|
||||
char name[NAME_MAX];
|
||||
struct note_filter_syscall_s syscall_mask;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* This is the type of the argument passed to the NOTECTL_GETIRQFILTER and
|
||||
|
|
@ -537,11 +549,23 @@ struct note_filter_irq_s
|
|||
uint8_t irq_mask[(NR_IRQS + 7) / 8];
|
||||
};
|
||||
|
||||
struct note_filter_named_irq_s
|
||||
{
|
||||
char name[NAME_MAX];
|
||||
struct note_filter_irq_s irq_mask;
|
||||
};
|
||||
|
||||
struct note_filter_tag_s
|
||||
{
|
||||
uint8_t tag_mask[(NOTE_TAG_MAX + 7) / 8];
|
||||
};
|
||||
|
||||
struct note_filter_named_tag_s
|
||||
{
|
||||
char name[NAME_MAX];
|
||||
struct note_filter_tag_s tag_mask;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
|
@ -682,8 +706,8 @@ void sched_note_printf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
|
||||
void sched_note_filter_mode(FAR struct note_filter_mode_s *oldm,
|
||||
FAR struct note_filter_mode_s *newm);
|
||||
void sched_note_filter_mode(FAR struct note_filter_named_mode_s *oldm,
|
||||
FAR struct note_filter_named_mode_s *newm);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -708,8 +732,8 @@ void sched_note_filter_mode(FAR struct note_filter_mode_s *oldm,
|
|||
|
||||
#if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) && \
|
||||
defined(CONFIG_SCHED_INSTRUMENTATION_SYSCALL)
|
||||
void sched_note_filter_syscall(FAR struct note_filter_syscall_s *oldf,
|
||||
FAR struct note_filter_syscall_s *newf);
|
||||
void sched_note_filter_syscall(FAR struct note_filter_named_syscall_s *oldf,
|
||||
FAR struct note_filter_named_syscall_s *newf);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -734,14 +758,14 @@ void sched_note_filter_syscall(FAR struct note_filter_syscall_s *oldf,
|
|||
|
||||
#if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) && \
|
||||
defined(CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER)
|
||||
void sched_note_filter_irq(FAR struct note_filter_irq_s *oldf,
|
||||
FAR struct note_filter_irq_s *newf);
|
||||
void sched_note_filter_irq(FAR struct note_filter_named_irq_s *oldf,
|
||||
FAR struct note_filter_named_irq_s *newf);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) && \
|
||||
defined(CONFIG_SCHED_INSTRUMENTATION_DUMP)
|
||||
void sched_note_filter_tag(FAR struct note_filter_tag_s *oldf,
|
||||
FAR struct note_filter_tag_s *newf);
|
||||
void sched_note_filter_tag(FAR struct note_filter_named_tag_s *oldf,
|
||||
FAR struct note_filter_named_tag_s *newf);
|
||||
#endif
|
||||
|
||||
#endif /* defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue