Skip to content

Commit 7761724

Browse files
committed
trace: Add Kconfig options to enable verbose tracing only from certain classes
Currently, after enabling TRACEV via Kconfig, message log is flooded with various messages, most of which do not help to debug specific issues, due to vast volume of messages sent. This patch adds Kconfig options for each TRACE_CLASS, to enable logs from this class specifically. Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
1 parent feb9e2b commit 7761724

File tree

17 files changed

+826
-100
lines changed

17 files changed

+826
-100
lines changed

src/audio/asrc/asrc.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,17 @@
2929
#define trace_asrc(__e, ...) \
3030
trace_event(TRACE_CLASS_SRC, __e, ##__VA_ARGS__)
3131
#define trace_asrc_with_ids(comp_ptr, __e, ...) \
32-
trace_event_comp(TRACE_CLASS_SRC, comp_ptr, \
33-
__e, ##__VA_ARGS__)
32+
trace_event_comp(SRC, comp_ptr, __e, ##__VA_ARGS__)
3433

3534
#define tracev_asrc(__e, ...) \
3635
tracev_event(TRACE_CLASS_SRC, __e, ##__VA_ARGS__)
3736
#define tracev_asrc_with_ids(comp_ptr, __e, ...) \
38-
tracev_event_comp(TRACE_CLASS_SRC, comp_ptr, \
39-
__e, ##__VA_ARGS__)
37+
tracev_event_comp(SRC, comp_ptr, __e, ##__VA_ARGS__)
4038

4139
#define trace_asrc_error(__e, ...) \
4240
trace_error(TRACE_CLASS_SRC, __e, ##__VA_ARGS__)
4341
#define trace_asrc_error_with_ids(comp_ptr, __e, ...) \
44-
trace_error_comp(TRACE_CLASS_SRC, comp_ptr, \
45-
__e, ##__VA_ARGS__)
42+
trace_error_comp(SRC, comp_ptr, __e, ##__VA_ARGS__)
4643

4744
/* asrc component private data */
4845
struct comp_data {

src/audio/dai.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,17 @@
3434
#define trace_dai(__e, ...) \
3535
trace_event(TRACE_CLASS_DAI, __e, ##__VA_ARGS__)
3636
#define trace_dai_with_ids(comp_ptr, __e, ...) \
37-
trace_event_comp(TRACE_CLASS_DAI, comp_ptr, \
38-
__e, ##__VA_ARGS__)
37+
trace_event_comp(DAI, comp_ptr, __e, ##__VA_ARGS__)
3938

4039
#define tracev_dai(__e, ...) \
4140
tracev_event(TRACE_CLASS_DAI, __e, ##__VA_ARGS__)
4241
#define tracev_dai_with_ids(comp_ptr, __e, ...) \
43-
tracev_event_comp(TRACE_CLASS_DAI, comp_ptr, \
44-
__e, ##__VA_ARGS__)
42+
tracev_event_comp(DAI, comp_ptr, __e, ##__VA_ARGS__)
4543

4644
#define trace_dai_error(__e, ...) \
4745
trace_error(TRACE_CLASS_DAI, __e, ##__VA_ARGS__)
4846
#define trace_dai_error_with_ids(comp_ptr, __e, ...) \
49-
trace_error_comp(TRACE_CLASS_DAI, comp_ptr, \
50-
__e, ##__VA_ARGS__)
47+
trace_error_comp(DAI, comp_ptr, __e, ##__VA_ARGS__)
5148

5249
struct dai_data {
5350
/* local DMA config */

src/audio/detect_test.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,17 @@
3535
#define trace_keyword(__e, ...) \
3636
trace_event(TRACE_CLASS_KEYWORD, __e, ##__VA_ARGS__)
3737
#define trace_keyword_with_ids(comp_ptr, __e, ...) \
38-
trace_event_comp(TRACE_CLASS_KEYWORD, comp_ptr, \
39-
__e, ##__VA_ARGS__)
38+
trace_event_comp(KEYWORD, comp_ptr, __e, ##__VA_ARGS__)
4039

4140
#define tracev_keyword(__e, ...) \
4241
tracev_event(TRACE_CLASS_KEYWORD, __e, ##__VA_ARGS__)
4342
#define tracev_keyword_with_ids(comp_ptr, __e, ...) \
44-
tracev_event_comp(TRACE_CLASS_KEYWORD, comp_ptr, \
45-
__e, ##__VA_ARGS__)
43+
tracev_event_comp(KEYWORD, comp_ptr, __e, ##__VA_ARGS__)
4644

4745
#define trace_keyword_error(__e, ...) \
4846
trace_error(TRACE_CLASS_KEYWORD, __e, ##__VA_ARGS__)
4947
#define trace_keyword_error_with_ids(comp_ptr, __e, ...) \
50-
trace_error_comp(TRACE_CLASS_KEYWORD, comp_ptr, \
51-
__e, ##__VA_ARGS__)
48+
trace_error_comp(KEYWORD, comp_ptr, __e, ##__VA_ARGS__)
5249

5350
#define ACTIVATION_DEFAULT_SHIFT 3
5451
#define ACTIVATION_DEFAULT_DIVIDER_S16 0.5

src/audio/eq_fir/eq_fir.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,16 @@
4444
/* tracing */
4545
#define trace_eq(__e, ...) trace_event(TRACE_CLASS_EQ_FIR, __e, ##__VA_ARGS__)
4646
#define trace_eq_with_ids(comp_ptr, __e, ...) \
47-
trace_event_comp(TRACE_CLASS_EQ_FIR, comp_ptr, \
48-
__e, ##__VA_ARGS__)
47+
trace_event_comp(EQ_FIR, comp_ptr, __e, ##__VA_ARGS__)
4948

5049
#define tracev_eq(__e, ...) tracev_event(TRACE_CLASS_EQ_FIR, __e, ##__VA_ARGS__)
5150
#define tracev_eq_with_ids(comp_ptr, __e, ...) \
52-
tracev_event_comp(TRACE_CLASS_EQ_FIR, comp_ptr, \
53-
__e, ##__VA_ARGS__)
51+
tracev_event_comp(EQ_FIR, comp_ptr, __e, ##__VA_ARGS__)
5452

5553
#define trace_eq_error(__e, ...) \
5654
trace_error(TRACE_CLASS_EQ_FIR, __e, ##__VA_ARGS__)
5755
#define trace_eq_error_with_ids(comp_ptr, __e, ...) \
58-
trace_error_comp(TRACE_CLASS_EQ_FIR, comp_ptr, \
59-
__e, ##__VA_ARGS__)
56+
trace_error_comp(EQ_FIR, comp_ptr, __e, ##__VA_ARGS__)
6057

6158
/* src component private data */
6259
struct comp_data {

src/audio/eq_iir/eq_iir.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,16 @@
3333
/* tracing */
3434
#define trace_eq(__e, ...) trace_event(TRACE_CLASS_EQ_IIR, __e, ##__VA_ARGS__)
3535
#define trace_eq_with_ids(comp_ptr, __e, ...) \
36-
trace_event_comp(TRACE_CLASS_EQ_IIR, comp_ptr, \
37-
__e, ##__VA_ARGS__)
36+
trace_event_comp(EQ_IIR, comp_ptr, __e, ##__VA_ARGS__)
3837

3938
#define tracev_eq(__e, ...) tracev_event(TRACE_CLASS_EQ_IIR, __e, ##__VA_ARGS__)
4039
#define tracev_eq_with_ids(comp_ptr, __e, ...) \
41-
tracev_event_comp(TRACE_CLASS_EQ_IIR, comp_ptr, \
42-
__e, ##__VA_ARGS__)
40+
tracev_event_comp(EQ_IIR, comp_ptr, __e, ##__VA_ARGS__)
4341

4442
#define trace_eq_error(__e, ...) \
4543
trace_error(TRACE_CLASS_EQ_IIR, __e, ##__VA_ARGS__)
4644
#define trace_eq_error_with_ids(comp_ptr, __e, ...) \
47-
trace_error_comp(TRACE_CLASS_EQ_IIR, comp_ptr, \
48-
__e, ##__VA_ARGS__)
45+
trace_error_comp(EQ_IIR, comp_ptr, __e, ##__VA_ARGS__)
4946

5047
/* IIR component private data */
5148
struct comp_data {

src/audio/mixer.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,17 @@
3131
#define trace_mixer(__e, ...) \
3232
trace_event(TRACE_CLASS_MIXER, __e, ##__VA_ARGS__)
3333
#define trace_mixer_with_ids(comp_ptr, __e, ...) \
34-
trace_event_comp(TRACE_CLASS_MIXER, comp_ptr, \
35-
__e, ##__VA_ARGS__)
34+
trace_event_comp(MIXER, comp_ptr, __e, ##__VA_ARGS__)
3635

3736
#define tracev_mixer(__e, ...) \
3837
tracev_event(TRACE_CLASS_MIXER, __e, ##__VA_ARGS__)
3938
#define tracev_mixer_with_ids(comp_ptr, __e, ...) \
40-
tracev_event_comp(TRACE_CLASS_MIXER, comp_ptr, \
41-
__e, ##__VA_ARGS__)
39+
tracev_event_comp(MIXER, comp_ptr, __e, ##__VA_ARGS__)
4240

4341
#define trace_mixer_error(__e, ...) \
4442
trace_error(TRACE_CLASS_MIXER, __e, ##__VA_ARGS__)
4543
#define trace_mixer_error_with_ids(comp_ptr, __e, ...) \
46-
trace_error_comp(TRACE_CLASS_MIXER, comp_ptr, \
47-
__e, ##__VA_ARGS__)
44+
trace_error_comp(MIXER, comp_ptr, __e, ##__VA_ARGS__)
4845

4946
/* mixer component private data */
5047
struct mixer_data {

src/audio/src/src.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,17 @@
4141
#define trace_src(__e, ...) \
4242
trace_event(TRACE_CLASS_SRC, __e, ##__VA_ARGS__)
4343
#define trace_src_with_ids(comp_ptr, __e, ...) \
44-
trace_event_comp(TRACE_CLASS_SRC, comp_ptr, \
45-
__e, ##__VA_ARGS__)
44+
trace_event_comp(SRC, comp_ptr, __e, ##__VA_ARGS__)
4645

4746
#define tracev_src(__e, ...) \
4847
tracev_event(TRACE_CLASS_SRC, __e, ##__VA_ARGS__)
4948
#define tracev_src_with_ids(comp_ptr, __e, ...) \
50-
tracev_event_comp(TRACE_CLASS_SRC, comp_ptr, \
51-
__e, ##__VA_ARGS__)
49+
tracev_event_comp(SRC, comp_ptr, __e, ##__VA_ARGS__)
5250

5351
#define trace_src_error(__e, ...) \
5452
trace_error(TRACE_CLASS_SRC, __e, ##__VA_ARGS__)
5553
#define trace_src_error_with_ids(comp_ptr, __e, ...) \
56-
trace_error_comp(TRACE_CLASS_SRC, comp_ptr, \
57-
__e, ##__VA_ARGS__)
54+
trace_error_comp(SRC, comp_ptr, __e, ##__VA_ARGS__)
5855

5956
/* The FIR maximum lengths are per channel so need to multiply them */
6057
#define MAX_FIR_DELAY_SIZE_XNCH (PLATFORM_MAX_CHANNELS * MAX_FIR_DELAY_SIZE)

src/audio/switch.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,17 @@
1515
#define trace_switch(__e, ...) \
1616
trace_event(TRACE_CLASS_SWITCH, __e, ##__VA_ARGS__)
1717
#define trace_switch_with_ids(comp_ptr, __e, ...) \
18-
trace_event_comp(TRACE_CLASS_SWITCH, comp_ptr, \
19-
__e, ##__VA_ARGS__)
18+
trace_event_comp(SWITCH, comp_ptr, __e, ##__VA_ARGS__)
2019

2120
#define tracev_switch(__e, ...) \
2221
tracev_event(TRACE_CLASS_SWITCH, __e, ##__VA_ARGS__)
2322
#define tracev_switch_with_ids(comp_ptr, __e, ...) \
24-
tracev_event_comp(TRACE_CLASS_SWITCH, comp_ptr, \
25-
__e, ##__VA_ARGS__)
23+
tracev_event_comp(SWITCH, comp_ptr, __e, ##__VA_ARGS__)
2624

2725
#define trace_switch_error(__e, ...) \
2826
trace_error(TRACE_CLASS_SWITCH, __e, ##__VA_ARGS__)
2927
#define trace_switch_error_with_ids(comp_ptr, __e, ...) \
30-
trace_error_comp(TRACE_CLASS_SWITCH, comp_ptr, \
31-
__e, ##__VA_ARGS__)
28+
trace_error_comp(SWITCH, comp_ptr, __e, ##__VA_ARGS__)
3229

3330

3431
static struct comp_dev *switch_new(struct sof_ipc_comp *comp)

src/audio/tone.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,17 @@
3434
#define trace_tone(__e, ...) \
3535
trace_event(TRACE_CLASS_TONE, __e, ##__VA_ARGS__)
3636
#define trace_tone_with_ids(comp_ptr, __e, ...) \
37-
trace_event_comp(TRACE_CLASS_TONE, comp_ptr, \
38-
__e, ##__VA_ARGS__)
37+
trace_event_comp(TONE, comp_ptr, __e, ##__VA_ARGS__)
3938

4039
#define tracev_tone(__e, ...) \
4140
tracev_event(TRACE_CLASS_TONE, __e, ##__VA_ARGS__)
4241
#define tracev_tone_with_ids(comp_ptr, __e, ...) \
43-
tracev_event_comp(TRACE_CLASS_TONE, comp_ptr, \
44-
__e, ##__VA_ARGS__)
42+
tracev_event_comp(TONE, comp_ptr, __e, ##__VA_ARGS__)
4543

4644
#define trace_tone_error(__e, ...) \
4745
trace_error(TRACE_CLASS_TONE, __e, ##__VA_ARGS__)
4846
#define trace_tone_error_with_ids(comp_ptr, __e, ...) \
49-
trace_error_comp(TRACE_CLASS_TONE, comp_ptr, \
50-
__e, ##__VA_ARGS__)
47+
trace_error_comp(TONE, comp_ptr, __e, ##__VA_ARGS__)
5148

5249
/* Convert float frequency in Hz to Q16.16 fractional format */
5350
#define TONE_FREQ(f) Q_CONVERT_FLOAT(f, 16)

src/include/sof/audio/component.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,17 @@ struct dai_hw_params;
146146
#define trace_comp(__e, ...) \
147147
trace_event(TRACE_CLASS_COMP, __e, ##__VA_ARGS__)
148148
#define trace_comp_with_ids(comp_ptr, __e, ...) \
149-
trace_event_comp(TRACE_CLASS_COMP, comp_ptr, \
150-
__e, ##__VA_ARGS__)
149+
trace_event_comp(COMP, comp_ptr, __e, ##__VA_ARGS__)
151150

152151
#define tracev_comp(__e, ...) \
153152
tracev_event(TRACE_CLASS_COMP, __e, ##__VA_ARGS__)
154153
#define tracev_comp_with_ids(comp_ptr, __e, ...) \
155-
tracev_event_comp(TRACE_CLASS_COMP, comp_ptr, \
156-
__e, ##__VA_ARGS__)
154+
tracev_event_comp(COMP, comp_ptr, __e, ##__VA_ARGS__)
157155

158156
#define trace_comp_error(__e, ...) \
159157
trace_error(TRACE_CLASS_COMP, __e, ##__VA_ARGS__)
160158
#define trace_comp_error_with_ids(comp_ptr, __e, ...) \
161-
trace_error_comp(TRACE_CLASS_COMP, comp_ptr, \
162-
__e, ##__VA_ARGS__)
159+
trace_error_comp(COMP, comp_ptr, __e, ##__VA_ARGS__)
163160
/** @}*/
164161

165162
/* \brief Type of endpoint this component is connected to in a pipeline */

0 commit comments

Comments
 (0)