Thread Tracing and Scheduling Update #379

Merged
muellerr merged 11 commits from thread_tracing into develop 2023-02-14 15:59:12 +01:00
3 changed files with 56 additions and 70 deletions
Showing only changes of commit ecb22bdd85 - Show all commits

View File

@ -154,6 +154,14 @@ void scheduling::initTasks() {
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("PL_SUBSYSTEM", objects::PL_SUBSYSTEM); scheduling::printAddObjectError("PL_SUBSYSTEM", objects::PL_SUBSYSTEM);
} }
result = genericSysTask->addComponent(objects::INTERNAL_ERROR_REPORTER);
if (result != returnvalue::OK) {
scheduling::printAddObjectError("ERROR_REPORTER", objects::INTERNAL_ERROR_REPORTER);
}
result = genericSysTask->addComponent(objects::PUS_SERVICE_17_TEST);
if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_17", objects::PUS_SERVICE_17_TEST);
}
#if OBSW_ADD_CCSDS_IP_CORES == 1 #if OBSW_ADD_CCSDS_IP_CORES == 1
result = genericSysTask->addComponent(objects::CCSDS_HANDLER); result = genericSysTask->addComponent(objects::CCSDS_HANDLER);
@ -266,14 +274,16 @@ void scheduling::initTasks() {
#endif /* OBSW_ADD_PLOC_SUPERVISOR */ #endif /* OBSW_ADD_PLOC_SUPERVISOR */
PeriodicTaskIF* plTask = factory->createPeriodicTask( PeriodicTaskIF* plTask = factory->createPeriodicTask(
"PL_TASK", 25, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); "PL_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
scheduling::addMpsocSupvHandlers(plTask);
plTask->addComponent(objects::CAM_SWITCHER); plTask->addComponent(objects::CAM_SWITCHER);
scheduling::addMpsocSupvHandlers(plTask);
#if OBSW_ADD_SCEX_DEVICE == 1
scheduling::scheduleScexDev(plTask);
#endif
#if OBSW_ADD_SCEX_DEVICE == 1 #if OBSW_ADD_SCEX_DEVICE == 1
PeriodicTaskIF* scexDevHandler;
PeriodicTaskIF* scexReaderTask; PeriodicTaskIF* scexReaderTask;
scheduling::schedulingScex(*factory, scexDevHandler, scexReaderTask); scheduling::scheduleScexReader(*factory, scexReaderTask);
#endif #endif
std::vector<PeriodicTaskIF*> pusTasks; std::vector<PeriodicTaskIF*> pusTasks;
@ -330,7 +340,6 @@ void scheduling::initTasks() {
taskStarter(pstTasks, "PST task vector"); taskStarter(pstTasks, "PST task vector");
taskStarter(pusTasks, "PUS task vector"); taskStarter(pusTasks, "PUS task vector");
#if OBSW_ADD_SCEX_DEVICE == 1 #if OBSW_ADD_SCEX_DEVICE == 1
scexDevHandler->startTask();
scexReaderTask->startTask(); scexReaderTask->startTask();
#endif #endif
@ -435,42 +444,28 @@ void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction
std::vector<PeriodicTaskIF*>& taskVec) { std::vector<PeriodicTaskIF*>& taskVec) {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
/* PUS Services */ /* PUS Services */
PeriodicTaskIF* pusVerification = factory.createPeriodicTask( PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask(
"PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); "PUS_HIGH_PRIO", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION); result = pusHighPrio->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_VERIF", objects::PUS_SERVICE_1_VERIFICATION); scheduling::printAddObjectError("PUS_VERIF", objects::PUS_SERVICE_1_VERIFICATION);
} }
taskVec.push_back(pusVerification); result = pusHighPrio->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
PeriodicTaskIF* pusEvents = factory.createPeriodicTask(
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
result = pusEvents->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING); scheduling::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING);
} }
result = pusEvents->addComponent(objects::EVENT_MANAGER); result = pusHighPrio->addComponent(objects::EVENT_MANAGER);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER); scheduling::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER);
} }
taskVec.push_back(pusEvents);
PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask(
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
}
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT); result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_9", objects::PUS_SERVICE_9_TIME_MGMT); scheduling::printAddObjectError("PUS_9", objects::PUS_SERVICE_9_TIME_MGMT);
} }
taskVec.push_back(pusHighPrio); taskVec.push_back(pusHighPrio);
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask( PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); "PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_3", objects::PUS_SERVICE_3_HOUSEKEEPING); scheduling::printAddObjectError("PUS_3", objects::PUS_SERVICE_3_HOUSEKEEPING);
@ -495,20 +490,11 @@ void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH); scheduling::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH);
} }
// Used for connection tests, therefore use higher priority result = pusMedPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
result = pusMedPrio->addComponent(objects::PUS_SERVICE_17_TEST);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("PUS_17", objects::PUS_SERVICE_17_TEST); scheduling::printAddObjectError("PUS_2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
} }
taskVec.push_back(pusMedPrio); taskVec.push_back(pusMedPrio);
PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask(
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER);
if (result != returnvalue::OK) {
scheduling::printAddObjectError("ERROR_REPORTER", objects::INTERNAL_ERROR_REPORTER);
}
taskVec.push_back(pusLowPrio);
} }
void scheduling::createTestTasks(TaskFactory& factory, void scheduling::createTestTasks(TaskFactory& factory,

View File

@ -8,8 +8,7 @@
#include "ObjectFactory.h" #include "ObjectFactory.h"
#include "eive/objects.h" #include "eive/objects.h"
void scheduling::schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHandler, void scheduling::scheduleScexReader(TaskFactory& factory, PeriodicTaskIF*& scexReaderTask) {
PeriodicTaskIF*& scexReaderTask) {
using namespace scheduling; using namespace scheduling;
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
#if OBSW_PRINT_MISSED_DEADLINES == 1 #if OBSW_PRINT_MISSED_DEADLINES == 1
@ -17,37 +16,6 @@ void scheduling::schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHa
#else #else
void (*missedDeadlineFunc)(void) = nullptr; void (*missedDeadlineFunc)(void) = nullptr;
#endif #endif
scexDevHandler = factory.createPeriodicTask(
"SCEX_DEV", 35, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc);
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::PERFORM_OPERATION);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_WRITE);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_WRITE);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = returnvalue::OK; result = returnvalue::OK;
scexReaderTask = factory.createPeriodicTask( scexReaderTask = factory.createPeriodicTask(
@ -79,3 +47,35 @@ void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) {
plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ);
#endif #endif
} }
void scheduling::scheduleScexDev(PeriodicTaskIF*& scexDevHandler) {
ReturnValue_t result =
scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::PERFORM_OPERATION);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_WRITE);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_WRITE);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ);
if (result != returnvalue::OK) {
printAddObjectError("SCEX_DEV", objects::SCEX);
}
}

View File

@ -3,7 +3,7 @@
#include <fsfw/tasks/TaskFactory.h> #include <fsfw/tasks/TaskFactory.h>
namespace scheduling { namespace scheduling {
void schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHandler, void scheduleScexDev(PeriodicTaskIF*& scexDevHandler);
PeriodicTaskIF*& scexReaderTask); void scheduleScexReader(TaskFactory& factory, PeriodicTaskIF*& scexReaderTask);
void addMpsocSupvHandlers(PeriodicTaskIF* task); void addMpsocSupvHandlers(PeriodicTaskIF* task);
} // namespace scheduling } // namespace scheduling