Skip to content

Remove mbed_trace dependency to Nanomesh headers #11408

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

Merged
merged 2 commits into from
Sep 6, 2019

Conversation

SeppoTakalo
Copy link
Contributor

@SeppoTakalo SeppoTakalo commented Sep 4, 2019

Description

This library only uses standard types from C99, and
thus does not need compiler specific tweaks from ns_types.h

Reason for dropping the Nanomesh header from mbed-trace, is that it now allows applications to use tracing library in BareMetal builds without dependency to Nanomesh.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@kjbracey-arm

Release Notes

@kjbracey
Copy link
Contributor

kjbracey commented Sep 4, 2019

My recollection is that the ns_types.h was to overcome some compiler glitches in stdint etc on some platforms (and maybe silence some compiler warnings?). Not sure if it's still needed.

Probably can be removed here. ns_trace.h compatibility glue could maybe add it, so ns_trace.h includes ns_types.h then mbed_trace.h?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 5, 2019

Probably can be removed here. ns_trace.h compatibility glue could maybe add it, so ns_trace.h includes ns_types.h then mbed_trace.h?

@SeppoTakalo What do you think?

This library only uses standard types from C99, and
thus does not need compiler specific tweaks from ns_types.h
@SeppoTakalo
Copy link
Contributor Author

I'm not sure there is anything in particular that the tracing library itself depends on from ns_types.h

To my understanding, the header itself only uses standard types uint8_t etc.. Users of this library might use PRIx32 and those macros, but should they rely on mbed-trace.h to include those? not sure.. I added the <inttypes.h> here anyway.

I would like to push this as is, as we would like to use this in bare metal builds. Its a bit annoying to require: ['nanomesh'] when all we need is standard headers.

@SeppoTakalo
Copy link
Contributor Author

The littlefs tests seemed to fail, because this is not in: https://github.com/ARMmbed/mbed-os/pull/11419/files

Not sure why, but they seems to somehow include mbed-trace.h, and as a consequence they include <inttypes.h> as well.

@kjbracey
Copy link
Contributor

kjbracey commented Sep 6, 2019

Users of this library might use PRIx32 and those macros, but should they rely on mbed-trace.h to include those?

The issue was more subtle, as I recall - including stdint.h "bare" could mess up later users - eg not defining __STDC_LIMIT_MACROS before doing it. We were trying to centralise those headers into one include that made sure they were always included in a controlled way on first include from a Nanostack source file.

IIRC, all nanostack files include "ns_trace.h" rather than "mbed_trace.h", so if that is modified to include "ns_types.h" first before including "mbed_trace.h", then this change should be 100% solid from Nanostack's PoV.

@mbed-ci
Copy link

mbed-ci commented Sep 6, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 6, 2019

IIRC, all nanostack files include "ns_trace.h" rather than "mbed_trace.h", so if that is modified to include "ns_types.h" first before including "mbed_trace.h", then this change should be 100% solid from Nanostack's PoV.

@SeppoTakalo this PR needs na update or is it good as it is (nanostack is being updated in separate PR and does not have anything related to this PR, correct?)

@kjbracey
Copy link
Contributor

kjbracey commented Sep 6, 2019

This incorporates my requested change to Nanostacklibservice. Shouldn't conflict with the incoming Nanostack PR, assuming they're not touching this file. Change can be backported to libservice main repo via standard subtree synch mechanism in future.

@SeppoTakalo
Copy link
Contributor Author

SeppoTakalo commented Sep 6, 2019

@0xc0170 this is now good to go.

Not a high priority, but if this still can, I would prefer to have it already in RC2 or RC3, however, if not possible, the next patch release is acceptable as well.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 6, 2019

CI started

@adbridge
Copy link
Contributor

adbridge commented Sep 6, 2019

@0xc0170 this is now good to go.

Not a high priority, but if this still can, I would prefer to have it already in RC2 or RC3, however, if not possible, the next patch release is acceptable as well.

Follow on RCs should really only be used for blocking / critical fixes. As this appears to be neither and we already have 'too' many things going to RC2, I think this needs to go to 5.14.1.

@mbed-ci
Copy link

mbed-ci commented Sep 6, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit 87cdef9 into ARMmbed:master Sep 6, 2019
@SeppoTakalo SeppoTakalo deleted the mbed_trace_nanomesh branch September 6, 2019 15:47
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.

5 participants