Re: [PATCH] soc: qcom: aoss: Add tracepoints in qmp_send()

From: Chris Lew
Date: Tue Jan 23 2024 - 14:01:44 EST




On 1/17/2024 7:52 PM, Bjorn Andersson wrote:
@@ -235,6 +238,8 @@ int qmp_send(struct qmp *qmp, const char *fmt, ...)
mutex_lock(&qmp->tx_lock);
+ trace_aoss_send(buf);
+
/* The message RAM only implements 32-bit accesses */
__iowrite32_copy(qmp->msgram + qmp->offset + sizeof(u32),
buf, sizeof(buf) / sizeof(u32));
@@ -256,6 +261,8 @@ int qmp_send(struct qmp *qmp, const char *fmt, ...)
ret = 0;
}
+ trace_aoss_send_done(buf, ret);
+

As a side note, another place where we've traced before is on the receiving irq to get the full timing of how long AOSS takes to process a command. I think we've discussed this in the past and decided that we can use kprobes if that need occurs.

mutex_unlock(&qmp->tx_lock);
return ret;
diff --git a/drivers/soc/qcom/trace-aoss.h b/drivers/soc/qcom/trace-aoss.h
new file mode 100644
index 000000000000..48cd3f0f4cb8
--- /dev/null
+++ b/drivers/soc/qcom/trace-aoss.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM qcom_aoss
+
+#if !defined(_TRACE_RPMH_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_RPMH_H

Any Reason for this to be _TRACE_RPMH_H instead of _TRACE_AOSS_H?