-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EVS "CFE_PLATFORM_EVS_LOG_ON" option unit test failure #609
Comments
For CCB discussion - can we remove/deprecate the |
Not having dug into the code, what would be the behavior if LOG_MAX is defined to 0? |
That creates a different compile time failure, because it is used to size an array. The lower limit is 1. We could conditionally compile based on Interestingly, due to the way the "reset area" is allocated, unless you also manually reduced this size when turning off the EVS log feature, the full size is allocated anyway. See #610. |
Another possible option would be to keep the option but only use it to initialize the runtime boolean. ( This would be a lower impact change, but it solves the issue of having these fields present in the global but left uninitialized, which IMO is risky. They should always be initialized. |
Lame hack: MAX = 0, array[MAX+1] |
@acudmore - CCB discussed, agreed removing this option is low impact and not a requirement to be optional |
Should we just Or could add a |
Fix #609, Remove CFE_PLATFORM_EVS_LOG_ON undefined option to diasble log
Describe the bug
The Event Services subsystem has a broken compile-time platform option called
CFE_PLATFORM_EVS_LOG_ON
. The description says: "The CFE_PLATFORM_EVS_LOG_ON configuration parameter must be defined to enable EVS event logging"If UT is disabled, then CFE core itself actually seems to build and run OK. However, certain risky things are not clear in the code that:
EVS_SharedDataMutexID
will be left uninitializedEVS_LogPtr
will be left as NULLThe code that accesses these seems to be mostly protected by checking the separate
CFE_EVS_GlobalData.EVS_TlmPkt.Payload.LogEnabled
member boolean in the outgoing telemetry packet. This seems like a weak design, in particular because the telemetry packet is supposed to be informational, not an active control structure.To Reproduce
Disable the
CFE_PLATFORM_EVS_LOG_ON
option, and build withENABLE_UNIT_TESTS=TRUE
. CFE EVS unit test fails to build with a compiler error.System observed on:
Ubuntu 18.04 LTS 64 bit.
Additional context
Unless there is a specific requirement for
CFE_PLATFORM_EVS_LOG_ON
as it stands today, my recommendation would be to deprecate this option and keep it always on, which reduces the testing matrix, and makes the FSW code more consistent. Platform config options that actually add/remove#ifdef
code should be avoided, as this has proven to be a testing/support issue time and time again.In this case, only the code that initializes the structures is compiled out. All the code that reads/writes to it is still compiled in, but skipped via a runtime test. So this isn't saving much in the way of code/text space.
If the goal of this option is to save data space memory, then mostly the same effect can be achieved by keeping the log very small, by setting
CFE_PLATFORM_EVS_LOG_MAX
to a very low number, such as 1. In this mode the log structure uses only 176 bytes of memory on an x86-64 machine, down from 3368 bytes with the default size of 20.And the unit tests still build and pass with the max set to 1, and it reduces the amount of conditionally-compiled code and variances on the FSW side.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: