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

GREENTEA: init trace if trace is enabled in json #11695

Merged
merged 1 commit into from Oct 29, 2019

Conversation

@jeromecoutant
Copy link
Contributor

jeromecoutant commented Oct 16, 2019

Description

Hi

I was interested to enable mbed trace feature.

I can read that someone has to call the trace initialization function.
https://github.com/ARMmbed/mbed-os/blame/master/features/frameworks/mbed-trace/README.md#L56

Proposition is to init trace within GREENTEA_SETUP call.

Thx

Example of mbed_app.json:

{
    "target_overrides": {
        "*": {
            "mbed-trace.enable": "1",
            "mbed-trace.max-level": "TRACE_LEVEL_INFO"
        },
    }
}

Pull request type

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

Reviewers

Release Notes

@ciarmcom ciarmcom requested a review from ARMmbed/mbed-os-maintainers Oct 16, 2019
@ciarmcom

This comment has been minimized.

Copy link
Member

ciarmcom commented Oct 16, 2019

@jeromecoutant, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@@ -84,6 +84,10 @@ void _GREENTEA_SETUP_COMMON(const int timeout, const char *host_test_name, char
}
}

#ifdef MBED_CONF_MBED_TRACE_ENABLE
mbed_trace_init();

This comment has been minimized.

Copy link
@0xc0170

0xc0170 Oct 17, 2019

Member

It might be seen as nice to have but not certain enabling trace would add also this call by default to greentea. It is known that this call needs to come from an app if tracing is used.

cc @SeppoTakalo

@SeppoTakalo

This comment has been minimized.

Copy link
Contributor

SeppoTakalo commented Oct 28, 2019

Mbed Trace API is a bit odd, as it does not automatically initialize itself.
Having application to call it, is a bit annoying, but acceptable.

However, test cases are a bit different. There is common boilerplate that everyone follows. Pushing trace_init() there is just annoyance that I would happily avoid, and therefore I would accept this as a good workaround.

I think there is value on allowing traces to be turned on easily from test config.

@0xc0170 0xc0170 requested a review from jamesbeyond Oct 28, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 28, 2019

I'll run CI meanwhile (@jamesbeyond Please review)

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 28, 2019

Test run: SUCCESS

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

Copy link
Contributor

jamesbeyond left a comment

Look Good

@0xc0170 0xc0170 merged commit f1392d6 into ARMmbed:master Oct 29, 2019
25 checks passed
25 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8651 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8464B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
@jeromecoutant jeromecoutant deleted the jeromecoutant:PR_GREENTEA_TRACE branch Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.