Skip to content

Commit a44321d

Browse files
committed
main: remove trace facilities
1 parent 04d0dd3 commit a44321d

File tree

1 file changed

+2
-53
lines changed

1 file changed

+2
-53
lines changed

main/main.c

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -315,47 +315,6 @@ shell_end_cb(void) {
315315

316316
#endif /* CONFIG_MENDER_CLIENT_ADD_ON_TROUBLESHOOT */
317317

318-
#if configUSE_TRACE_FACILITY == 1
319-
320-
/**
321-
* @brief Print FreeRTOS stats
322-
*/
323-
static void
324-
print_stats(void) {
325-
326-
/* Take a snapshot of the number of tasks in case it changes while this function is executing */
327-
volatile UBaseType_t uxArraySize = uxTaskGetNumberOfTasks();
328-
329-
/* Allocate a TaskStatus_t structure for each task */
330-
TaskStatus_t *pxTaskStatusArray = pvPortMalloc(uxArraySize * sizeof(TaskStatus_t));
331-
if (NULL != pxTaskStatusArray) {
332-
333-
/* Generate raw status information about each task */
334-
uxArraySize = uxTaskGetSystemState(pxTaskStatusArray, uxArraySize, NULL);
335-
336-
/* For each populated position in the pxTaskStatusArray array, format the raw data as human readable ASCII data */
337-
printf("--------------------------------------------------------\n");
338-
printf("Task Name | Stack High Water Mark\n");
339-
printf("--------------------------------------------------------\n");
340-
for (UBaseType_t index = 0; index < uxArraySize; index++) {
341-
printf("%15s | %u bytes\n",
342-
pxTaskStatusArray[index].pcTaskName,
343-
(unsigned int)pxTaskStatusArray[index].usStackHighWaterMark * sizeof(configSTACK_DEPTH_TYPE));
344-
}
345-
346-
/* Release memory */
347-
vPortFree(pxTaskStatusArray);
348-
}
349-
350-
/* Print usage of the heap */
351-
printf("--------------------------------------------------------\n");
352-
printf("Free Heap Size: %u bytes\n", (unsigned int)xPortGetFreeHeapSize());
353-
printf("Minimum Ever Free Heap Size: %u bytes\n", (unsigned int)xPortGetMinimumEverFreeHeapSize());
354-
printf("--------------------------------------------------------\n");
355-
}
356-
357-
#endif /* configUSE_TRACE_FACILITY == 1 */
358-
359318
/**
360319
* @brief Main function
361320
*/
@@ -474,18 +433,8 @@ app_main(void) {
474433
}
475434
#endif /* CONFIG_MENDER_CLIENT_ADD_ON_INVENTORY */
476435

477-
/* Infinite loop, print stats periodically */
478-
EventBits_t event = 0;
479-
while (!event) {
480-
481-
#if configUSE_TRACE_FACILITY == 1
482-
/* Print stats */
483-
print_stats();
484-
#endif /* configUSE_TRACE_FACILITY == 1 */
485-
486-
/* Wait before next snapshot or the application shutdown */
487-
event = xEventGroupWaitBits(mender_client_events, MENDER_CLIENT_EVENT_RESTART, pdTRUE, pdFALSE, 10000 / portTICK_PERIOD_MS);
488-
}
436+
/* Wait for mender-mcu-client events */
437+
xEventGroupWaitBits(mender_client_events, MENDER_CLIENT_EVENT_RESTART, pdTRUE, pdFALSE, portMAX_DELAY);
489438

490439
/* Deactivate mender add-ons */
491440
#ifdef CONFIG_MENDER_CLIENT_ADD_ON_TROUBLESHOOT

0 commit comments

Comments
 (0)