Skip to content

Conversation

@mmaka1
Copy link

@mmaka1 mmaka1 commented Jan 14, 2020

Ssp and other dai traces should follow the dmic example once there is no objection on re-using trace entry id's for dai type and index (instead of sending them sometimes as arguments).

Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you cut it to just d? dmic felt ok and d can be interpreted as debug.

Copy link
Author

Choose a reason for hiding this comment

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

trace_ macros names are too long (esp. the version with ids) imo, and they are sometimes followed by very long messages which creates too long lines. I'd keep them short as long as they do not collide (preprocessor will let you know). Btw it could default to trace() as well if trace class is redef-ed appropriately locally.

Copy link
Collaborator

@paulstelian97 paulstelian97 Jan 14, 2020

Choose a reason for hiding this comment

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

Would a scheme such as trace_t (for trace_event, t from trace), trace_e (for trace_error) and trace_v (for trace_verbose), and trace_it/trace_ie/trace_iv (for the counterparts with IDs) be good? This would also not include the component name where it isn't needed but breaks down if you ever need to use these traces outside the implementation C file.

Copy link
Member

Choose a reason for hiding this comment

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

I think our end goal should be the API described by @paulstelian97, where we can also pass in our object handle i.e.
trace_err(object, "blah blah");
The object would contain all the necessary ID, control data so that we could turn trace ON/OFF from userspace.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lgirdwood @paulstelian97 Indeed the end goal would be to have something similar with dev_dbg/dev_err/dev_info etc in the Linux kernel.

Where the object passed as the first argument will keep the whole information needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Added in the goals mentioned in #2172

Copy link
Contributor

Choose a reason for hiding this comment

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

We can try do to what you suggest, but for this PR what we have here is enough. It's more of a cleanup that will also make refactoring that u plan easier

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.

I'm ok with the shortened trace_ calls atm, but our end goal should be the standardised API with object handles for userspace control.

Copy link
Member

Choose a reason for hiding this comment

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

I think our end goal should be the API described by @paulstelian97, where we can also pass in our object handle i.e.
trace_err(object, "blah blah");
The object would contain all the necessary ID, control data so that we could turn trace ON/OFF from userspace.

@mmaka1
Copy link
Author

mmaka1 commented Jan 15, 2020

Global trace renaming seems to be a longer task, so just reverted macros names (kept swapped trace_error_dmic, just in this unit, so a bit inconsistent but a bit more readable) to make a progress with this one and focus on proposed reuse of log entry ids for dai type.index (another one is useful dmic log reduction on the non-verbose level).

Copy link
Collaborator

@paulstelian97 paulstelian97 left a comment

Choose a reason for hiding this comment

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

One nitpick: I'm not a fan of names like "trace_error_[comp]_id", it's mixing up the generic and specific parts. That said, this can be fixed in a future PR, the rest of the work here is good so I'll approve.

@lgirdwood lgirdwood added this to the v1.5 milestone Jan 16, 2020
@lgirdwood
Copy link
Member

@mmaka1 can you rebase, I will then re-run CI, as I think issue was CI and not FW related.

Copy link
Collaborator

@singalsu singalsu 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. Thanks for cleaning up DMIC trace output!

@zrombel
Copy link

zrombel commented Jan 23, 2020

Due to merge of PR#2303 this PR must be rebased or test results for KD tests with audio format 24b/32b ignored.

@mmaka1
Copy link
Author

mmaka1 commented Jan 28, 2020

SOFCI TEST

Marcin Maka added 5 commits January 30, 2020 14:07
Since this is the code of 'dai component', the trace macros
are renamed to avoid collisions with names of 'dai'
(ssp, dmic, ...) trace macros.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Trace entry fields for IDs may be used by dai traces
for type and index to track down each trace entry to
a specific dai instance.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Dmic instance should be identifiable in traces.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Parameter verification should be done before any
expensive resource allocations happen.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Follows the notation used for id's by the sof logger
tool. Type is followed by the index.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
@tlauda tlauda merged commit 922429a into thesofproject:master Jan 30, 2020
@mmaka1 mmaka1 deleted the trace-cleanup branch January 30, 2020 13:59
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.

8 participants