Remove useless DEBUG_TASKS (not supported on FreeRTOS) (#1448)
This commit is contained in:
@@ -1057,56 +1057,6 @@ void printInterrupts()
|
||||
}
|
||||
#endif //#if defined(DEBUG_INTERRUPTS)
|
||||
|
||||
#if defined(DEBUG_TASKS)
|
||||
void printTaskSwitchLog()
|
||||
{
|
||||
serialPrint("Tasks legend [<task_id>, <task name>]:");
|
||||
for(int n = 0; n <= CFG_MAX_USER_TASKS+1; n++) {
|
||||
if (0 == n) {
|
||||
serialPrint("%d: Idle", n);
|
||||
}
|
||||
if (cliTaskId == n) {
|
||||
serialPrint("%d: CLI", n);
|
||||
}
|
||||
else if (menusTaskId == n) {
|
||||
serialPrint("%d: menus", n);
|
||||
}
|
||||
else if (mixerTaskId == n) {
|
||||
serialPrint("%d: mixer", n);
|
||||
}
|
||||
else if (audioTaskId == n) {
|
||||
serialPrint("%d: audio", n);
|
||||
}
|
||||
}
|
||||
serialCrlf();
|
||||
|
||||
serialPrint("Tasks switch log at %u [<time>, <task_id>]:", get_tmr10ms());
|
||||
uint32_t lastSwitchTime = 0;
|
||||
uint32_t * tsl = new uint32_t[DEBUG_TASKS_LOG_SIZE];
|
||||
if (!tsl) {
|
||||
serialPrint("Not enough memory");
|
||||
return;
|
||||
}
|
||||
memcpy(tsl, taskSwitchLog, sizeof(taskSwitchLog));
|
||||
uint32_t * p = tsl + taskSwitchLogPos;
|
||||
uint32_t * end = tsl + DEBUG_TASKS_LOG_SIZE;
|
||||
for(int n = 0; n < DEBUG_TASKS_LOG_SIZE; n++) {
|
||||
uint32_t taskId = *p >> 24;
|
||||
uint32_t switchTime = *p & 0xFFFFFF;
|
||||
if (lastSwitchTime != switchTime) {
|
||||
serialPrintf("\r\n%06x: ", switchTime);
|
||||
lastSwitchTime = switchTime;
|
||||
}
|
||||
serialPrintf("%u ", taskId);
|
||||
if ( ++p >= end ) {
|
||||
p = tsl;
|
||||
}
|
||||
}
|
||||
delete[] tsl;
|
||||
serialCrlf();
|
||||
}
|
||||
#endif // #if defined(DEBUG_TASKS)
|
||||
|
||||
#if defined(DEBUG_TIMERS)
|
||||
void printDebugTime(uint32_t time)
|
||||
{
|
||||
@@ -1277,11 +1227,6 @@ int cliDisplay(const char ** argv)
|
||||
printInterrupts();
|
||||
}
|
||||
#endif
|
||||
#if defined(DEBUG_TASKS)
|
||||
else if (!strcmp(argv[1], "tsl")) {
|
||||
printTaskSwitchLog();
|
||||
}
|
||||
#endif
|
||||
#if defined(DEBUG_TIMERS)
|
||||
else if (!strcmp(argv[1], "dt")) {
|
||||
printDebugTimers();
|
||||
|
||||
@@ -177,32 +177,6 @@ void dumpTraceBuffer()
|
||||
struct InterruptCounters interruptCounters;
|
||||
#endif //#if defined(DEBUG_INTERRUPTS)
|
||||
|
||||
#if defined(DEBUG_TASKS)
|
||||
|
||||
uint32_t taskSwitchLog[DEBUG_TASKS_LOG_SIZE] __SDRAM;
|
||||
uint16_t taskSwitchLogPos;
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @brief Hook for task switch logging
|
||||
* @param[in] taskID Task which is now in RUNNING state
|
||||
* @retval None
|
||||
*
|
||||
* @par Description
|
||||
* @details This function logs the time when a task entered the RUNNING state.
|
||||
*******************************************************************************
|
||||
*/
|
||||
void CoTaskSwitchHook(uint8_t taskID)
|
||||
{
|
||||
/* Log task switch here */
|
||||
taskSwitchLog[taskSwitchLogPos] = (taskID << 24) + ((uint32_t)CoGetOSTime() & 0xFFFFFF);
|
||||
if(++taskSwitchLogPos >= DEBUG_TASKS_LOG_SIZE) {
|
||||
taskSwitchLogPos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // #if defined(DEBUG_TASKS)
|
||||
|
||||
#if defined(DEBUG_TIMERS)
|
||||
|
||||
void DebugTimer::start()
|
||||
|
||||
@@ -322,25 +322,6 @@ extern struct InterruptCounters interruptCounters;
|
||||
|
||||
#endif //#if defined(DEBUG_INTERRUPTS)
|
||||
|
||||
#if defined(DEBUG_TASKS)
|
||||
|
||||
#define DEBUG_TASKS_LOG_SIZE 512
|
||||
|
||||
// each 32bit is used as:
|
||||
// top 8 bits: task id
|
||||
// botom 24 bits: system tick counter
|
||||
extern uint32_t taskSwitchLog[DEBUG_TASKS_LOG_SIZE];
|
||||
extern uint16_t taskSwitchLogPos;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void CoTaskSwitchHook(uint8_t taskID);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // #if defined(DEBUG_TASKS)
|
||||
|
||||
|
||||
#if defined(DEBUG_TIMERS)
|
||||
|
||||
@@ -21,7 +21,6 @@ option(MULTIMODULE "DIY Multiprotocol TX Module (https://github.com/pascallanger
|
||||
option(DEBUG_INTERRUPTS "Count interrupts" OFF)
|
||||
option(DEBUG_LATENCY "Debug latency" OFF)
|
||||
option(DEBUG_USB_INTERRUPTS "Count individual USB interrupts" OFF)
|
||||
option(DEBUG_TASKS "Task switching statistics" OFF)
|
||||
option(DEBUG_TIMERS "Time critical parts of the code" OFF)
|
||||
option(DEBUG_BLUETOOTH "Debug Bluetooth" OFF)
|
||||
|
||||
@@ -117,11 +116,6 @@ if(DEBUG_INTERRUPTS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEBUG_TASKS)
|
||||
add_definitions(-DDEBUG_TASKS)
|
||||
set(DEBUG ON)
|
||||
endif()
|
||||
|
||||
if(DEBUG_TIMERS)
|
||||
add_definitions(-DDEBUG_TIMERS)
|
||||
set(DEBUG ON)
|
||||
|
||||
Reference in New Issue
Block a user