mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
add the startup process tracepoint
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
#include <nuttx/serial/pty.h>
|
#include <nuttx/serial/pty.h>
|
||||||
#include <nuttx/syslog/syslog.h>
|
#include <nuttx/syslog/syslog.h>
|
||||||
#include <nuttx/syslog/syslog_console.h>
|
#include <nuttx/syslog/syslog_console.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
#include <nuttx/usrsock/usrsock_rpmsg.h>
|
#include <nuttx/usrsock/usrsock_rpmsg.h>
|
||||||
#include <nuttx/virtio/virtio.h>
|
#include <nuttx/virtio/virtio.h>
|
||||||
|
|
||||||
@@ -65,6 +66,8 @@
|
|||||||
|
|
||||||
void drivers_initialize(void)
|
void drivers_initialize(void)
|
||||||
{
|
{
|
||||||
|
drivers_trace_begin();
|
||||||
|
|
||||||
/* Register devices */
|
/* Register devices */
|
||||||
|
|
||||||
syslog_initialize();
|
syslog_initialize();
|
||||||
@@ -208,4 +211,6 @@ void drivers_initialize(void)
|
|||||||
#ifdef CONFIG_DRIVERS_VIRTIO
|
#ifdef CONFIG_DRIVERS_VIRTIO
|
||||||
virtio_register_drivers();
|
virtio_register_drivers();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
drivers_trace_end();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <nuttx/reboot_notifier.h>
|
#include <nuttx/reboot_notifier.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "rpmsgfs/rpmsgfs.h"
|
#include "rpmsgfs/rpmsgfs.h"
|
||||||
#include "inode/inode.h"
|
#include "inode/inode.h"
|
||||||
@@ -76,6 +77,8 @@ static struct notifier_block g_sync_nb =
|
|||||||
|
|
||||||
void fs_initialize(void)
|
void fs_initialize(void)
|
||||||
{
|
{
|
||||||
|
fs_trace_begin();
|
||||||
|
|
||||||
/* Initial inode, file, and VFS data structures */
|
/* Initial inode, file, and VFS data structures */
|
||||||
|
|
||||||
inode_initialize();
|
inode_initialize();
|
||||||
@@ -92,4 +95,5 @@ void fs_initialize(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
register_reboot_notifier(&g_sync_nb);
|
register_reboot_notifier(&g_sync_nb);
|
||||||
|
fs_trace_end();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/clock.h>
|
#include <nuttx/clock.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "clock/clock.h"
|
#include "clock/clock.h"
|
||||||
#ifdef CONFIG_CLOCK_TIMEKEEPING
|
#ifdef CONFIG_CLOCK_TIMEKEEPING
|
||||||
@@ -206,6 +207,8 @@ static void clock_inittime(FAR const struct timespec *tp)
|
|||||||
|
|
||||||
void clock_initialize(void)
|
void clock_initialize(void)
|
||||||
{
|
{
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && \
|
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && \
|
||||||
!defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
!defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
||||||
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
||||||
@@ -233,6 +236,8 @@ void clock_initialize(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
sched_trace_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#include <nuttx/fs/fs.h>
|
#include <nuttx/fs/fs.h>
|
||||||
#include <nuttx/net/net.h>
|
#include <nuttx/net/net.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
|
|
||||||
@@ -58,10 +59,12 @@
|
|||||||
|
|
||||||
int group_setupidlefiles(FAR struct task_tcb_s *tcb)
|
int group_setupidlefiles(FAR struct task_tcb_s *tcb)
|
||||||
{
|
{
|
||||||
|
int ret = OK;
|
||||||
#if defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL)
|
#if defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL)
|
||||||
int fd;
|
int fd;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
sched_trace_begin();
|
||||||
DEBUGASSERT(tcb->cmn.group != NULL);
|
DEBUGASSERT(tcb->cmn.group != NULL);
|
||||||
|
|
||||||
/* Open stdin, dup to get stdout and stderr. This should always
|
/* Open stdin, dup to get stdout and stderr. This should always
|
||||||
@@ -98,6 +101,7 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb)
|
|||||||
serr("ERROR: Failed to open stdin: %d\n", fd);
|
serr("ERROR: Failed to open stdin: %d\n", fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sched_trace_end();
|
||||||
return -ENFILE;
|
return -ENFILE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -114,8 +118,8 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb)
|
|||||||
/* Allocate file/socket streams for the TCB */
|
/* Allocate file/socket streams for the TCB */
|
||||||
|
|
||||||
#ifdef CONFIG_FILE_STREAM
|
#ifdef CONFIG_FILE_STREAM
|
||||||
return group_setupstreams(tcb);
|
ret = group_setupstreams(tcb);
|
||||||
#else
|
|
||||||
return OK;
|
|
||||||
#endif
|
#endif
|
||||||
|
sched_trace_end();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <nuttx/fs/fs.h>
|
#include <nuttx/fs/fs.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
@@ -57,11 +58,12 @@
|
|||||||
int group_setuptaskfiles(FAR struct task_tcb_s *tcb)
|
int group_setuptaskfiles(FAR struct task_tcb_s *tcb)
|
||||||
{
|
{
|
||||||
FAR struct task_group_s *group = tcb->cmn.group;
|
FAR struct task_group_s *group = tcb->cmn.group;
|
||||||
|
int ret = OK;
|
||||||
#ifndef CONFIG_FDCLONE_DISABLE
|
#ifndef CONFIG_FDCLONE_DISABLE
|
||||||
FAR struct tcb_s *rtcb = this_task();
|
FAR struct tcb_s *rtcb = this_task();
|
||||||
int ret;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
sched_trace_begin();
|
||||||
DEBUGASSERT(group);
|
DEBUGASSERT(group);
|
||||||
#ifndef CONFIG_DISABLE_PTHREAD
|
#ifndef CONFIG_DISABLE_PTHREAD
|
||||||
DEBUGASSERT((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) !=
|
DEBUGASSERT((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) !=
|
||||||
@@ -76,6 +78,7 @@ int group_setuptaskfiles(FAR struct task_tcb_s *tcb)
|
|||||||
ret = files_duplist(&rtcb->group->tg_filelist, &group->tg_filelist);
|
ret = files_duplist(&rtcb->group->tg_filelist, &group->tg_filelist);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
sched_trace_end();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -83,8 +86,9 @@ int group_setuptaskfiles(FAR struct task_tcb_s *tcb)
|
|||||||
/* Allocate file/socket streams for the new TCB */
|
/* Allocate file/socket streams for the new TCB */
|
||||||
|
|
||||||
#ifdef CONFIG_FILE_STREAM
|
#ifdef CONFIG_FILE_STREAM
|
||||||
return group_setupstreams(tcb);
|
ret = group_setupstreams(tcb);
|
||||||
#else
|
|
||||||
return OK;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
sched_trace_end();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include <nuttx/fs/fs.h>
|
#include <nuttx/fs/fs.h>
|
||||||
#include <nuttx/init.h>
|
#include <nuttx/init.h>
|
||||||
#include <nuttx/symtab.h>
|
#include <nuttx/symtab.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
#include <nuttx/wqueue.h>
|
#include <nuttx/wqueue.h>
|
||||||
#include <nuttx/kthread.h>
|
#include <nuttx/kthread.h>
|
||||||
#include <nuttx/userspace.h>
|
#include <nuttx/userspace.h>
|
||||||
@@ -406,6 +407,8 @@ static inline void nx_create_initthread(void)
|
|||||||
|
|
||||||
int nx_bringup(void)
|
int nx_bringup(void)
|
||||||
{
|
{
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_ENVIRON
|
#ifndef CONFIG_DISABLE_ENVIRON
|
||||||
/* Setup up the initial environment for the idle task. At present, this
|
/* Setup up the initial environment for the idle task. At present, this
|
||||||
* may consist of only the initial PATH variable and/or and init library
|
* may consist of only the initial PATH variable and/or and init library
|
||||||
@@ -454,5 +457,6 @@ int nx_bringup(void)
|
|||||||
clearenv();
|
clearenv();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
sched_trace_end();
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include <nuttx/kmalloc.h>
|
#include <nuttx/kmalloc.h>
|
||||||
#include <nuttx/pgalloc.h>
|
#include <nuttx/pgalloc.h>
|
||||||
#include <nuttx/sched_note.h>
|
#include <nuttx/sched_note.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
#include <nuttx/binfmt/binfmt.h>
|
#include <nuttx/binfmt/binfmt.h>
|
||||||
#include <nuttx/drivers/drivers.h>
|
#include <nuttx/drivers/drivers.h>
|
||||||
#include <nuttx/init.h>
|
#include <nuttx/init.h>
|
||||||
@@ -323,6 +324,8 @@ void nx_start(void)
|
|||||||
|
|
||||||
/* Initialize RTOS Data ***************************************************/
|
/* Initialize RTOS Data ***************************************************/
|
||||||
|
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
/* Initialize the IDLE task TCB *******************************************/
|
/* Initialize the IDLE task TCB *******************************************/
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_SMP_NCPUS; i++)
|
for (i = 0; i < CONFIG_SMP_NCPUS; i++)
|
||||||
@@ -691,6 +694,7 @@ void nx_start(void)
|
|||||||
|
|
||||||
/* Let other threads have access to the memory manager */
|
/* Let other threads have access to the memory manager */
|
||||||
|
|
||||||
|
sched_trace_end();
|
||||||
sched_unlock();
|
sched_unlock();
|
||||||
|
|
||||||
/* The IDLE Loop **********************************************************/
|
/* The IDLE Loop **********************************************************/
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/irq.h>
|
#include <nuttx/irq.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "irq/irq.h"
|
#include "irq/irq.h"
|
||||||
|
|
||||||
@@ -68,6 +69,8 @@ void irq_initialize(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
/* Point all interrupt vectors to the unexpected interrupt */
|
/* Point all interrupt vectors to the unexpected interrupt */
|
||||||
|
|
||||||
for (i = 0; i < TAB_SIZE; i++)
|
for (i = 0; i < TAB_SIZE; i++)
|
||||||
@@ -82,4 +85,5 @@ void irq_initialize(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
up_irqinitialize();
|
up_irqinitialize();
|
||||||
|
sched_trace_end();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <nuttx/kmalloc.h>
|
#include <nuttx/kmalloc.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "mqueue/mqueue.h"
|
#include "mqueue/mqueue.h"
|
||||||
|
|
||||||
@@ -108,6 +109,8 @@ mq_msgblockalloc(FAR struct list_node *list, uint16_t nmsgs,
|
|||||||
|
|
||||||
void nxmq_initialize(void)
|
void nxmq_initialize(void)
|
||||||
{
|
{
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
/* Allocate a block of messages for general use */
|
/* Allocate a block of messages for general use */
|
||||||
|
|
||||||
mq_msgblockalloc(&g_msgfree, CONFIG_PREALLOC_MQ_MSGS,
|
mq_msgblockalloc(&g_msgfree, CONFIG_PREALLOC_MQ_MSGS,
|
||||||
@@ -119,4 +122,6 @@ void nxmq_initialize(void)
|
|||||||
|
|
||||||
mq_msgblockalloc(&g_msgfreeirq, CONFIG_PREALLOC_MQ_IRQ_MSGS,
|
mq_msgblockalloc(&g_msgfreeirq, CONFIG_PREALLOC_MQ_IRQ_MSGS,
|
||||||
MQ_ALLOC_IRQ);
|
MQ_ALLOC_IRQ);
|
||||||
|
|
||||||
|
sched_trace_end();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "semaphore/semaphore.h"
|
#include "semaphore/semaphore.h"
|
||||||
|
|
||||||
@@ -54,9 +55,12 @@
|
|||||||
|
|
||||||
void nxsem_initialize(void)
|
void nxsem_initialize(void)
|
||||||
{
|
{
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
/* Initialize holder structures needed to support priority inheritance */
|
/* Initialize holder structures needed to support priority inheritance */
|
||||||
|
|
||||||
nxsem_initialize_holders();
|
nxsem_initialize_holders();
|
||||||
|
sched_trace_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_PRIORITY_INHERITANCE */
|
#endif /* CONFIG_PRIORITY_INHERITANCE */
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <nuttx/kmalloc.h>
|
#include <nuttx/kmalloc.h>
|
||||||
#include <nuttx/queue.h>
|
#include <nuttx/queue.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "signal/signal.h"
|
#include "signal/signal.h"
|
||||||
|
|
||||||
@@ -190,6 +191,8 @@ static sigpendq_t *nxsig_alloc_pendingsignalblock(sq_queue_t *siglist,
|
|||||||
|
|
||||||
void nxsig_initialize(void)
|
void nxsig_initialize(void)
|
||||||
{
|
{
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
/* Initialize free lists */
|
/* Initialize free lists */
|
||||||
|
|
||||||
sq_init(&g_sigfreeaction);
|
sq_init(&g_sigfreeaction);
|
||||||
@@ -223,4 +226,5 @@ void nxsig_initialize(void)
|
|||||||
CONFIG_SIG_PREALLOC_IRQ_ACTIONS,
|
CONFIG_SIG_PREALLOC_IRQ_ACTIONS,
|
||||||
SIG_ALLOC_IRQ);
|
SIG_ALLOC_IRQ);
|
||||||
DEBUGASSERT(g_sigpendingirqsignalalloc != NULL);
|
DEBUGASSERT(g_sigpendingirqsignalalloc != NULL);
|
||||||
|
sched_trace_end();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/queue.h>
|
#include <nuttx/queue.h>
|
||||||
#include <nuttx/sched.h>
|
#include <nuttx/sched.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
#include "environ/environ.h"
|
#include "environ/environ.h"
|
||||||
@@ -90,6 +91,8 @@ int nxtask_init(FAR struct task_tcb_s *tcb, const char *name, int priority,
|
|||||||
uint8_t ttype = tcb->cmn.flags & TCB_FLAG_TTYPE_MASK;
|
uint8_t ttype = tcb->cmn.flags & TCB_FLAG_TTYPE_MASK;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_PTHREAD
|
#ifndef CONFIG_DISABLE_PTHREAD
|
||||||
/* Only tasks and kernel threads can be initialized in this way */
|
/* Only tasks and kernel threads can be initialized in this way */
|
||||||
|
|
||||||
@@ -110,6 +113,7 @@ int nxtask_init(FAR struct task_tcb_s *tcb, const char *name, int priority,
|
|||||||
ret = group_allocate(tcb, tcb->cmn.flags);
|
ret = group_allocate(tcb, tcb->cmn.flags);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
sched_trace_end();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +179,7 @@ int nxtask_init(FAR struct task_tcb_s *tcb, const char *name, int priority,
|
|||||||
/* Now we have enough in place that we can join the group */
|
/* Now we have enough in place that we can join the group */
|
||||||
|
|
||||||
group_initialize(tcb);
|
group_initialize(tcb);
|
||||||
|
sched_trace_end();
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
errout_with_group:
|
errout_with_group:
|
||||||
@@ -200,6 +205,7 @@ errout_with_group:
|
|||||||
|
|
||||||
group_leave(&tcb->cmn);
|
group_leave(&tcb->cmn);
|
||||||
|
|
||||||
|
sched_trace_end();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <nuttx/irq.h>
|
#include <nuttx/irq.h>
|
||||||
#include <nuttx/queue.h>
|
#include <nuttx/queue.h>
|
||||||
|
#include <nuttx/trace.h>
|
||||||
|
|
||||||
#include "timer/timer.h"
|
#include "timer/timer.h"
|
||||||
|
|
||||||
@@ -83,6 +84,8 @@ volatile sq_queue_t g_alloctimers;
|
|||||||
|
|
||||||
void timer_initialize(void)
|
void timer_initialize(void)
|
||||||
{
|
{
|
||||||
|
sched_trace_begin();
|
||||||
|
|
||||||
#if CONFIG_PREALLOC_TIMERS > 0
|
#if CONFIG_PREALLOC_TIMERS > 0
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -101,6 +104,7 @@ void timer_initialize(void)
|
|||||||
/* Initialize the list of allocated timers */
|
/* Initialize the list of allocated timers */
|
||||||
|
|
||||||
sq_init((FAR sq_queue_t *)&g_alloctimers);
|
sq_init((FAR sq_queue_t *)&g_alloctimers);
|
||||||
|
sched_trace_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user