Skip to content
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

Fix #989, add local mutex to BSP console #992

Merged

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented May 7, 2021

Describe the contribution
Adds a generic mutex facility to the low level BSP. This is mainly for use with low level BSP console output, but could be used for other items that should only be accessed by one task at a time.

This needs to be actually implemented in the BSP layer, so it can be used by UtAssert report outputs (pass/fail message) in addition to OS_printf(). Note that UtAssert always uses the OSAL BSP and does its text output via this layer, but it does not necessarily use the full OSAL with its OS_printf/console abstraction. So by implementing the lock in the BSP, it works with all modes of operation.

This also converts OS_DEBUG outputs to use the same console output facility rather than calling fprintf() directly.

The combination of a mutex and all common print outputs (UtAssert, OS_printf, OS_DEBUG) going through the same
path makes the test output on VxWorks much more coherent.

Fixes #989

Testing performed
Build and sanity check CFE and run all unit tests on native and RTEMS. Also build and run select tests on VxWorks to confirm.

Expected behavior changes
Console Output when running UtAssert-based tests is not garbled, much more coherent and readable.

System(s) tested on
Ubuntu 20.04 (native)
RTEMS 4.11 (QEMU)
VxWorks 6.9 (MCP750)

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

@jphickey
Copy link
Contributor Author

jphickey commented May 7, 2021

For an example of what the VxWorks output looks like with this mutex in place, see gist here:

https://gist.github.com/jphickey/f6a92eca17346978618967f2e9657322

This is a complete log of a run of the "network-api-test" program. Compare to the excerpt from the original issue ticket.

@jphickey jphickey added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label May 7, 2021
@jphickey jphickey force-pushed the fix-989-console-debug-output branch from d754ebd to 5ff05e3 Compare May 7, 2021 19:16
Adds a real mutex for use with low level BSP console output.
This needs to be actually implemented in the BSP layer, so it
will be used by UtAssert outputs (pass/fail message) in addition
to OS_printf().

This also converts OS_DEBUG to use the same console output
rather than calling fprintf directly.

The combination of a mutex and all common print outputs
(UtAssert, OS_printf, OS_DEBUG) going through the same
path makes the test output on VxWorks much more coherent.
@astrogeco astrogeco changed the base branch from main to integration-candidate May 11, 2021 01:21
@astrogeco astrogeco merged commit 5998cd3 into nasa:integration-candidate May 11, 2021
@astrogeco astrogeco requested a review from a user May 11, 2021 17:36
astrogeco added a commit to nasa/cFS that referenced this pull request May 11, 2021
nasa/osal#992, add local mutex to BSP console

nasa/osal#993, do not require nonblock mode
@astrogeco astrogeco removed the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label May 12, 2021
@astrogeco
Copy link
Contributor

CCB:2021-05-12 APPROVED

astrogeco added a commit to nasa/cFS that referenced this pull request May 12, 2021
nasa/cFE#1492, cFE v6.8.0-rc1+dev575
nasa/osal#996, osal v5.1.0-rc1+dev434

nasa/cFE#1487, Remove broken travis-ci script
nasa/cFE#1463, generated coverage stubs for CFE core
nasa/cFE#1463, Move CFE_FS_RunBackgroundFileDump to internal API
nasa/cFE#1451, OSAL config file simplification
nasa/cFE#1489, removes --quiet option so files checked go to stdout

nasa/osal#978, configuration guide updates
nasa/osal#974, improve documentation of UtAssert API calls
nasa/osal#977, update OS_TaskCreate doc
nasa/osal#997, Enable cppcheck results output
nasa/osal#980, Scrub return values
nasa/osal#992, add local mutex to BSP console
nasa/osal#993, do not require nonblock mode
astrogeco added a commit to nasa/cFS that referenced this pull request May 12, 2021
nasa/cFE#1492, cFE v6.8.0-rc1+dev575
nasa/osal#996, osal v5.1.0-rc1+dev434

nasa/cFE#1487, Remove broken travis-ci script
nasa/cFE#1463, generated coverage stubs for CFE core
nasa/cFE#1463, Move CFE_FS_RunBackgroundFileDump to internal API
nasa/cFE#1451, OSAL config file simplification
nasa/cFE#1489, removes --quiet option so files checked go to stdout

nasa/osal#978, configuration guide updates
nasa/osal#974, improve documentation of UtAssert API calls
nasa/osal#977, update OS_TaskCreate doc
nasa/osal#997, Enable cppcheck results output
nasa/osal#980, Scrub return values
nasa/osal#992, add local mutex to BSP console
nasa/osal#993, do not require nonblock mode

Co-authored-by: Jacob Hageman <jacob.hageman@nasa.gov>
Co-authored-by: Joseph Hickey <joseph.p.hickey@nasa.gov>
@jphickey jphickey deleted the fix-989-console-debug-output branch May 14, 2021 13:55
@skliper skliper added this to the 6.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OS_DEBUG on VxWorks needs to use same BSP facility as OS_printf
3 participants