Runtime Trace and Record
[RT-Thread Kernel API]


Functions

void rt_thread_idle_sethook (void(*hook)())
void rt_malloc_sethook (void(*hook)(void *ptr, rt_size_t size))
void rt_free_sethook (void(*hook)(void *ptr))
void rt_mp_alloc_sethook (void(*hook)(void *block))
void rt_mp_free_sethook (void(*hook)(void *block))
void rt_object_attach_sethook (void(*hook)(struct rt_object *object))
void rt_object_detach_sethook (void(*hook)(struct rt_object *object))
void rt_object_trytake_sethook (void(*hook)(struct rt_object *object))
void rt_object_take_sethook (void(*hook)(struct rt_object *object))
void rt_object_put_sethook (void(*hook)(struct rt_object *object))
void rt_scheduler_sethook (void(*hook)(struct rt_thread *from, struct rt_thread *to))
void rt_timer_timeout_sethook (void(*hook)(struct rt_timer *timer))

Detailed Description

In order to trace and record RT-Thread activity in runtime, a hook mechanism is introduced.

The hooks are a series of routines, which are invoked in some special checkpoints. The hook routines include:


Function Documentation

void rt_free_sethook ( void(*)(void *ptr)  hook  ) 

This function will set a hook function, which will be invoked when a memory block is released to heap memory.

Parameters:
hook the hook function

void rt_malloc_sethook ( void(*)(void *ptr, rt_size_t size)  hook  ) 

This function will set a hook function, which will be invoked when a memory block is allocated from heap memory.

Parameters:
hook the hook function

void rt_mp_alloc_sethook ( void(*)(void *block)  hook  ) 

This function will set a hook function, which will be invoked when a memory block is allocated from memory pool.

Parameters:
hook the hook function

void rt_mp_free_sethook ( void(*)(void *block)  hook  ) 

This function will set a hook function, which will be invoked when a memory block is released to memory pool.

Parameters:
hook the hook function

void rt_object_attach_sethook ( void(*)(struct rt_object *object)  hook  ) 

This function will set a hook function, which will be invoked when object attaches to kernel object system.

Parameters:
hook the hook function

void rt_object_detach_sethook ( void(*)(struct rt_object *object)  hook  ) 

This function will set a hook function, which will be invoked when object detaches from kernel object system.

Parameters:
hook the hook function

void rt_object_put_sethook ( void(*)(struct rt_object *object)  hook  ) 

This function will set a hook function, which will be invoked when object is put to kernel object system.

Parameters:
hook the hook function

void rt_object_take_sethook ( void(*)(struct rt_object *object)  hook  ) 

This function will set a hook function, which will be invoked when object have been taken from kernel object system.

The object have been taken means that semaphore - semaphore have been taken by thread mutex - mutex have been taken by thread event/fast event - event/fast event have been received by thread mailbox - mail have been received by thread message queue - message have been received by thread timer - timer is started

Parameters:
hook the hook function

void rt_object_trytake_sethook ( void(*)(struct rt_object *object)  hook  ) 

This function will set a hook function, which will be invoked when object is taken from kernel object system.

The object is taken means that semaphore - semaphore is taken by thread mutex - mutex is taken by thread event/fast event - event/fast event is received by thread mailbox - mail is received by thread message queue - message is received by thread

Parameters:
hook the hook function

void rt_scheduler_sethook ( void(*)(struct rt_thread *from, struct rt_thread *to)  hook  ) 

This function will set a hook function, which will be invoked when thread switch happens.

Parameters:
hook the hook function

void rt_thread_idle_sethook ( void(*)()  hook  ) 

This function will set a hook function to idle thread loop.

Parameters:
hook the specified hook function
Note:
the hook function must be simple and never be blocked or suspend.

void rt_timer_timeout_sethook ( void(*)(struct rt_timer *timer)  hook  ) 

This function will set a hook function, which will be invoked when timer is timeout.

Parameters:
hook the hook function


Generated on Thu Oct 9 07:19:09 2008 for RT-Thread Kernel by  doxygen 1.5.7