kern: Add kernel trace support (KTR)

Update #4475
This commit is contained in:
Chris Johns
2021-07-21 17:59:40 +10:00
parent 9800a0f9fa
commit e56b5cb135
12 changed files with 66 additions and 16 deletions

View File

@@ -44,6 +44,7 @@
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/sysctl.h>
#include <sys/lock.h>
#include <sys/mutex.h>
@@ -187,5 +188,11 @@ rtems_bsd_initialize(void)
mutex_init();
mi_startup();
#ifdef KTR
ktr_verbose = 10;
ktr_mask = KTR_ALL;
ktr_mask = KTR_GEN | KTR_LOCK | KTR_VFS | KTR_VOP | KTR_BUF | KTR_MALLOC | KTR_SYSC | KTR_RUNQ;
#endif
return RTEMS_SUCCESSFUL;
}

View File

@@ -260,6 +260,9 @@ rtems_bsd_thread_start(struct thread **td_ptr, void (*func)(void *), void *arg,
BSD_ASSERT(td != NULL);
_Thread_Set_name(thread, name);
#ifdef KTR
strlcpy(td->td_name, name, sizeof(td->td_name));
#endif
if (rtems_bsd_thread_ready_to_start) {
sc = rtems_task_start(task_id, (rtems_task_entry) func,