object_tracing: fixed style

Change-Id: I0881bead44b935e432559225e4f5f5b7051f1469
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2016-12-17 16:17:55 -05:00 committed by Anas Nashif
commit aa2154772a

View file

@ -35,87 +35,81 @@
* *
* @brief Adds a new object into the trace list * @brief Adds a new object into the trace list
* *
* @details The object is added for tracing into * @details The object is added for tracing into a trace list. This is usually
* a trace list. This is usually called at the * called at the moment of object initialization.
* moment of object initialization.
* *
* @param name Name of the trace list. * @param name Name of the trace list.
* @param obj Object to be added in the trace list. * @param obj Object to be added in the trace list.
*/ */
#define SYS_TRACING_OBJ_INIT(name, obj) \ #define SYS_TRACING_OBJ_INIT(name, obj) \
do { \ do { \
unsigned int key; \ unsigned int key; \
\ \
key = irq_lock(); \ key = irq_lock(); \
(obj)->__next = _trace_list_##name;\ (obj)->__next = _trace_list_ ## name; \
_trace_list_##name = obj; \ _trace_list_ ## name = obj; \
irq_unlock(key); \ irq_unlock(key); \
} \ } \
while (0) while (0)
/** /**
* @def SYS_TRACING_OBJ_INIT_DLL * @def SYS_TRACING_OBJ_INIT_DLL
* *
* @brief Adds a new object into the trace list * @brief Adds a new object into the trace list as a double linked list.
* as a double linked list.
* *
* @details The object is added for tracing into * @details The object is added for tracing into a trace list. This is usually
* a trace list. This is usually called at the * called at the moment of object initialization. This list is used for objects
* moment of object initialization. This list is * that can be removed from the tracing list dynamically.
* used for objects that can be removed from the
* tracing list dynamically.
* *
* @param name Name of the trace list. * @param name Name of the trace list.
* @param obj Object to be added in the trace list. * @param obj Object to be added in the trace list.
*/ */
#define SYS_TRACING_OBJ_INIT_DLL(name, obj) \ #define SYS_TRACING_OBJ_INIT_DLL(name, obj) \
do { \ do { \
unsigned int key; \ unsigned int key; \
\ \
key = irq_lock(); \ key = irq_lock(); \
if (_trace_list_##name) { \ if (_trace_list_ ## name) { \
_trace_list_##name->__prev = (obj);\ _trace_list_ ## name->__prev = (obj); \
} \ } \
(obj)->__next = _trace_list_##name;\ (obj)->__next = _trace_list_ ## name; \
(obj)->__prev = NULL; \ (obj)->__prev = NULL; \
_trace_list_##name = obj; \ _trace_list_ ## name = obj; \
irq_unlock(key); \ irq_unlock(key); \
} \ } \
while (0) while (0)
/** /**
* @def SYS_TRACING_OBJ_REMOVE_DLL * @def SYS_TRACING_OBJ_REMOVE_DLL
* *
* @brief Removes an object from a double linked * @brief Removes an object from a double linked trace list.
* trace list.
* *
* @details The object is remove from the trace list. * @details The object is remove from the trace list.
* It needs to be used with DEBUG_TRACING_OBJ_INIT_DLL * It needs to be used with DEBUG_TRACING_OBJ_INIT_DLL as a pair.
* as a pair.
* *
* @param name Name of the trace list. * @param name Name of the trace list.
* @param obj Object to be removed from the trace list. * @param obj Object to be removed from the trace list.
*/ */
#define SYS_TRACING_OBJ_REMOVE_DLL(name, obj) \ #define SYS_TRACING_OBJ_REMOVE_DLL(name, obj) \
do { \ do { \
unsigned int key; \ unsigned int key; \
\ \
key = irq_lock(); \ key = irq_lock(); \
if (obj->__next) { \ if (obj->__next) { \
obj->__next->__prev = (obj)->__prev;\ obj->__next->__prev = (obj)->__prev; \
} \ } \
if (obj->__prev) { \ if (obj->__prev) { \
obj->__prev->__next = (obj)->__next;\ obj->__prev->__next = (obj)->__next; \
} else { \ } else { \
_trace_list_##name = (obj)->__next;\ _trace_list_ ## name = (obj)->__next; \
} \ } \
irq_unlock(key); \ irq_unlock(key); \
} \ } \
while (0) while (0)
struct ring_buf; struct ring_buf;
struct ring_buf *_trace_list_sys_ring_buf; struct ring_buf *_trace_list_sys_ring_buf;
#endif /*CONFIG_DEBUG_TRACING_KERNEL_OBJECTS*/ #endif /*CONFIG_DEBUG_TRACING_KERNEL_OBJECTS*/
#endif /*_OBJECT_TRACING_COMMON_H_*/ #endif /*_OBJECT_TRACING_COMMON_H_*/