diff --git a/doc/文豪泛读报告.docx b/doc/文豪泛读报告.docx new file mode 100644 index 0000000..d04ab4e Binary files /dev/null and b/doc/文豪泛读报告.docx differ diff --git a/src/kernel/base/debug/los_mux_deadlock.c b/src/kernel/base/debug/los_mux_deadlock.c index fa71774..6862541 100644 --- a/src/kernel/base/debug/los_mux_deadlock.c +++ b/src/kernel/base/debug/los_mux_deadlock.c @@ -38,16 +38,17 @@ #if __cplusplus extern "C" { #endif -#endif /* __cplusplus */ +#endif /* __cplusplus */nbb typedef struct { - LOS_DL_LIST muxListHead; /* Task-held mutexs list */ - UINT64 lastAccessTime; /* The last operation time */ + LOS_DL_LIST muxListHead; /* Task-held mutexs list */ //ÓÃÓÚ¹ÜÀíÈÎÎñ³ÖÓеĻ¥³âËøÁбí// + UINT64 lastAccessTime; /* The last operation time */ //¼Ç¼×îºóÒ»´Î²Ù×÷µÄʱ¼ä// } MuxDLinkCB; +/*¹ÜÀíÈÎÎñ³ÖÓеĻ¥³âËøÁбíºÍ¸ú×ÙËÀËøÇé¿ö*/ typedef struct { - LOS_DL_LIST muxList; /* Insert mutex into the owner task CB */ - VOID *muxCB; /* The Mutex CB pointer */ + LOS_DL_LIST muxList; /* Insert mutex into the owner task CB */ //ÓÃÓÚ½«»¥³âËø²åÈëµ½ËùÊôÈÎÎñµÄ¿ØÖÆ¿éÖÐ// + VOID *muxCB; /* The Mutex CB pointer */ //Ö¸Ïò»¥³âËø¿ØÖÆ¿éµÄÖ¸Õë// } MuxDLinkNode; STATIC MuxDLinkCB *g_muxDeadlockCBArray = NULL; @@ -57,9 +58,9 @@ STATIC MuxDLinkCB *g_muxDeadlockCBArray = NULL; * that has not been scheduled within this time. * The unit is tick. */ -#define OS_MUX_DEADLOCK_CHECK_THRESHOLD 60000 +#define OS_MUX_DEADLOCK_CHECK_THRESHOLD 60000 //¶¨ÒåÁ½´Î¼ì²é»¥³âËøËÀËøÖ®¼äµÄ×îСʱ¼ä¼ä¸ô£¬µ¥Î»ÎªºÁÃë// -UINT32 OsMuxDlockCheckInit(VOID) +UINT32 OsMuxDlockCheckInit(VOID) //ÓÃÓÚ·ÖÅäÄÚ´æ²¢³õʼ»¯»¥³âËø¿ØÖÆ¿éÁбí// { UINT32 index; UINT32 size = (LOSCFG_BASE_CORE_TSK_LIMIT + 1) * sizeof(MuxDLinkCB); @@ -78,7 +79,7 @@ UINT32 OsMuxDlockCheckInit(VOID) return LOS_OK; } -VOID OsMuxDlockNodeInsert(UINT32 taskId, VOID *muxCB) +VOID OsMuxDlockNodeInsert(UINT32 taskId, VOID *muxCB) //ÓÃÓÚÏòÖ¸¶¨ÈÎÎñµÄ»¥³âËøÁ´±íÖвåÈëÒ»¸ö»¥³âËø½Úµã// { MuxDLinkNode *muxDLNode = NULL; @@ -96,7 +97,7 @@ VOID OsMuxDlockNodeInsert(UINT32 taskId, VOID *muxCB) LOS_ListTailInsert(&g_muxDeadlockCBArray[taskId].muxListHead, &muxDLNode->muxList); } -VOID OsMuxDlockNodeDelete(UINT32 taskId, const VOID *muxCB) +VOID OsMuxDlockNodeDelete(UINT32 taskId, const VOID *muxCB) //ÓÃÓÚ´ÓÖ¸¶¨ÈÎÎñµÄ»¥³âËøÁ´±íÖÐɾ³ýÖ¸¶¨µÄ»¥³âËø½Úµã// { MuxDLinkCB *muxDLCB = NULL; LOS_DL_LIST *list = NULL; @@ -117,7 +118,7 @@ VOID OsMuxDlockNodeDelete(UINT32 taskId, const VOID *muxCB) } } -VOID OsTaskTimeUpdate(UINT32 taskId, UINT64 tickCount) +VOID OsTaskTimeUpdate(UINT32 taskId, UINT64 tickCount) //ÓÃÓÚ¸üÐÂÈÎÎñµÄ×îºó·ÃÎÊʱ¼ä// { if (taskId > LOSCFG_BASE_CORE_TSK_LIMIT) { return; @@ -126,7 +127,7 @@ VOID OsTaskTimeUpdate(UINT32 taskId, UINT64 tickCount) g_muxDeadlockCBArray[taskId].lastAccessTime = tickCount; } -STATIC VOID OsDeadlockBackTrace(const LosTaskCB *taskCB) +STATIC VOID OsDeadlockBackTrace(const LosTaskCB *taskCB) //ÓÃÓÚ´òÓ¡ÈÎÎñµÄº¯Êýµ÷ÓÃÕ»ÐÅÏ¢// { TaskContext *context = NULL; @@ -137,7 +138,7 @@ STATIC VOID OsDeadlockBackTrace(const LosTaskCB *taskCB) return; } -STATIC VOID OsMutexPendTaskList(LOS_DL_LIST *list) +STATIC VOID OsMutexPendTaskList(LOS_DL_LIST *list) //ÓÃÓÚ´òÓ¡»¥³âËøµÈ´ýÈÎÎñµÄÁбíÐÅÏ¢// { LOS_DL_LIST *listTmp = NULL; LosTaskCB *pendedTask = NULL; @@ -168,7 +169,7 @@ STATIC VOID OsMutexPendTaskList(LOS_DL_LIST *list) SCHEDULER_UNLOCK(intSave); } -STATIC VOID OsTaskHoldMutexList(MuxDLinkCB *muxDLCB) +STATIC VOID OsTaskHoldMutexList(MuxDLinkCB *muxDLCB) //ÓÃÓÚ´òÓ¡ÈÎÎñ³ÖÓеĻ¥³âËøµÄÐÅÏ¢// { UINT32 index = 0; MuxDLinkNode *muxDLNode = NULL; @@ -204,7 +205,7 @@ STATIC VOID OsTaskHoldMutexList(MuxDLinkCB *muxDLCB) } } -VOID OsMutexDlockCheck(VOID) +VOID OsMutexDlockCheck(VOID) //ÓÃÓÚ¼ì²â»¥³âËøËÀËøÇé¿ö²¢Êä³öÏà¹ØÐÅÏ¢// { UINT32 loop, intSave; UINT32 taskId; @@ -234,7 +235,7 @@ VOID OsMutexDlockCheck(VOID) SCHEDULER_UNLOCK(intSave); } -#ifdef LOSCFG_SHELL +#ifdef LOSCFG_SHELL //ÓÃÓÚÔÚÃüÁîÐÐÖÐÖ´Ðл¥³âËøËÀËø¼ì²é²¢Êä³öÏà¹ØÐÅÏ¢// UINT32 OsShellCmdMuxDeadlockCheck(UINT32 argc, const CHAR **argv) { if (argc > 0) { diff --git a/src/kernel/base/debug/los_mux_debug.c b/src/kernel/base/debug/los_mux_debug.c index 9ac8f6d..5008bc5 100644 --- a/src/kernel/base/debug/los_mux_debug.c +++ b/src/kernel/base/debug/los_mux_debug.c @@ -41,20 +41,21 @@ extern "C" { #endif #endif /* __cplusplus */ -#ifdef LOSCFG_DEBUG_MUTEX +#ifdef LOSCFG_DEBUG_MUTEX //ÓÃÓÚ±íʾ»¥³âËøµÄµ÷ÊÔÐÅÏ¢// typedef struct { TSK_ENTRY_FUNC creator; /* The task entry who created this mutex */ UINT64 lastAccessTime; /* The last access time */ } MuxDebugCB; STATIC MuxDebugCB *g_muxDebugArray = NULL; +//ÓÃÓڱȽÏÁ½¸ö»¥³âËøµ÷ÊÔÐÅÏ¢µÄ×îºó·ÃÎÊʱ¼ä// STATIC BOOL MuxCompareValue(const SortParam *sortParam, UINT32 left, UINT32 right) { return (*((UINT64 *)(VOID *)SORT_ELEM_ADDR(sortParam, left)) > *((UINT64 *)(VOID *)SORT_ELEM_ADDR(sortParam, right))); } -UINT32 OsMuxDbgInit(VOID) +UINT32 OsMuxDbgInit(VOID) //ÓÃÓÚ³õʼ»¯»¥³âËøµ÷ÊÔÐÅÏ¢Êý×é// { UINT32 size = LOSCFG_BASE_IPC_MUX_LIMIT * sizeof(MuxDebugCB); /* system resident memory, don't free */ @@ -67,19 +68,20 @@ UINT32 OsMuxDbgInit(VOID) return LOS_OK; } -VOID OsMuxDbgTimeUpdate(UINT32 muxId) +VOID OsMuxDbgTimeUpdate(UINT32 muxId) //ÓÃÓÚ¸üÐÂÖ¸¶¨»¥³âËøµÄ×îºó·ÃÎÊʱ¼ä// { MuxDebugCB *muxDebug = &g_muxDebugArray[GET_MUX_INDEX(muxId)]; muxDebug->lastAccessTime = LOS_TickCountGet(); } -VOID OsMuxDbgUpdate(UINT32 muxId, TSK_ENTRY_FUNC creator) +VOID OsMuxDbgUpdate(UINT32 muxId, TSK_ENTRY_FUNC creator) //ÓÃÓÚ¸üÐÂÖ¸¶¨»¥³âËøµÄ´´½¨ÕߺÍ×îºó·ÃÎÊʱ¼ä// { MuxDebugCB *muxDebug = &g_muxDebugArray[GET_MUX_INDEX(muxId)]; muxDebug->creator = creator; muxDebug->lastAccessTime = LOS_TickCountGet(); } +//ÓÃÓÚ¶Ô»¥³âËøË÷ÒýÊý×é½øÐÐÅÅÐò£¬²¢¼ì²é¿ÉÄÜ´æÔڵĻ¥³âËøй©// STATIC VOID SortMuxIndexArray(UINT32 *indexArray, UINT32 count) { LosMuxCB muxNode = {{0, 0}, 0, 0, 0, 0}; @@ -119,7 +121,7 @@ STATIC VOID SortMuxIndexArray(UINT32 *indexArray, UINT32 count) (VOID)LOS_MemFree((VOID *)OS_SYS_MEM_ADDR, indexArray); } -VOID OsMutexCheck(VOID) +VOID OsMutexCheck(VOID) //ÓÃÓÚ¼ì²é»¥³âËøµÄ״̬²¢¶Ô¿ÉÄÜ´æÔڵĻ¥³âËøй©½øÐд¦Àí// { LosMuxCB muxNode = {{0, 0}, 0, 0, 0, 0}; MuxDebugCB muxDebugNode = {0}; @@ -165,6 +167,7 @@ VOID OsMutexCheck(VOID) } #ifdef LOSCFG_SHELL +//ÓÃÓÚ»ñÈ¡»¥³âËøÐÅÏ¢// LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdMuxInfoGet(UINT32 argc, const CHAR **argv) { if (argc > 0) { diff --git a/src/kernel/base/debug/los_queue_debug.c b/src/kernel/base/debug/los_queue_debug.c index fdd1f18..43ba6ad 100644 --- a/src/kernel/base/debug/los_queue_debug.c +++ b/src/kernel/base/debug/los_queue_debug.c @@ -38,20 +38,21 @@ extern "C" { #endif #endif /* __cplusplus */ -#ifdef LOSCFG_DEBUG_QUEUE +#ifdef LOSCFG_DEBUG_QUEUE //ÓÃÓÚ±£´æ¶ÓÁеĵ÷ÊÔÐÅÏ¢// typedef struct { TSK_ENTRY_FUNC creator; /* The task entry who created this queue */ UINT64 lastAccessTime; /* The last access time */ } QueueDebugCB; STATIC QueueDebugCB *g_queueDebugArray = NULL; +//ÓÃÓڱȽ϶ÓÁÐÖеÄÔªËØÖµ// STATIC BOOL QueueCompareValue(const SortParam *sortParam, UINT32 left, UINT32 right) { return (*((UINT64 *)(VOID *)SORT_ELEM_ADDR(sortParam, left)) > *((UINT64 *)(VOID *)SORT_ELEM_ADDR(sortParam, right))); } -UINT32 OsQueueDbgInit(VOID) +UINT32 OsQueueDbgInit(VOID) //ÓÃÓÚ³õʼ»¯¶ÓÁеĵ÷ÊÔÐÅÏ¢// { UINT32 size = LOSCFG_BASE_IPC_QUEUE_LIMIT * sizeof(QueueDebugCB); @@ -65,14 +66,14 @@ UINT32 OsQueueDbgInit(VOID) return LOS_OK; } -VOID OsQueueDbgTimeUpdate(UINT32 queueId) +VOID OsQueueDbgTimeUpdate(UINT32 queueId) //ÓÃÓÚ¸üжÓÁеÄ×îºó·ÃÎÊʱ¼ä// { QueueDebugCB *queueDebug = &g_queueDebugArray[GET_QUEUE_INDEX(queueId)]; queueDebug->lastAccessTime = LOS_TickCountGet(); return; } -VOID OsQueueDbgUpdate(UINT32 queueId, TSK_ENTRY_FUNC entry) +VOID OsQueueDbgUpdate(UINT32 queueId, TSK_ENTRY_FUNC entry) //ÓÃÓÚ¸üжÓÁеĵ÷ÊÔÐÅÏ¢// { QueueDebugCB *queueDebug = &g_queueDebugArray[GET_QUEUE_INDEX(queueId)]; queueDebug->creator = entry; @@ -80,7 +81,7 @@ VOID OsQueueDbgUpdate(UINT32 queueId, TSK_ENTRY_FUNC entry) return; } -STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node) +STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node) //ÓÃÓÚÊä³ö¶ÓÁеÄÐÅÏ¢// { PRINTK("Queue ID <0x%x> may leak, queue len is 0x%x, " "readable cnt:0x%x, writeable cnt:0x%x, ", @@ -90,13 +91,13 @@ STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node) node->readWriteableCnt[OS_QUEUE_WRITE]); } -STATIC INLINE VOID OsQueueOpsOutput(const QueueDebugCB *node) +STATIC INLINE VOID OsQueueOpsOutput(const QueueDebugCB *node) //ÓÃÓÚÊä³ö¶ÓÁвÙ×÷µÄÐÅÏ¢// { PRINTK("TaskEntry of creator:0x%p, Latest operation time: 0x%llx\n", node->creator, node->lastAccessTime); } -STATIC VOID SortQueueIndexArray(UINT32 *indexArray, UINT32 count) +STATIC VOID SortQueueIndexArray(UINT32 *indexArray, UINT32 count) //ÓÃÓÚ¶Ô¶ÓÁÐË÷ÒýÊý×é½øÐÐÅÅÐò²¢Êä³öÏàÓ¦µÄ¶ÓÁÐÐÅÏ¢// { LosQueueCB queueNode = {0}; QueueDebugCB queueDebugNode = {0}; @@ -128,7 +129,7 @@ STATIC VOID SortQueueIndexArray(UINT32 *indexArray, UINT32 count) (VOID)LOS_MemFree((VOID *)OS_SYS_MEM_ADDR, indexArray); } -VOID OsQueueCheck(VOID) +VOID OsQueueCheck(VOID) //ÓÃÓÚ¼ì²é¶ÓÁеÄ״̬²¢Êä³öÏàÓ¦ÐÅÏ¢// { LosQueueCB queueNode = {0}; QueueDebugCB queueDebugNode = {0}; @@ -182,6 +183,7 @@ VOID OsQueueCheck(VOID) } #ifdef LOSCFG_SHELL +//µ±Óû§ÊäÈë "queue" ÃüÁîʱ£¬»áÊä³öÒÑʹÓöÓÁеÄÐÅÏ¢// LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdQueueInfoGet(UINT32 argc, const CHAR **argv) { if (argc > 0) { diff --git a/src/kernel/base/debug/los_sched_debug.c b/src/kernel/base/debug/los_sched_debug.c index 6683fe7..ec4a78b 100644 --- a/src/kernel/base/debug/los_sched_debug.c +++ b/src/kernel/base/debug/los_sched_debug.c @@ -40,17 +40,17 @@ extern "C" { #define DECIMAL_TO_PERCENTAGE 100 typedef struct { - UINT64 idleRuntime; - UINT64 idleStarttime; - UINT64 highTaskRuntime; - UINT64 highTaskStarttime; - UINT64 sumPriority; - UINT32 prioritySwitch; - UINT32 highTaskSwitch; - UINT32 contexSwitch; - UINT32 hwiNum; + UINT64 idleRuntime; //¿ÕÏÐÈÎÎñµÄÔËÐÐʱ¼ä// + UINT64 idleStarttime; //¿ÕÏÐÈÎÎñµÄÆô¶¯Ê±¼ä// + UINT64 highTaskRuntime; //¸ßÓÅÏȼ¶ÈÎÎñµÄÔËÐÐʱ¼ä// + UINT64 highTaskStarttime; //¸ßÓÅÏȼ¶ÈÎÎñµÄÆô¶¯Ê±¼ä// + UINT64 sumPriority; //ÈÎÎñÓÅÏȼ¶Ö®ºÍ// + UINT32 prioritySwitch; //ÈÎÎñÇл»´ÎÊý// + UINT32 highTaskSwitch; //¸ßÓÅÏȼ¶ÈÎÎñÇл»´ÎÊý// + UINT32 contexSwitch; //ÉÏÏÂÎÄÇл»´ÎÊý// + UINT32 hwiNum; //Ó²¼þÖжϴÎÊý// #ifdef LOSCFG_KERNEL_SMP - UINT32 ipiIrqNum; + UINT32 ipiIrqNum; //ÖжϴÎÊý£¨½öÔÚ¶àºËÅäÖÃ϶¨Ò壩// #endif } StatPercpu; @@ -58,6 +58,7 @@ STATIC BOOL g_statisticsStartFlag = FALSE; STATIC UINT64 g_statisticsStartTime; STATIC StatPercpu g_statPercpu[LOSCFG_KERNEL_CORE_NUM]; +//ÓÃÓÚÔÚÿ¸ö CPU ºËÐÄÉϽøÐе÷¶Èͳ¼Æ// STATIC VOID OsSchedStatisticsPerCpu(const LosTaskCB *runTask, const LosTaskCB *newTask) { UINT32 cpuId; @@ -106,6 +107,7 @@ STATIC VOID OsSchedStatisticsPerCpu(const LosTaskCB *runTask, const LosTaskCB *n return; } +//ÓÃÓÚ¸üе÷¶Èͳ¼ÆÐÅÏ¢// LITE_OS_SEC_TEXT_MINOR VOID OsSchedStatistics(LosTaskCB *runTask, LosTaskCB *newTask) { UINT64 runtime; @@ -131,7 +133,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsSchedStatistics(LosTaskCB *runTask, LosTaskCB *new OsSchedStatisticsPerCpu(runTask, newTask); } -LITE_OS_SEC_TEXT_MINOR VOID OsHwiStatistics(size_t intNum) +LITE_OS_SEC_TEXT_MINOR VOID OsHwiStatistics(size_t intNum) //ÓÃÓÚ¸üÐÂÓ²ÖжϵÄͳ¼ÆÐÅÏ¢// { UINT32 cpuId = ArchCurrCpuid(); @@ -149,7 +151,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsHwiStatistics(size_t intNum) return; } -LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID) +LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID) //ÓÃÓÚ´òÓ¡ÈÎÎñµÄµ÷¶Èͳ¼ÆÐÅÏ¢// { LosTaskCB *taskCB = NULL; UINT32 loop; @@ -192,7 +194,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID) PRINTK("\n"); } -LITE_OS_SEC_TEXT_MINOR VOID OsStatisticsShow(UINT64 statisticsPastTime) +LITE_OS_SEC_TEXT_MINOR VOID OsStatisticsShow(UINT64 statisticsPastTime) //ÓÃÓÚÏÔʾϵͳµÄͳ¼ÆÐÅÏ¢// { UINT32 cpuId; PRINTK("\n"); @@ -238,7 +240,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsStatisticsShow(UINT64 statisticsPastTime) PRINTK("\n"); } -LITE_OS_SEC_TEXT_MINOR VOID OsShellStatisticsStart(VOID) +LITE_OS_SEC_TEXT_MINOR VOID OsShellStatisticsStart(VOID) //ÓÃÓÚÔÚ¶àºËϵͳÖÐÆô¶¯Í³¼Æ¹¦ÄÜ// { LosTaskCB *taskCB = NULL; UINT32 loop; @@ -285,6 +287,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellStatisticsStart(VOID) return; } +//ÓÃÓÚÔÚ¶àºËϵͳÖÐֹͣͳ¼Æ¹¦ÄÜ£¬²¢½øÐÐͳ¼ÆÊý¾ÝµÄ´¦ÀíºÍչʾ// LITE_OS_SEC_TEXT_MINOR VOID OsShellStatisticsStop(VOID) { LosTaskCB *taskCB = NULL; diff --git a/src/kernel/base/debug/los_sem_debug.c b/src/kernel/base/debug/los_sem_debug.c index 81ee7e7..8f1774b 100644 --- a/src/kernel/base/debug/los_sem_debug.c +++ b/src/kernel/base/debug/los_sem_debug.c @@ -44,7 +44,7 @@ extern "C" { #ifdef LOSCFG_DEBUG_SEMAPHORE #define OS_ALL_SEM_MASK 0xffffffff -STATIC VOID OsSemPendedTaskNamePrint(LosSemCB *semNode) +STATIC VOID OsSemPendedTaskNamePrint(LosSemCB *semNode) //ÓÃÓÚ´òÓ¡µÈ´ýij¸öÐźÅÁ¿µÄÈÎÎñÁбí// { LosTaskCB *tskCB = NULL; CHAR *nameArr[LOSCFG_BASE_CORE_TSK_LIMIT] = {0}; @@ -76,20 +76,21 @@ STATIC VOID OsSemPendedTaskNamePrint(LosSemCB *semNode) PRINTK("\n"); } -typedef struct { +typedef struct { //ÓÃÓÚ¼Ç¼ÐźÅÁ¿µÄµ÷ÊÔÐÅÏ¢// UINT16 origSemCount; /* Number of original available semaphores */ UINT64 lastAccessTime; /* The last operation time */ TSK_ENTRY_FUNC creator; /* The task entry who created this sem */ } SemDebugCB; -STATIC SemDebugCB *g_semDebugArray = NULL; +STATIC SemDebugCB *g_semDebugArray = NULL; //ÓÃÓÚ´æ´¢ËùÓÐÐźÅÁ¿µÄµ÷ÊÔÐÅÏ¢// +//ÓÃÓڱȽÏÁ½¸öÅÅÐòÔªËصÄÖµ// STATIC BOOL SemCompareValue(const SortParam *sortParam, UINT32 left, UINT32 right) { return (*((UINT64 *)(VOID *)SORT_ELEM_ADDR(sortParam, left)) > *((UINT64 *)(VOID *)SORT_ELEM_ADDR(sortParam, right))); } -UINT32 OsSemDbgInit(VOID) +UINT32 OsSemDbgInit(VOID) //ÓÃÓÚ³õʼ»¯ÐźÅÁ¿µÄµ÷ÊÔÐÅÏ¢Êý×é// { UINT32 size = LOSCFG_BASE_IPC_SEM_LIMIT * sizeof(SemDebugCB); /* system resident memory, don't free */ @@ -102,14 +103,14 @@ UINT32 OsSemDbgInit(VOID) return LOS_OK; } -VOID OsSemDbgTimeUpdate(UINT32 semId) +VOID OsSemDbgTimeUpdate(UINT32 semId) //ÓÃÓÚ¸üÐÂÖ¸¶¨ÐźÅÁ¿µÄ×îºóÒ»´Î·ÃÎÊʱ¼ä// { SemDebugCB *semDebug = &g_semDebugArray[GET_SEM_INDEX(semId)]; semDebug->lastAccessTime = LOS_TickCountGet(); return; } -VOID OsSemDbgUpdate(UINT32 semId, TSK_ENTRY_FUNC creator, UINT16 count) +VOID OsSemDbgUpdate(UINT32 semId, TSK_ENTRY_FUNC creator, UINT16 count) //ÓÃÓÚ¸üÐÂÖ¸¶¨ÐźÅÁ¿µÄµ÷ÊÔÐÅÏ¢// { SemDebugCB *semDebug = &g_semDebugArray[GET_SEM_INDEX(semId)]; semDebug->creator = creator; @@ -118,7 +119,9 @@ VOID OsSemDbgUpdate(UINT32 semId, TSK_ENTRY_FUNC creator, UINT16 count) return; } -STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount) +/*ÓÃÓÚ°´ÕÕÐźÅÁ¿µÄ×îºó·ÃÎÊʱ¼ä¶Ôµ±Ç°ÕýÔÚʹÓõÄÐźÅÁ¿½øÐÐÅÅÐò£¬*/ +/*²¢´òӡÿ¸öÐźÅÁ¿µÄµ÷ÊÔÐÅÏ¢ºÍµÈ´ý¸ÃÐźÅÁ¿µÄÈÎÎñÃû*/ +STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount) { UINT32 i, intSave; LosSemCB *semCB = NULL; @@ -154,7 +157,7 @@ STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount) } } } - +/*ÓÃÓÚ»ñÈ¡µ±Ç°ÕýÔÚʹÓõÄÐźÅÁ¿ÐÅÏ¢£¬²¢°´ÕÕÐźÅÁ¿µÄ×îºó·ÃÎÊʱ¼ä¶ÔÐźÅÁ¿½øÐÐÅÅÐò*/ UINT32 OsSemInfoGetFullData(VOID) { UINT32 usedSemCnt = 0; @@ -209,7 +212,7 @@ UINT32 OsSemInfoGetFullData(VOID) } #ifdef LOSCFG_SHELL -STATIC UINT32 OsSemInfoOutput(size_t semId) +STATIC UINT32 OsSemInfoOutput(size_t semId) //ÓÃÓÚÊä³öÐźÅÁ¿ÐÅÏ¢// { UINT32 loop, semCnt, intSave; LosSemCB *semCB = NULL; @@ -254,6 +257,7 @@ STATIC UINT32 OsSemInfoOutput(size_t semId) return LOS_OK; } +//ÓÃÓÚ»ñÈ¡ÐźÅÁ¿ÐÅÏ¢// LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdSemInfoGet(UINT32 argc, const CHAR **argv) { size_t semId;