Skip to content

Conversation

@serhiy-katsyuba-intel
Copy link
Contributor

First commit is borrowed from Adrian Bonislawski abonislawski@e5b45c6 -- this is to port probe component to use Zephyr DMA stuff.

Rest are fixes required for probes to work properly.

Additionally, this zephyr_ll scheduler fix is required for injection probes not to cause FW panic: #7988

Copy link
Contributor

@btian1 btian1 left a comment

Choose a reason for hiding this comment

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

QB still have failed case, please check.

Copy link
Contributor

Choose a reason for hiding this comment

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

just a suggestion, use one #if from line 264 - 277, this can remove one more "#if #else #endif", overhead is duplicated err message.

Copy link
Collaborator

Choose a reason for hiding this comment

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

just a suggestion, use one #if from line 264 - 277, this can remove one more "#if #else #endif", overhead is duplicated err message.

@btian1 The difference is purely for the reader - the compilation result is the same. And in its present form the difference between the two cases is easier to see, so, I'd keep it as is. In general, however, yes, the fewer preprocessor conditionals we use, especially in .c, the better

@serhiy-katsyuba-intel serhiy-katsyuba-intel force-pushed the en_probes branch 2 times, most recently from e891dbf to d1098ae Compare August 2, 2023 13:20
This patch ports probe component to use zephyr native drivers.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
@serhiy-katsyuba-intel serhiy-katsyuba-intel force-pushed the en_probes branch 3 times, most recently from 2334def to 3fb4aed Compare August 4, 2023 07:46
@tmleman
Copy link
Contributor

tmleman commented Aug 8, 2023

The only thing I would change are commit titles. This [MTL] is especially eye-catching.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Thanks @serhiy-katsyuba-intel , looks good. Can you update the commit prefixes to align with existing style?


/* return if no bytes */
if (!bytes) {
#if CONFIG_SOF_LOG_DBG_BUFFER
Copy link
Contributor

Choose a reason for hiding this comment

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

it build nothing as default with buf_dbg, if change build log level, then it will print lot of log messages, I just mean default there is no cycle cost, and enable it indeed cost too much, not sure need a config to just cover is expensive or not.

@lgirdwood
Copy link
Member

Thanks @serhiy-katsyuba-intel , looks good. Can you update the commit prefixes to align with existing style?

oh yeah - did not see that. ready to merge as soon as this is fixed.

break;
}

err = dma_config(dma->dc.dmac->z_dev, dma->dc.chan->index, &dma_cfg);
Copy link
Collaborator

Choose a reason for hiding this comment

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

return dma_config(...)

Copy link
Collaborator

Choose a reason for hiding this comment

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

just a suggestion, use one #if from line 264 - 277, this can remove one more "#if #else #endif", overhead is duplicated err message.

@btian1 The difference is purely for the reader - the compilation result is the same. And in its present form the difference between the two cases is easier to see, so, I'd keep it as is. In general, however, yes, the fewer preprocessor conditionals we use, especially in .c, the better

_probe->inject_dma[j].dc.chan->index) < 0) {
#else
if (dma_start_legacy(_probe->inject_dma[j].dc.chan) < 0) {
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

this confuses at least some editors. They don't understand that only one of the ifs is compiled, so they interpret it as

if (x) {
if (y) {

and keep trying to "fix" alignment for a nested if and also gets confused about too few closing braces. Not something critical and not even an issue for everybody, but at least we did modify one such code fragment for this reason to read

#if X
if (a)
#else
if (b)
#endif
{

This contradicts style but at least the editor is happy about balanced braces

comp_update_buffer_consume() and comp_update_buffer_produce() generate
too much log output. Usually such amount of logs results in many log
messages been dropped. It is also results in significant CPU load if
selected log backend formats log messages at runtime.

This patch adds a separate switch to enable these logs only when necessary.
Default value is 'n'.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Probe module subscribes to buffer produce notifications in order to
perform data extraction or injection. Hence this fix is required to
enable probe feature.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Both extraction and injection probes require to subscribe to buffer
produce notification. Hence notification subscription logic should be
enabled for both types of probes.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Enables extraction and injection probes for MTL platform.
NOTE: this commit does NOT enable probe log backend.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
@serhiy-katsyuba-intel
Copy link
Contributor Author

Thanks @serhiy-katsyuba-intel , looks good. Can you update the commit prefixes to align with existing style?

oh yeah - did not see that. ready to merge as soon as this is fixed.

Done.

Copy link
Contributor

@jsarha jsarha left a comment

Choose a reason for hiding this comment

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

I have just a minor nitpick, that can be ignored, but there were some other valid comments, however with those fixed, approved by me.

return 0;
}

#if !CONFIG_ZEPHYR_NATIVE_DRIVERS
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a nitpick, I find it slightly annoying that this in #if the condition is negated, but in all the following ones the native drivers version comes first.

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.

10 participants