Fix `tasks` config flag guarding

custom
jacqueline 2 years ago
parent ba940baa0a
commit 95618239e6
  1. 28
      src/app_console/app_console.cpp

@ -338,11 +338,11 @@ void RegisterDbDump() {
} }
int CmdTasks(int argc, char** argv) { int CmdTasks(int argc, char** argv) {
if (!configUSE_TRACE_FACILITY) { #if (configUSE_TRACE_FACILITY == 0)
std::cout << "configUSE_TRACE_FACILITY must be enabled" << std::endl; std::cout << "configUSE_TRACE_FACILITY must be enabled" << std::endl;
std::cout << "also consider configTASKLIST_USE_COREID" << std::endl; std::cout << "also consider configTASKLIST_USE_COREID" << std::endl;
return 1; return 1;
} #endif
static const std::pmr::string usage = "usage: tasks"; static const std::pmr::string usage = "usage: tasks";
if (argc != 1) { if (argc != 1) {
@ -395,13 +395,13 @@ int CmdTasks(int argc, char** argv) {
str << "\t"; str << "\t";
} }
if (configTASKLIST_INCLUDE_COREID) { #if (configTASKLIST_INCLUDE_COREID == 1)
if (start_status[i].xCoreID == tskNO_AFFINITY) { if (start_status[i].xCoreID == tskNO_AFFINITY) {
str << "any\t"; str << "any\t";
} else { } else {
str << start_status[i].xCoreID << "\t"; str << start_status[i].xCoreID << "\t";
}
} }
#endif
str << std::fixed << std::setprecision(1) << depth_kib; str << std::fixed << std::setprecision(1) << depth_kib;
str << " KiB"; str << " KiB";
@ -424,9 +424,9 @@ int CmdTasks(int argc, char** argv) {
}); });
std::cout << "name\t\t"; std::cout << "name\t\t";
if (configTASKLIST_INCLUDE_COREID) { #if (configTASKLIST_INCLUDE_COREID == 1)
std::cout << "core\t"; std::cout << "core\t";
} #endif
std::cout << "free stack\trun time" << std::endl; std::cout << "free stack\trun time" << std::endl;
for (const auto& i : info_strings) { for (const auto& i : info_strings) {
std::cout << i.second << std::endl; std::cout << i.second << std::endl;

Loading…
Cancel
Save