Skip to content

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

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 1 commit into from
Oct 29, 2019

Conversation

jeromecoutant
Copy link
Collaborator

@jeromecoutant 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 a team October 16, 2019 11:00
@ciarmcom
Copy link
Member

@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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

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 October 28, 2019 09:41
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 28, 2019

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

@mbed-ci
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 jamesbeyond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look Good

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.

6 participants