From: Deepak Kumar Singh <quic_deesin@quicinc.com>
To: Sudeepgoud Patil <quic_sudeepgo@quicinc.com>,
<quic_bjorande@quicinc.com>, <andersson@kernel.org>,
<quic_clew@quicinc.com>, <mathieu.poirier@linaro.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
<linux-remoteproc@vger.kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>
Subject: Re: [PATCH V3 2/2] soc: qcom: smp2p: Introduce tracepoint support
Date: Fri, 28 Jun 2024 14:52:39 +0530 [thread overview]
Message-ID: <ef5d4b87-76c7-4ff3-84ed-7f4743ec052c@quicinc.com> (raw)
In-Reply-To: <20240627104831.4176799-3-quic_sudeepgo@quicinc.com>
On 6/27/2024 4:18 PM, Sudeepgoud Patil wrote:
> This commit introduces tracepoint support for smp2p, enabling
> logging of communication between local and remote processors.
> These tracepoints include information about the remote subsystem
> name, negotiation details, supported features, bit change
> notifications, and ssr activity. These logs are useful for
> debugging issues between subsystems.
>
> Signed-off-by: Sudeepgoud Patil <quic_sudeepgo@quicinc.com>
Reviewed-by: Deepak Kumar Singh <quic_deesin@quicinc.com>
> ---
> drivers/soc/qcom/Makefile | 1 +
> drivers/soc/qcom/smp2p.c | 9 ++++
> drivers/soc/qcom/trace-smp2p.h | 98 ++++++++++++++++++++++++++++++++++
> 3 files changed, 108 insertions(+)
> create mode 100644 drivers/soc/qcom/trace-smp2p.h
>
> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
> index ca0bece0dfff..30c1bf645501 100644
> --- a/drivers/soc/qcom/Makefile
> +++ b/drivers/soc/qcom/Makefile
> @@ -23,6 +23,7 @@ qcom_rpmh-y += rpmh.o
> obj-$(CONFIG_QCOM_SMD_RPM) += rpm-proc.o smd-rpm.o
> obj-$(CONFIG_QCOM_SMEM) += smem.o
> obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
> +CFLAGS_smp2p.o := -I$(src)
> obj-$(CONFIG_QCOM_SMP2P) += smp2p.o
> obj-$(CONFIG_QCOM_SMSM) += smsm.o
> obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o
> diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
> index 696c2a8387d0..4aa61b0f11ad 100644
> --- a/drivers/soc/qcom/smp2p.c
> +++ b/drivers/soc/qcom/smp2p.c
> @@ -161,6 +161,9 @@ struct qcom_smp2p {
> struct list_head outbound;
> };
>
> +#define CREATE_TRACE_POINTS
> +#include "trace-smp2p.h"
> +
> static void qcom_smp2p_kick(struct qcom_smp2p *smp2p)
> {
> /* Make sure any updated data is written before the kick */
> @@ -192,6 +195,7 @@ static void qcom_smp2p_do_ssr_ack(struct qcom_smp2p *smp2p)
> struct smp2p_smem_item *out = smp2p->out;
> u32 val;
>
> + trace_smp2p_ssr_ack(smp2p->dev);
> smp2p->ssr_ack = !smp2p->ssr_ack;
>
> val = out->flags & ~BIT(SMP2P_FLAGS_RESTART_ACK_BIT);
> @@ -214,6 +218,7 @@ static void qcom_smp2p_negotiate(struct qcom_smp2p *smp2p)
> smp2p->ssr_ack_enabled = true;
>
> smp2p->negotiation_done = true;
> + trace_smp2p_negotiate(smp2p->dev, out->features);
> }
> }
>
> @@ -252,6 +257,8 @@ static void qcom_smp2p_notify_in(struct qcom_smp2p *smp2p)
> status = val ^ entry->last_value;
> entry->last_value = val;
>
> + trace_smp2p_notify_in(entry, status, val);
> +
> /* No changes of this entry? */
> if (!status)
> continue;
> @@ -415,6 +422,8 @@ static int smp2p_update_bits(void *data, u32 mask, u32 value)
> writel(val, entry->value);
> spin_unlock_irqrestore(&entry->lock, flags);
>
> + trace_smp2p_update_bits(entry, orig, val);
> +
> if (val != orig)
> qcom_smp2p_kick(entry->smp2p);
>
> diff --git a/drivers/soc/qcom/trace-smp2p.h b/drivers/soc/qcom/trace-smp2p.h
> new file mode 100644
> index 000000000000..fa985a0d7615
> --- /dev/null
> +++ b/drivers/soc/qcom/trace-smp2p.h
> @@ -0,0 +1,98 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM qcom_smp2p
> +
> +#if !defined(__QCOM_SMP2P_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
> +#define __QCOM_SMP2P_TRACE_H__
> +
> +#include <linux/device.h>
> +#include <linux/tracepoint.h>
> +
> +TRACE_EVENT(smp2p_ssr_ack,
> + TP_PROTO(const struct device *dev),
> + TP_ARGS(dev),
> + TP_STRUCT__entry(
> + __string(dev_name, dev_name(dev))
> + ),
> + TP_fast_assign(
> + __assign_str(dev_name, dev_name(dev));
> + ),
> + TP_printk("%s: SSR detected", __get_str(dev_name))
> +);
> +
> +TRACE_EVENT(smp2p_negotiate,
> + TP_PROTO(const struct device *dev, unsigned int features),
> + TP_ARGS(dev, features),
> + TP_STRUCT__entry(
> + __string(dev_name, dev_name(dev))
> + __field(u32, out_features)
> + ),
> + TP_fast_assign(
> + __assign_str(dev_name, dev_name(dev));
> + __entry->out_features = features;
> + ),
> + TP_printk("%s: state=open out_features=%s", __get_str(dev_name),
> + __print_flags(__entry->out_features, "|",
> + {SMP2P_FEATURE_SSR_ACK, "SMP2P_FEATURE_SSR_ACK"})
> + )
> +);
> +
> +TRACE_EVENT(smp2p_notify_in,
> + TP_PROTO(struct smp2p_entry *smp2p_entry, unsigned long status, u32 val),
> + TP_ARGS(smp2p_entry, status, val),
> + TP_STRUCT__entry(
> + __string(dev_name, dev_name(smp2p_entry->smp2p->dev))
> + __string(client_name, smp2p_entry->name)
> + __field(unsigned long, status)
> + __field(u32, val)
> + ),
> + TP_fast_assign(
> + __assign_str(dev_name, dev_name(smp2p_entry->smp2p->dev));
> + __assign_str(client_name, smp2p_entry->name);
> + __entry->status = status;
> + __entry->val = val;
> + ),
> + TP_printk("%s: %s: status:0x%0lx val:0x%0x",
> + __get_str(dev_name),
> + __get_str(client_name),
> + __entry->status,
> + __entry->val
> + )
> +);
> +
> +TRACE_EVENT(smp2p_update_bits,
> + TP_PROTO(struct smp2p_entry *smp2p_entry, u32 orig, u32 val),
> + TP_ARGS(smp2p_entry, orig, val),
> + TP_STRUCT__entry(
> + __string(dev_name, dev_name(smp2p_entry->smp2p->dev))
> + __string(client_name, smp2p_entry->name)
> + __field(u32, orig)
> + __field(u32, val)
> + ),
> + TP_fast_assign(
> + __assign_str(dev_name, dev_name(smp2p_entry->smp2p->dev));
> + __assign_str(client_name, smp2p_entry->name);
> + __entry->orig = orig;
> + __entry->val = val;
> + ),
> + TP_printk("%s: %s: orig:0x%0x new:0x%0x",
> + __get_str(dev_name),
> + __get_str(client_name),
> + __entry->orig,
> + __entry->val
> + )
> +);
> +
> +#endif /* __QCOM_SMP2P_TRACE_H__ */
> +
> +#undef TRACE_INCLUDE_PATH
> +#define TRACE_INCLUDE_PATH .
> +
> +#undef TRACE_INCLUDE_FILE
> +#define TRACE_INCLUDE_FILE trace-smp2p
> +
> +#include <trace/define_trace.h>
next prev parent reply other threads:[~2024-06-28 9:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 10:48 [PATCH V3 0/2] Use of devname for interrupt descriptions and tracepoint support for smp2p Sudeepgoud Patil
2024-06-27 10:48 ` [PATCH V3 1/2] soc: qcom: smp2p: Use devname for interrupt descriptions Sudeepgoud Patil
2024-06-29 13:03 ` Konrad Dybcio
2024-07-02 6:39 ` Sudeep Patil
2024-07-02 7:59 ` Dmitry Baryshkov
2024-06-27 10:48 ` [PATCH V3 2/2] soc: qcom: smp2p: Introduce tracepoint support Sudeepgoud Patil
2024-06-28 9:22 ` Deepak Kumar Singh [this message]
2024-06-28 17:36 ` kernel test robot
2024-07-02 8:03 ` Dmitry Baryshkov
2024-07-03 3:37 ` (subset) [PATCH V3 0/2] Use of devname for interrupt descriptions and tracepoint support for smp2p Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef5d4b87-76c7-4ff3-84ed-7f4743ec052c@quicinc.com \
--to=quic_deesin@quicinc.com \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=quic_bjorande@quicinc.com \
--cc=quic_clew@quicinc.com \
--cc=quic_sudeepgo@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®