Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mwierzbix
Copy link
Contributor

@mwierzbix mwierzbix commented Oct 3, 2018

Added macro functions to make repetitive, nearly identical functions more maintainable via metaprogramming. They generate code in pre-compile, conceptually similar to C++17 if-constexpr.
sof/trace, host/trace: rewrote _trace_events using preproc-metaprog.
test/cmocka/include/test_group_generator: rewrote macros to not conflict with new ones.
Additionally, added unit tests for lib/preproc.h, and debugability macros.

Signed-off-by: Michal Jerzy Wierzbicki [email protected]

@mwierzbix
Copy link
Contributor Author

From Travis

In file included from ../../src/include/sof/trace.h:42,
                 from ../../src/include/sof/interrupt.h:38,
                 from ../../src/include/sof/lock.h:42,
                 from ../../src/include/sof/dma.h:44,
                 from dma.c:31:
dma.c: In function 'dma_get':
../../src/include/sof/trace.h:253:16: error: '_trace_event4' undeclared (first use in this function); did you mean '_trace_event3'?
  __log_message(_trace_event##mbox##atomic, level, \

Now that was unexpected...

@mwierzbix mwierzbix force-pushed the debugability branch 2 times, most recently from 582c689 to 9c497ff Compare October 10, 2018 08:58
@lgirdwood
Copy link
Member

@mwierzbix build breakage.

@mwierzbix
Copy link
Contributor Author

@lgirdwood @akloniex PR ready to be merged.

@mwierzbix mwierzbix force-pushed the debugability branch 2 times, most recently from 4632119 to ef394a5 Compare October 16, 2018 11:50
@lgirdwood
Copy link
Member

@slawblauciak can you review the cmocka parts

Copy link
Collaborator

@slawblauciak slawblauciak left a comment

Choose a reason for hiding this comment

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

Looks good

@mwierzbix
Copy link
Contributor Author

@slawblauciak cmocka parts changed in new commit.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Minor formatting and could you remove the merge commit from the PR. Thanks,.

Added macro functions to make repetitive, nearly identical functions more maintainable via metaprogramming. They generate code in pre-compile, conceptually similar to C++17 if-constexpr.  sof/trace, host/trace: rewrote _trace_event/d+ functions using preproc.h. test/cmocka/include/test_group_generator: rewrote macros to not conflict with new ones. Added unit tests to check whether more advanced and less obvious macros do in fact work.

Signed-off-by: Michal Jerzy Wierzbicki <[email protected]>
@lgirdwood lgirdwood merged commit 33e4b99 into thesofproject:master Nov 2, 2018
@mwierzbix mwierzbix deleted the debugability branch November 5, 2018 09:25
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.

4 participants