-
Notifications
You must be signed in to change notification settings - Fork 349
debugability: extract fw_version and copy it to .ldc file #512
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
Conversation
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you have not squashed changes ?
7663ce9 to
67bff6a
Compare
This is done in order to place fw_version, part of fw_ready message, in both .ri and .ldc files, for later verification of compatibility of trace logs reported by dsp with .ldc file parsed together by logger. Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
67bff6a to
69c9da3
Compare
|
|
||
| static const struct sof_ipc_fw_ready ready = { | ||
| static const struct sof_ipc_fw_ready ready | ||
| __attribute__((section(".fw_ready"))) = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just move to end of definition (like Linux) and we are good to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly in line with kernel examples:
e.g.: in macro expansion from include/linux/kernel.h:
#define ftrace_vprintk(fmt, vargs) \ do { \ if (__builtin_constant_p(fmt)) { \ static const char *trace_printk_fmt __used \ __attribute__((section("__trace_printk_fmt"))) = \ __builtin_constant_p(fmt) ? fmt : NULL; \ \ __ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \ } else \ __ftrace_vprintk(_THIS_IP_, fmt, vargs); \ } while (0)
It is a variable attribute, and cannot be placed after assignment operator, otherwise it will not compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, it seems we can do this where we define but not declare...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that it is defined and declared in the same statement.
I could split it into 2 separate statements if you'd like, but it seems redundant to me.
|
|
||
| static const struct sof_ipc_fw_ready ready = { | ||
| static const struct sof_ipc_fw_ready ready | ||
| __attribute__((section(".fw_ready"))) = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, it seems we can do this where we define but not declare...
|
@akloniex oh just a few checkpatch errors for alignment. |
Extract fw_version from fw_ready section of elf and include it in header of .ldc file to allow verification by sof-logger. Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
69c9da3 to
0f3f9c0
Compare
|
@lgirdwood I've corrected alignment. |
In order to verify that running FW version is compatible with .ldc file parsed by sof-logger we need to extract fw_version from fw_ready message. This is done by moving fw_ready to separate elf section attached to sof_data memory region and pasting it to both .ri and .ldc files during rimage processing.