diff --git a/kernel/src/los_event.c b/kernel/src/los_event.c index d383af17..d2e5520c 100644 --- a/kernel/src/los_event.c +++ b/kernel/src/los_event.c @@ -43,7 +43,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_EventInit(PEVENT_CB_S eventCB) } eventCB->uwEventID = 0; LOS_ListInit(&eventCB->stEventList); - OsHookCall(LOS_HOOK_TYPE_EVENT_INIT); + OsHookCall(LOS_HOOK_TYPE_EVENT_INIT, eventCB); return LOS_OK; } @@ -201,7 +201,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_EventDestroy(PEVENT_CB_S eventCB) eventCB->stEventList.pstNext = (LOS_DL_LIST *)NULL; eventCB->stEventList.pstPrev = (LOS_DL_LIST *)NULL; LOS_IntRestore(intSave); - OsHookCall(LOS_HOOK_TYPE_EVENT_DESTROY); + OsHookCall(LOS_HOOK_TYPE_EVENT_DESTROY, eventCB); return LOS_OK; } LITE_OS_SEC_TEXT_MINOR UINT32 LOS_EventClear(PEVENT_CB_S eventCB, UINT32 eventMask) diff --git a/kernel/src/mm/los_memory.c b/kernel/src/mm/los_memory.c index 7520ffc5..911ac6ee 100644 --- a/kernel/src/mm/los_memory.c +++ b/kernel/src/mm/los_memory.c @@ -1286,6 +1286,8 @@ UINT32 LOS_MemFree(VOID *pool, VOID *ptr) return LOS_NOK; } + OsHookCall(LOS_HOOK_TYPE_MEM_FREE, pool, ptr); + UINT32 ret = LOS_NOK; struct OsMemPoolHead *poolHead = (struct OsMemPoolHead *)pool; struct OsMemNodeHead *node = NULL; @@ -1308,8 +1310,6 @@ UINT32 LOS_MemFree(VOID *pool, VOID *ptr) LOS_Trace(LOS_TRACE_MEM_TIME, (UINTPTR)pool & MEM_POOL_ADDR_MASK, MEM_TRACE_FREE, timeUsed); #endif - OsHookCall(LOS_HOOK_TYPE_MEM_FREE, pool, ptr); - return ret; } diff --git a/utils/internal/los_hook_types.h b/utils/internal/los_hook_types.h index ca4760d4..999c90cf 100644 --- a/utils/internal/los_hook_types.h +++ b/utils/internal/los_hook_types.h @@ -57,11 +57,11 @@ extern "C" { LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_MEM_REALLOC, (VOID *pool, VOID *ptr, UINT32 size)) \ LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_MEM_ALLOCALIGN, (VOID *pool, UINT32 size, UINT32 boundary)) \ /* Hook types supported by event modules */ \ - LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_EVENT_INIT, (VOID)) \ + LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_EVENT_INIT, (PEVENT_CB_S eventCB)) \ LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_EVENT_READ, (PEVENT_CB_S eventCB, UINT32 eventMask, UINT32 mode)) \ LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_EVENT_WRITE, (PEVENT_CB_S eventCB)) \ LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_EVENT_CLEAR, (PEVENT_CB_S eventCB)) \ - LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_EVENT_DESTROY, (VOID)) \ + LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_EVENT_DESTROY, (PEVENT_CB_S eventCB)) \ /* Hook types supported by queue modules */ \ LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_QUEUE_CREATE, (const LosQueueCB *queueCB)) \ LOS_HOOK_TYPE_DEF(LOS_HOOK_TYPE_QUEUE_READ, (const LosQueueCB *queueCB)) \