-
Notifications
You must be signed in to change notification settings - Fork 217
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 #1281, Rtems On task creation register name. #1282
Conversation
CCB 25 Aug 2022: Need to test in RTEMS on our end, have someone review. |
I did this wrong, The functions starting with |
I guess the pthread setname does the same |
Replaced call to _Thread_set_name() with a call to rtems_object_set_name() |
aed764b
to
aeef62c
Compare
CCB 6 October 2022: Need to verify that this still works in RTEMS 4.11. @travis-r-wheatley will check which version of RTEMS he tested with. |
Verified that RTEMS 6 was used for testing. |
@dzbaker This function call exists in the 4.11 version of rtems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @thesamprice and @travis-r-wheatley, this looks great! I ran the unit test suite on RTEMS 5 and did come across a few new unit test failures:
oscore-test:
[ FAIL] 42.001 ut_oscore_task_test.c:500 - OS_TaskGetId() (0) == 65608
[ FAIL] 39.001 ut_oscore_task_test.c:379 - OS_TaskGetInfo(g_task_ids[1], &task_prop) (0) == OS_ERR_INVALID_ID (-16)
[ FAIL] 38.002 ut_oscore_task_test.c:316 - OS_TaskInstallDeleteHandler() (-16) == OS_SUCCESS
[ FAIL] 38.003 ut_oscore_task_test.c:317 - OS_TaskInstallDeleteHandler() callback invoked
Would you be able to look into these? I will be creating an RTEMS Unit Test workflow for OSAL, so that should make it easier to check in the future.
@dzbaker Did this pass on the current dev/main branch or is this branch the first to run the test suite. |
@thesamprice I had run this on both the current main branch and 1281-rtems-task-names. The 4 failures only showed up for me on 1281-rtems-task-names (there were other failures in other tests, but those occurred in the main branch as well). These 4 failures also didn't show up several weeks ago when I ran the unit tests on the original commit for this PR. |
@dzbaker I think this should be scanning through and using |
I'm not quite sure. @skliper @dmknutsen, would you know? |
Just took a quick skim... and yeah, if you are changing the name this get task id implementation won't work. Maybe a pattern like the Linux or VxWorks implementation makes more sense? I'd start there for ideas. |
Confirm that the classic RTEMS task name is already used for the purpose of keeping the OSAL ID - this cannot be changed without breaking stuff. On the original review I thought there was an alternate name that this was setting. Note that classic RTEMS task "names" here are only 4 characters long, so they really aren't that useful for human/user friendly consumption. They are too short for anything like that. But they are big enough to be useful for stashing the OSAL ID. The whole point of stashing the OSAL ID this way was to avoid searching through the table. As a result the current implementation of
If this current name lookup is replaced with a search, then the whole thing needs to be done under lock, and that will have a serious increase on the time cost of this call. |
CCB:2023-03-09: Will not merge. |
Checklist (Please check before submitting)
Describe the contribution
Registers task name with rtems on creation
Fixes #1281
Testing performed
Steps taken to test the contribution:
Ran on microblaze, typed cpuuse in rtems task, saw names.
Expected behavior changes
A clear and concise description of how this contribution will change behavior and level of impact.
System(s) tested on
Additional context
Add any other context about the contribution here.
Third party code
If included, identify any third party code and provide text file of license
Contributor Info - All information REQUIRED for consideration of pull request
Nasa/ GSFC