Merge remote-tracking branch 'origin/master' into httpd

Conflicts:
	components/wifi-manager/http_server.c
This commit is contained in:
Sebastien
2020-02-24 16:15:34 -05:00
53 changed files with 2291 additions and 1698 deletions

View File

@@ -40,6 +40,55 @@ bool jack_inserted_svc(void);
void (*spkfault_handler_svc)(bool inserted);
bool spkfault_svc(void);
/****************************************************************************************
*
*/
static void task_stats( void ) {
#ifdef CONFIG_FREERTOS_USE_TRACE_FACILITY
static struct {
TaskStatus_t *tasks;
uint32_t total, n;
} current, previous;
current.n = uxTaskGetNumberOfTasks();
current.tasks = malloc( current.n * sizeof( TaskStatus_t ) );
current.n = uxTaskGetSystemState( current.tasks, current.n, &current.total );
static EXT_RAM_ATTR char scratch[128+1];
*scratch = '\0';
#ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS
uint32_t elapsed = current.total - previous.total;
for(int i = 0, n = 0; i < current.n; i++ ) {
for (int j = 0; j < previous.n; j++) {
if (current.tasks[i].xTaskNumber == previous.tasks[j].xTaskNumber) {
n += sprintf(scratch + n, "%16s %2u%% s:%5u", current.tasks[i].pcTaskName,
100 * (current.tasks[i].ulRunTimeCounter - previous.tasks[j].ulRunTimeCounter) / elapsed,
current.tasks[i].usStackHighWaterMark);
if (i % 3 == 2 || i == current.n - 1) {
ESP_LOGI(TAG, "%s", scratch);
n = 0;
}
break;
}
}
}
#else
for (int i = 0, n = 0; i < current.n; i ++) {
n += sprintf(scratch + n, "%16s s:%5u\t", current.tasks[i].pcTaskName, current.tasks[i].usStackHighWaterMark);
if (i % 3 == 2 || i == current.n - 1) {
ESP_LOGI(TAG, "%s", scratch);
n = 0;
}
}
#endif
if (previous.tasks) free(previous.tasks);
previous = current;
#endif
}
/****************************************************************************************
*
*/
@@ -49,6 +98,8 @@ static void monitor_callback(TimerHandle_t xTimer) {
heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL),
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
task_stats();
}
/****************************************************************************************