Skip to content

Commit 2e54cb3

Browse files
afordcirrusLucas Tanure
authored andcommitted
ASoC: clsic-alg: Add ftrace log for custom message interface
Change-Id: Ie9432960d3d57a73043d17f6e1a7f74867dac00e Signed-off-by: Andrew Ford <[email protected]>
1 parent 1d1f4b0 commit 2e54cb3

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

drivers/mfd/clsic/clsic-trace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ EXPORT_TRACEPOINT_SYMBOL(clsic_alg_compr_stream_get_caps);
4646
EXPORT_TRACEPOINT_SYMBOL(clsic_alg_compr_stream_trigger);
4747
EXPORT_TRACEPOINT_SYMBOL(clsic_alg_compr_stream_timestamp);
4848
EXPORT_TRACEPOINT_SYMBOL(clsic_alg_compr_stream_copy_start);
49+
EXPORT_TRACEPOINT_SYMBOL(clsic_alg_custom_msg);
4950
EXPORT_TRACEPOINT_SYMBOL(clsic_simirq_write_asserted);
5051
EXPORT_TRACEPOINT_SYMBOL(clsic_simirq_write_deasserted);
5152

drivers/mfd/clsic/clsic-trace.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,30 @@ TRACE_EVENT(clsic_alg_read,
567567
)
568568
);
569569

570+
TRACE_EVENT(clsic_alg_custom_msg,
571+
TP_PROTO(uint8_t msgid, ssize_t len, int ret, uint8_t err),
572+
TP_ARGS(msgid, len, ret, err),
573+
TP_STRUCT__entry(
574+
__field(uint32_t, msgid)
575+
__field(ssize_t, len)
576+
__field(int, ret)
577+
__field(uint8_t, err)
578+
),
579+
TP_fast_assign(
580+
__entry->msgid = msgid;
581+
__entry->len = len;
582+
__entry->ret = ret;
583+
__entry->err = err;
584+
),
585+
TP_printk(
586+
" msgid: 0x%x msg len: %zu ret: %d (err: %d)",
587+
__entry->msgid,
588+
__entry->len,
589+
__entry->ret,
590+
__entry->err
591+
)
592+
);
593+
570594
DEFINE_EVENT(clsic_generic, clsic_simirq_write_asserted,
571595
TP_PROTO(uint8_t dummy),
572596
TP_ARGS(dummy)

sound/soc/codecs/clsic-alg.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ static ssize_t clsic_alg_custom_message_write(struct file *file,
699699
clsic_get_srv_inst(msg_p->cmd.hdr.sbc));
700700
return -EINVAL;
701701
}
702+
702703
#ifdef CONFIG_DEBUG_FS
703704
mutex_lock(&alg->regmapMutex);
704705
#endif
@@ -724,6 +725,9 @@ static ssize_t clsic_alg_custom_message_write(struct file *file,
724725
custom_msg->len = CLSIC_FIXED_MSG_SZ;
725726
}
726727

728+
trace_clsic_alg_custom_msg(msg_p->bulk_rsp.hdr.msgid,
729+
custom_msg->len, ret, msg_p->bulk_rsp.hdr.err);
730+
727731
/*
728732
* Propagate errors if there was a transfer error, otherwise the
729733
* function should return the length of data read from user space.

0 commit comments

Comments
 (0)