Skip to content

Conversation

@nordic-krch
Copy link
Contributor

Fixing compilation failure when LOG_MODULE_DECLARE() is used. Added test to cover usage of that macro.

One thing to note. With current scheme (LOG_MODULE_DECLARE/LOG_MODULE_REGISTER taking module name) it is forbidden to use LOG_MODULE_DECLARE() in headers thus logging in static inline function in header is impossible. That is because both macros creates static inline function with the same name: __log_current_dynamic_data_get().

Fixes #10026

@nordic-krch
Copy link
Contributor Author

fyi: @mbolivar @galak

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

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

Looks fine to me

Copy link
Contributor

@mbolivar mbolivar left a comment

Choose a reason for hiding this comment

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

Seems fine, tested locally, confirmed test_module.c compiles

@carlescufi
Copy link
Member

@nordic-krch seems some tests are running out of RAM with the patch, can you take a look and blacklist/whitelist/modify as required?

@nashif nashif force-pushed the log_module_declare_fix branch from b546871 to 543f693 Compare September 18, 2018 23:12
@codecov-io
Copy link

codecov-io commented Sep 18, 2018

Codecov Report

Merging #10045 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10045   +/-   ##
=======================================
  Coverage   52.96%   52.96%           
=======================================
  Files         214      214           
  Lines       26156    26156           
  Branches     5636     5636           
=======================================
  Hits        13853    13853           
  Misses      10030    10030           
  Partials     2273     2273

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 323243d...332e303. Read the comment docs.

Fix compilation failure when LOG_MODULE_DECLARE is used.

Signed-off-by: Krzysztof Chruscinski <[email protected]>
@nordic-krch nordic-krch force-pushed the log_module_declare_fix branch from 543f693 to 652f737 Compare September 19, 2018 04:52
@nordic-krch
Copy link
Contributor Author

@carlescufi its not ram size issue, it looks more like a compiler issue (https://app.shippable.com/github/zephyrproject-rtos/zephyr/runs/22615/5/console):

Unable to reach log_dynamic_test (at 0x004001f0) from the global pointer (at 0x00408628) because the offset (-33848) is out of the allowed range, -32678 to 32767.

There is plenty of ram but it seems like offset is limited to 32k. I've added altera_max10 and qemu_nios2 to platform_exlude list. Unless somebody knows how to fix it.

@nordic-krch nordic-krch force-pushed the log_module_declare_fix branch from 652f737 to 3357f9f Compare September 19, 2018 07:26
Extending log_core test suite to test LOG_MODULE_DECLARE() macro.

Signed-off-by: Krzysztof Chruscinski <[email protected]>
@nordic-krch nordic-krch force-pushed the log_module_declare_fix branch from 3357f9f to 332e303 Compare September 19, 2018 09:38
@nashif
Copy link
Member

nashif commented Sep 19, 2018

@nordic-krch

@carlescufi its not ram size issue, it looks more like a compiler issue

Can you open a bug about this so we do not lose track of it?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants