[riot-notifications] [RIOT-OS/RIOT] core/schedstatistics: fix call to uninitialized xtimer (#11781)

Francisco notifications at github.com
Wed Jul 3 15:32:42 CEST 2019


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description

<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->

This PR moves all the `schedstatistcs` code to a callback and makes uses of `sched_cb` to execute this callback every-time the `sched_run()` is called. 

An init function is added for `schedstatistcs` so that the callback isn't called before its dependency's have been started, in this case `xtimer`.

The `sched_cb` code is decoupled from the `schedstatistics` code as well.

### Testing procedure

Run:

    `make -C tests/ps_schedstatistics/ BOARD=samr21-xpro flash test`

still passes as well as other supported boards.

    `make -C tests/ps_schedstatistics/ BOARD=pba-d-01-kw2x flash test`

now passes, as well as for other kinetis boards (failed in master).

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

Related to https://github.com/RIOT-OS/RIOT/pull/11635
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11781

-- Commit Summary --

  * core/schedstatistics: refactor
  * core/sched: separate sched_cb from schedstatistics

-- File Changes --

    M Makefile.dep (1)
    M core/include/sched.h (10)
    M core/kernel_init.c (3)
    M core/sched.c (62)
    M makefiles/pseudomodules.inc.mk (1)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11781.patch
https://github.com/RIOT-OS/RIOT/pull/11781.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11781
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190703/8024af31/attachment.html>


More information about the notifications mailing list