From: Mukesh Ojha <quic_mojha@quicinc.com>
To: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>,
<linux-remoteproc@vger.kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
<linux-kernel@vger.kernel.org>,
Trilok Soni <quic_tsoni@quicinc.com>,
Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>,
Rajendra Nayak <quic_rjendra@quicinc.com>,
"Elliot Berman" <quic_eberman@quicinc.com>,
Guru Das Srinagesh <quic_gurus@quicinc.com>,
Sibi Sankar <quic_sibis@quicinc.com>,
Melody Olvera <quic_molvera@quicinc.com>
Subject: Re: [PATCH v3 1/2] remoteproc: Introduce traces for remoteproc events
Date: Mon, 22 May 2023 21:02:55 +0530 [thread overview]
Message-ID: <a7a0cd79-e080-cd26-9411-5913a4c0c61f@quicinc.com> (raw)
In-Reply-To: <5c7c2657d12808e211942d71ad79e3846f4e70bb.1683741283.git.quic_gokukris@quicinc.com>
On 5/10/2023 11:35 PM, Gokul krishna Krishnakumar wrote:
> Adding Traces for the following remoteproc events:
> rproc_subdev_event,
> rproc_interrupt_event,
> rproc_load_event,
> rproc_start_event,
> rproc_stop_event
>
> Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
> ---
> drivers/remoteproc/Makefile | 1 +
> drivers/remoteproc/qcom_tracepoints.c | 12 +++
> include/trace/events/rproc_qcom.h | 128 ++++++++++++++++++++++++++
> 3 files changed, 141 insertions(+)
> create mode 100644 drivers/remoteproc/qcom_tracepoints.c
> create mode 100644 include/trace/events/rproc_qcom.h
>
> diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
> index 91314a9b43ce..3399fcaba39b 100644
> --- a/drivers/remoteproc/Makefile
> +++ b/drivers/remoteproc/Makefile
> @@ -10,6 +10,7 @@ remoteproc-y += remoteproc_debugfs.o
> remoteproc-y += remoteproc_sysfs.o
> remoteproc-y += remoteproc_virtio.o
> remoteproc-y += remoteproc_elf_loader.o
> +remoteproc-y += qcom_tracepoints.o
> obj-$(CONFIG_REMOTEPROC_CDEV) += remoteproc_cdev.o
> obj-$(CONFIG_IMX_REMOTEPROC) += imx_rproc.o
> obj-$(CONFIG_IMX_DSP_REMOTEPROC) += imx_dsp_rproc.o
> diff --git a/drivers/remoteproc/qcom_tracepoints.c b/drivers/remoteproc/qcom_tracepoints.c
> new file mode 100644
> index 000000000000..1b587ef54aa7
> --- /dev/null
> +++ b/drivers/remoteproc/qcom_tracepoints.c
> @@ -0,0 +1,12 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#define CREATE_TRACE_POINTS
> +#include <trace/events/rproc_qcom.h>
> +EXPORT_TRACEPOINT_SYMBOL(rproc_load_event);
> +EXPORT_TRACEPOINT_SYMBOL(rproc_start_event);
> +EXPORT_TRACEPOINT_SYMBOL(rproc_stop_event);
> +EXPORT_TRACEPOINT_SYMBOL(rproc_interrupt_event);
> +EXPORT_TRACEPOINT_SYMBOL(rproc_subdev_event);
> diff --git a/include/trace/events/rproc_qcom.h b/include/trace/events/rproc_qcom.h
> new file mode 100644
> index 000000000000..48ad26ce18a3
> --- /dev/null
> +++ b/include/trace/events/rproc_qcom.h
> @@ -0,0 +1,128 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM rproc_qcom
> +
> +#if !defined(_TRACE_RPROC_QCOM_H) || defined(TRACE_HEADER_MULTI_READ)
> +#define _TRACE_RPROC_QCOM_H
> +#include <linux/tracepoint.h>
> +#include <linux/remoteproc.h>
> +
> +/*
> + * Tracepoints for remoteproc and subdevice events
> + */
> +TRACE_EVENT(rproc_load_event,
> +
> + TP_PROTO(struct rproc *rproc, int ret),
> +
> + TP_ARGS(rproc, ret),
> +
> + TP_STRUCT__entry(
> + __string(name, rproc->name)
> + __string(firmware, rproc->firmware)
> + __field(int, ret)
> + ),
> +
> + TP_fast_assign(
> + __assign_str(name, rproc->name);
> + __assign_str(firmware, rproc->firmware);
> + __entry->ret = ret;
> + ),
> +
> + TP_printk("%s loading firmware %s returned %d",
> + __get_str(name), __get_str(firmware),
> + __entry->ret)
> +);
> +
> +TRACE_EVENT(rproc_start_event,
> +
> + TP_PROTO(struct rproc *rproc, int ret),
> +
> + TP_ARGS(rproc, ret),
> +
> + TP_STRUCT__entry(
> + __string(name, rproc->name)
> + __field(int, ret)
> + ),
> +
> + TP_fast_assign(
> + __assign_str(name, rproc->name);
> + __entry->ret = ret;
> + ),
> +
> + TP_printk("%s %d", __get_str(name), __entry->ret)
> +);
> +
> +TRACE_EVENT(rproc_stop_event,
> +
> + TP_PROTO(struct rproc *rproc, char *crash_msg),
const char *crash_msg ?
> +
> + TP_ARGS(rproc, crash_msg),
> +
> + TP_STRUCT__entry(
> + __string(name, rproc->name)
> + __string(crash_msg, crash_msg)
> + ),
> +
> + TP_fast_assign(
> + __assign_str(name, rproc->name);
> + __assign_str(crash_msg, crash_msg)
> + ),
> +
> + TP_printk("%s %s", __get_str(name), __get_str(crash_msg))
> +);
> +
> +TRACE_EVENT(rproc_interrupt_event,
> +
> + TP_PROTO(struct rproc *rproc, const char *event,
> + const char *msg),
> +
> + TP_ARGS(rproc, event, msg),
> +
> + TP_STRUCT__entry(
> + __string(name, rproc->name)
> + __string(event, event)
> + __string(msg, msg)
> + ),
> +
> + TP_fast_assign(
> + __assign_str(name, rproc->name);
> + __assign_str(event, event);
> + __assign_str(msg, msg);
> + ),
> +
> + TP_printk("%s %s returned %s", __get_str(name),
> + __get_str(event), __get_str(msg))
> +);
> +
> +TRACE_EVENT(rproc_subdev_event,
> +
> + TP_PROTO(const char *rproc, const char *subdev,
> + const char *event, int ret),
> +
> + TP_ARGS(rproc, subdev, event, ret),
> +
> + TP_STRUCT__entry(
> + __string(rproc, rproc)
> + __string(subdev, subdev)
> + __string(event, event)
> + __field(int, ret)
> + ),
> +
> + TP_fast_assign(
> + __assign_str(rproc, rproc);
> + __assign_str(subdev, subdev);
> + __assign_str(event, event);
> + __entry->ret = ret;
> + ),
> +
> + TP_printk("%s %s %s %d", __get_str(rproc), __get_str(subdev),
> + __get_str(event), __entry->ret)
Should you not specify what all are you trying to print here..
Unless they are very generic and self interpret-able.
TP_printk("rproc:%s subdev:%s event:%s ret:%d", __get_str(rproc),
__get_str(subdev), __get_str(event), __entry->ret)
-- Mukesh
> +);
> +#endif /* _TRACE_RPROC_QCOM_H */
> +
> +/* This part must be outside protection */
> +#include <trace/define_trace.h>
next prev parent reply other threads:[~2023-05-22 15:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 18:05 [PATCH v3 0/2] Add trace events for remoteproc Gokul krishna Krishnakumar
2023-05-10 18:05 ` [PATCH v3 1/2] remoteproc: Introduce traces for remoteproc events Gokul krishna Krishnakumar
2023-05-22 14:35 ` Mukesh Ojha
2023-05-22 15:32 ` Mukesh Ojha [this message]
2023-07-15 21:33 ` Bjorn Andersson
2023-05-10 18:05 ` [PATCH v3 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
2023-07-15 21:12 ` 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=a7a0cd79-e080-cd26-9411-5913a4c0c61f@quicinc.com \
--to=quic_mojha@quicinc.com \
--cc=andersson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=quic_eberman@quicinc.com \
--cc=quic_gokukris@quicinc.com \
--cc=quic_gurus@quicinc.com \
--cc=quic_molvera@quicinc.com \
--cc=quic_rjendra@quicinc.com \
--cc=quic_satyap@quicinc.com \
--cc=quic_sibis@quicinc.com \
--cc=quic_tsoni@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®