void macTrace(tpAniSirGlobal pMac, tANI_U8 code, tANI_U8 session, tANI_U32 data) { //Today macTrace is being invoked by PE only, need to remove this function once PE is migrated to using new trace API. macTraceNew(pMac, VOS_MODULE_ID_PE, code, session, data); #if 0 tpTraceRecord rec = NULL; //limLog(pMac, LOGE, "mac Trace code: %d, data: %x, head: %d, tail: %d\n", code, data, gTraceData.head, gTraceData.tail); if(!gTraceData.enable) return; gTraceData.num++; if (gTraceData.head == INVALID_TRACE_ADDR) { /* first record */ gTraceData.head = 0; gTraceData.tail = 0; } else { /* queue is not empty */ tANI_U32 tail = gTraceData.tail + 1; if (tail == MAX_TRACE_RECORDS) tail = 0; if (gTraceData.head == tail) { /* full */ if (++gTraceData.head == MAX_TRACE_RECORDS) gTraceData.head = 0; } gTraceData.tail = tail; } rec = &gTraceTbl[gTraceData.tail]; rec->code = code; rec->session = session; rec->data = data; rec->time = vos_timer_get_system_time(); rec->module = VOS_MODULE_ID_PE; gTraceData.numSinceLastDump ++; if(gTraceData.numSinceLastDump == gTraceData.dumpCount) { limLog(pMac, LOGE, "Trace Dump last %d traces\n", gTraceData.dumpCount); macTraceDumpAll(pMac, 0, 0, gTraceData.dumpCount); gTraceData.numSinceLastDump = 0; } #endif }
void macTrace(tpAniSirGlobal pMac, tANI_U8 code, tANI_U8 session, tANI_U32 data) { macTraceNew(pMac, VOS_MODULE_ID_PE, code, session, data); #if 0 tpTraceRecord rec = NULL; if(!gTraceData.enable) return; gTraceData.num++; if (gTraceData.head == INVALID_TRACE_ADDR) { gTraceData.head = 0; gTraceData.tail = 0; } else { tANI_U32 tail = gTraceData.tail + 1; if (tail == MAX_TRACE_RECORDS) tail = 0; if (gTraceData.head == tail) { if (++gTraceData.head == MAX_TRACE_RECORDS) gTraceData.head = 0; } gTraceData.tail = tail; } rec = &gTraceTbl[gTraceData.tail]; rec->code = code; rec->session = session; rec->data = data; rec->time = vos_timer_get_system_time(); rec->module = VOS_MODULE_ID_PE; gTraceData.numSinceLastDump ++; if(gTraceData.numSinceLastDump == gTraceData.dumpCount) { limLog(pMac, LOGE, "Trace Dump last %d traces\n", gTraceData.dumpCount); macTraceDumpAll(pMac, 0, 0, gTraceData.dumpCount); gTraceData.numSinceLastDump = 0; } #endif }
void macTraceNew(tpAniSirGlobal pMac, tANI_U8 module, tANI_U8 code, tANI_U8 session, tANI_U32 data) { tpTraceRecord rec = NULL; //limLog(pMac, LOGE, "mac Trace code: %d, data: %x, head: %d, tail: %d\n", code, data, gTraceData.head, gTraceData.tail); if(!gTraceData.enable) return; //If module is not registered, don't record for that module. if(traceCBTable[module] == NULL) return; gTraceData.num++; if (gTraceData.head == INVALID_TRACE_ADDR) { /* first record */ gTraceData.head = 0; gTraceData.tail = 0; } else { /* queue is not empty */ tANI_U32 tail = gTraceData.tail + 1; if (tail == MAX_TRACE_RECORDS) tail = 0; if (gTraceData.head == tail) { /* full */ if (++gTraceData.head == MAX_TRACE_RECORDS) gTraceData.head = 0; } gTraceData.tail = tail; } rec = &gTraceTbl[gTraceData.tail]; rec->code = code; rec->session = session; rec->data = data; rec->time = (tANI_U16)vos_timer_get_system_time(); rec->module = module; gTraceData.numSinceLastDump ++; if(gTraceData.numSinceLastDump == gTraceData.dumpCount) { VOS_TRACE( VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, "Trace Dump last %d traces\n", gTraceData.dumpCount); macTraceDumpAll(pMac, 0, 0, gTraceData.dumpCount); gTraceData.numSinceLastDump = 0; } }