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

Add common define MBED_ALL_STATS_ENABLED to enable all statistics #6784

Merged
merged 2 commits into from May 11, 2018

Conversation

Projects
None yet
7 participants
@deepikabhavnani
Contributor

deepikabhavnani commented May 1, 2018

Description

Requirement: All mbed OS statistics should be enabled with single macro MBED_ALL_STATS_ENABLED

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[X] Feature
[ ] Breaking change

CC @SenRamakri

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:mbed_stats_fix branch from 12ee317 to c98cfdd May 1, 2018

@0xc0170 0xc0170 requested review from bulislaw and SenRamakri May 2, 2018

@bulislaw

I don't like how the block is repeated multiple times, can we find a one place to do it? Config file would be good I guess.

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:mbed_stats_fix branch from c98cfdd to 0bfad60 May 2, 2018

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented May 2, 2018

@bulislaw @0xc0170 - I am confused with the usage of Stack and Heap macro. In case of stack we check if it is defined and true (https://github.com/ARMmbed/mbed-os/blob/master/rtos/TARGET_CORTEX/mbed_rtx_conf.h#L48) but in case of heap we just check if it is defined (https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed_alloc_wrappers.cpp#L49).

What is the correct behavior and should we have it consistent to both?

@bulislaw

This comment has been minimized.

Member

bulislaw commented May 2, 2018

What does our documentation says? I don't think it matters but id rather have it consistent.

Add common define to enable all statistics
As part of Device Health requirement, all mbed OS statistics should be
enabled with single macro `MBED_ALL_STATS_ENABLED`

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:mbed_stats_fix branch from 0bfad60 to 5a1c832 May 2, 2018

@deepikabhavnani deepikabhavnani referenced this pull request May 2, 2018

Merged

Thread stats API #6795

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented May 2, 2018

@studavekar - morph build and test is done with MBED_STACK_STATS_ENABLED and MBED_HEAP_STATS_ENABLED enabled. Should we move to MBED_ALL_STATS_ENABLED?

Please note few new features will come in with MBED_ALL_STATS_ENABLED like #6795.

@SenRamakri

This comment has been minimized.

Contributor

SenRamakri commented May 3, 2018

All STATS flag can start becoming unmanageable as we start adding more stats like CPU stats, errors etc. But I still would like to enable everything in one shot. Can we capture this using configuration system or may be in the mbedcli command line parser itself.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented May 3, 2018

@bulislaw @0xc0170 - I am confused with the usage of Stack and Heap macro. In case of stack we check if it is defined and true (https://github.com/ARMmbed/mbed-os/blob/master/rtos/TARGET_CORTEX/mbed_rtx_conf.h#L48) but in case of heap we just check if it is defined (https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed_alloc_wrappers.cpp#L49).

As I understand this: _ENABLED macro - if its defined, then its enabled. If not defined, disabled. Macros like we have in device_has are similar. If DEVICE is defined then its enabled.

If it was MBED_STATS_HEAP then I would assume it can have values - 0 or 1 (true/false)

All STATS flag can start becoming unmanageable as we start adding more stats like CPU stats, errors etc. But I still would like to enable everything in one shot. Can we capture this using configuration system or may be in the mbedcli command line parser itself.

Config named stats that would contain all these?

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented May 3, 2018

Can we capture this using configuration system or may be in the mbedcli command line parser itself.

Defines are set as part of command line only

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented May 3, 2018

As I understand this: _ENABLED macro - if its defined, then its enabled.

👍 Updated based on similar understanding

@deepikabhavnani deepikabhavnani requested review from bulislaw and 0xc0170 May 3, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented May 7, 2018

All STATS flag can start becoming unmanageable as we start adding more stats like CPU stats, errors etc. But I still would like to enable everything in one shot. Can we capture this using configuration system or may be in the mbedcli command line parser itself.

That would be a nice addition, we are currently have all these set as -D , also this PR.
Should this PR be blocked until, or this is good as it is and separate PR will propose a solution to status flags?

@SenRamakri

This comment has been minimized.

Contributor

SenRamakri commented May 7, 2018

@0xc0170 @deepikabhavnani - Well, I was thinking lets make the ALL Stats flag as MBED_CONF_ flag which can be used through config system. So, the preferred way ALL_STATS flag is enabled is through our config system. So, that we don't have to sprinkle that in our code multiple places.

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented May 7, 2018

. So, that we don't have to sprinkle that in our code multiple places.

Even if we append flags with MBED_CONF, we will still have to add it to code. I am not sure if we have mechanism to detect flag dependency and enable it in config system. @theotherjimmy - Correct me if I am wrong.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented May 7, 2018

@SenRamakri You do not nee an MBDE_CONF_ prefix to be a configuration value. @deepikabhavnani That really begs the question: Is it a good idea? Why would you expect a user to go through the process or turning on a configuration parameter just to make 5 more configuration parameters have an affect? Because one of the is the RTOS present flag, which a user never really touches.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented May 7, 2018

@deepikabhavnani The config system does not include anything about dependencies. It was designed to avoid the dependency resolution problem.

@cmonr cmonr added needs: work and removed needs: review labels May 7, 2018

@@ -45,7 +45,11 @@
#error "OS Tickrate must be 1000 for system timing"
#endif
#if !defined(OS_STACK_WATERMARK) && (defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED)
#if !defined(OS_STACK_WATERMARK) && defined(MBED_STACK_STATS_ENABLED)

This comment has been minimized.

@bulislaw

bulislaw May 9, 2018

Member

Do we need it duplicated? Can we use #if !defined(OS_STACK_WATERMARK) && (defined(MBED_ALL_STATS_ENABLED) || defined(MBED_STACK_STATS_ENABLED))

Add stats header file to mbed.h
All API header files should be part of mbed.h

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:mbed_stats_fix branch from 5a1c832 to 52c33b5 May 9, 2018

@deepikabhavnani deepikabhavnani requested a review from bulislaw May 9, 2018

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented May 9, 2018

@bulislaw @0xc0170 @SenRamakri - Please review

@0xc0170

0xc0170 approved these changes May 9, 2018

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented May 9, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented May 9, 2018

Build : SUCCESS

Build number : 1969
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6784/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented May 10, 2018

Retry export build

/morph export-build

@mbed-ci

This comment has been minimized.

@cmonr cmonr merged commit ab7a856 into ARMmbed:master May 11, 2018

13 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 845 warnings
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9051 cycles
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B
Details
travis-ci/tools Local tools testing has passed
Details

@cmonr cmonr removed the ready for merge label May 11, 2018

@deepikabhavnani deepikabhavnani deleted the deepikabhavnani:mbed_stats_fix branch May 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment