linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Patches for introducing traces in remoteproc.
@ 2023-06-12 22:03 Gokul krishna Krishnakumar
  2023-06-12 22:03 ` [PATCH v5 1/2] remoteproc: Introduce traces for remoteproc events Gokul krishna Krishnakumar
  2023-06-12 22:03 ` [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
  0 siblings, 2 replies; 7+ messages in thread
From: Gokul krishna Krishnakumar @ 2023-06-12 22:03 UTC (permalink / raw)
  To: linux-arm-msm, linux-remoteproc, linux-trace-kernel
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-kernel,
	Trilok Soni, Satya Durga Srinivasu Prabhala, Rajendra Nayak,
	Elliot Berman, Guru Das Srinagesh, Sibi Sankar, Melody Olvera,
	Gokul krishna Krishnakumar

V5: Add more text to Kconfig
    Move this trace point to function rproc_load_segments() and rename
    it to trace_rproc_load_segment_event()
    
V4: Add config symbol REMOTEPROC_TRACEPOINTS to enable traces
    Rename rproc_qcom.h to remoteproc_tracepoints.h
    Rename qcom_tracepoints.c to remoteproc_tracepoints.c
    Switch to EXPORT_SYMBOL_GPL

V3: Split the Patch to 2 as per suggestion from Mukesh, fixed format
error from v2. 

V2: Moved the traces to common code from the qcom_pas driver as per
Bjorns review, fixed text as per Triloks suggestion, Updated QuiC
copyright to 2023.

[1]: https://lore.kernel.org/all/20230224165142.17745-2-quic_gokukris@quicinc.com/

Gokul krishna Krishnakumar (2):
  remoteproc: Introduce traces for remoteproc events
  remoteproc: qcom: Add remoteproc tracing

 drivers/remoteproc/Kconfig                    |   9 ++
 drivers/remoteproc/Makefile                   |   1 +
 drivers/remoteproc/qcom_common.c              |  37 +++++
 drivers/remoteproc/qcom_q6v5.c                |   9 ++
 drivers/remoteproc/remoteproc_core.c          |   5 +
 drivers/remoteproc/remoteproc_internal.h      |   9 +-
 drivers/remoteproc/remoteproc_tracepoints.c   |  14 ++
 include/trace/events/remoteproc_tracepoints.h | 152 ++++++++++++++++++
 8 files changed, 234 insertions(+), 2 deletions(-)
 create mode 100644 drivers/remoteproc/remoteproc_tracepoints.c
 create mode 100644 include/trace/events/remoteproc_tracepoints.h


base-commit: 1ca04f21b204e99dd704146231adfb79ea2fb366
-- 
2.40.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5 1/2] remoteproc: Introduce traces for remoteproc events
  2023-06-12 22:03 [PATCH v5 0/2] Patches for introducing traces in remoteproc Gokul krishna Krishnakumar
@ 2023-06-12 22:03 ` Gokul krishna Krishnakumar
  2023-06-12 22:03 ` [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
  1 sibling, 0 replies; 7+ messages in thread
From: Gokul krishna Krishnakumar @ 2023-06-12 22:03 UTC (permalink / raw)
  To: linux-arm-msm, linux-remoteproc, linux-trace-kernel
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-kernel,
	Trilok Soni, Satya Durga Srinivasu Prabhala, Rajendra Nayak,
	Elliot Berman, Guru Das Srinagesh, Sibi Sankar, Melody Olvera,
	Gokul krishna Krishnakumar

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/Kconfig                    |   9 ++
 drivers/remoteproc/Makefile                   |   1 +
 drivers/remoteproc/remoteproc_tracepoints.c   |  14 ++
 include/trace/events/remoteproc_tracepoints.h | 152 ++++++++++++++++++
 4 files changed, 176 insertions(+)
 create mode 100644 drivers/remoteproc/remoteproc_tracepoints.c
 create mode 100644 include/trace/events/remoteproc_tracepoints.h

diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index a850e9f486dd..4bc4e42a8a36 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -365,6 +365,15 @@ config XLNX_R5_REMOTEPROC
 
 	  It's safe to say N if not interested in using RPU r5f cores.
 
+config REMOTEPROC_TRACEPOINTS
+	bool "Support for Remote Processor subsystem traces"
+	help
+	  Say y to add traces to remoteproc events of interest such as
+	  the start/stop/crash events in a remote-processor and also
+	  sub-device stop/start events and there errors. These traces
+	  can be useful while debugging errors with subsystem restart
+	  and draw an estimate on how long each event takes to run.
+
 endif # REMOTEPROC
 
 endmenu
diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
index 91314a9b43ce..7045cde5ca76 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
+obj-$(CONFIG_REMOTEPROC_TRACEPOINTS)	+= remoteproc_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/remoteproc_tracepoints.c b/drivers/remoteproc/remoteproc_tracepoints.c
new file mode 100644
index 000000000000..cafebda02f8b
--- /dev/null
+++ b/drivers/remoteproc/remoteproc_tracepoints.c
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#define CREATE_TRACE_POINTS
+#include <trace/events/remoteproc_tracepoints.h>
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(rproc_load_segment_event);
+EXPORT_TRACEPOINT_SYMBOL_GPL(rproc_attach_event);
+EXPORT_TRACEPOINT_SYMBOL_GPL(rproc_start_event);
+EXPORT_TRACEPOINT_SYMBOL_GPL(rproc_stop_event);
+EXPORT_TRACEPOINT_SYMBOL_GPL(rproc_interrupt_event);
+EXPORT_TRACEPOINT_SYMBOL_GPL(rproc_subdev_event);
diff --git a/include/trace/events/remoteproc_tracepoints.h b/include/trace/events/remoteproc_tracepoints.h
new file mode 100644
index 000000000000..4d12d463cb39
--- /dev/null
+++ b/include/trace/events/remoteproc_tracepoints.h
@@ -0,0 +1,152 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM remoteproc_tracepoints
+
+#if !defined(_TRACE_REMOTEPROC_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_REMOTEPROC_H
+#include <linux/tracepoint.h>
+#include <linux/remoteproc.h>
+
+/*
+ * Tracepoints for remoteproc and subdevice events
+ */
+TRACE_EVENT(rproc_load_segment_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_attach_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 attaching returned %d",
+			__get_str(name),
+			__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, 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("rproc:%s subdev:%s event:%s ret:%d",
+		__get_str(rproc), __get_str(subdev),
+		__get_str(event), __entry->ret)
+);
+#endif /* _TRACE_REMOTEPROC_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
  2023-06-12 22:03 [PATCH v5 0/2] Patches for introducing traces in remoteproc Gokul krishna Krishnakumar
  2023-06-12 22:03 ` [PATCH v5 1/2] remoteproc: Introduce traces for remoteproc events Gokul krishna Krishnakumar
@ 2023-06-12 22:03 ` Gokul krishna Krishnakumar
  2023-06-13  6:08   ` kernel test robot
                     ` (3 more replies)
  1 sibling, 4 replies; 7+ messages in thread
From: Gokul krishna Krishnakumar @ 2023-06-12 22:03 UTC (permalink / raw)
  To: linux-arm-msm, linux-remoteproc, linux-trace-kernel
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-kernel,
	Trilok Soni, Satya Durga Srinivasu Prabhala, Rajendra Nayak,
	Elliot Berman, Guru Das Srinagesh, Sibi Sankar, Melody Olvera,
	Gokul krishna Krishnakumar

This change attempts to add traces for start, stop, crash
subsystem/subdevice events, these will serve as standard checkpoints in
code and could help in debugging the failures in subdevice/subsystem
prepare, start, stop and unprepare functions. This will also breakdown
the time taken for each step in remoteproc bootup/shutdown process.

Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
---
 drivers/remoteproc/qcom_common.c         | 37 ++++++++++++++++++++++++
 drivers/remoteproc/qcom_q6v5.c           |  9 ++++++
 drivers/remoteproc/remoteproc_core.c     |  5 ++++
 drivers/remoteproc/remoteproc_internal.h |  9 ++++--
 4 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
index a0d4238492e9..857e5a74c1eb 100644
--- a/drivers/remoteproc/qcom_common.c
+++ b/drivers/remoteproc/qcom_common.c
@@ -18,6 +18,7 @@
 #include <linux/slab.h>
 #include <linux/soc/qcom/mdt_loader.h>
 #include <linux/soc/qcom/smem.h>
+#include <trace/events/remoteproc_tracepoints.h>
 
 #include "remoteproc_internal.h"
 #include "qcom_common.h"
@@ -191,6 +192,10 @@ static int glink_subdev_start(struct rproc_subdev *subdev)
 
 	glink->edge = qcom_glink_smem_register(glink->dev, glink->node);
 
+	trace_rproc_subdev_event(dev_name(glink->dev->parent),
+					"glink", "start",
+					PTR_ERR_OR_ZERO(glink->edge));
+
 	return PTR_ERR_OR_ZERO(glink->edge);
 }
 
@@ -199,6 +204,11 @@ static void glink_subdev_stop(struct rproc_subdev *subdev, bool crashed)
 	struct qcom_rproc_glink *glink = to_glink_subdev(subdev);
 
 	qcom_glink_smem_unregister(glink->edge);
+
+	trace_rproc_subdev_event(dev_name(glink->dev->parent),
+					"glink", "stop",
+					PTR_ERR_OR_ZERO(glink->edge));
+
 	glink->edge = NULL;
 }
 
@@ -206,6 +216,10 @@ static void glink_subdev_unprepare(struct rproc_subdev *subdev)
 {
 	struct qcom_rproc_glink *glink = to_glink_subdev(subdev);
 
+	trace_rproc_subdev_event(dev_name(glink->dev->parent),
+					"glink", "unprepare",
+					PTR_ERR_OR_ZERO(glink->edge));
+
 	qcom_glink_ssr_notify(glink->ssr_name);
 }
 
@@ -300,6 +314,10 @@ static int smd_subdev_start(struct rproc_subdev *subdev)
 {
 	struct qcom_rproc_subdev *smd = to_smd_subdev(subdev);
 
+	trace_rproc_subdev_event(dev_name(smd->dev->parent),
+					"smd", "start",
+					PTR_ERR_OR_ZERO(smd->edge));
+
 	smd->edge = qcom_smd_register_edge(smd->dev, smd->node);
 
 	return PTR_ERR_OR_ZERO(smd->edge);
@@ -309,6 +327,10 @@ static void smd_subdev_stop(struct rproc_subdev *subdev, bool crashed)
 {
 	struct qcom_rproc_subdev *smd = to_smd_subdev(subdev);
 
+	trace_rproc_subdev_event(dev_name(smd->dev->parent),
+					"smd", "stop",
+					PTR_ERR_OR_ZERO(smd->edge));
+
 	qcom_smd_unregister_edge(smd->edge);
 	smd->edge = NULL;
 }
@@ -425,6 +447,10 @@ static int ssr_notify_prepare(struct rproc_subdev *subdev)
 		.crashed = false,
 	};
 
+	trace_rproc_subdev_event(ssr->info->name,
+					"ssr", "QCOM_SSR_BEFORE_POWERUP",
+					data.crashed);
+
 	srcu_notifier_call_chain(&ssr->info->notifier_list,
 				 QCOM_SSR_BEFORE_POWERUP, &data);
 	return 0;
@@ -437,6 +463,9 @@ static int ssr_notify_start(struct rproc_subdev *subdev)
 		.name = ssr->info->name,
 		.crashed = false,
 	};
+	trace_rproc_subdev_event(ssr->info->name,
+					"ssr", "QCOM_SSR_AFTER_POWERUP",
+					data.crashed);
 
 	srcu_notifier_call_chain(&ssr->info->notifier_list,
 				 QCOM_SSR_AFTER_POWERUP, &data);
@@ -451,6 +480,10 @@ static void ssr_notify_stop(struct rproc_subdev *subdev, bool crashed)
 		.crashed = crashed,
 	};
 
+	trace_rproc_subdev_event(ssr->info->name,
+					"ssr", "QCOM_SSR_BEFORE_SHUTDOWN",
+					data.crashed);
+
 	srcu_notifier_call_chain(&ssr->info->notifier_list,
 				 QCOM_SSR_BEFORE_SHUTDOWN, &data);
 }
@@ -463,6 +496,10 @@ static void ssr_notify_unprepare(struct rproc_subdev *subdev)
 		.crashed = false,
 	};
 
+	trace_rproc_subdev_event(ssr->info->name,
+					"ssr", "QCOM_SSR_AFTER_SHUTDOWN",
+					data.crashed);
+
 	srcu_notifier_call_chain(&ssr->info->notifier_list,
 				 QCOM_SSR_AFTER_SHUTDOWN, &data);
 }
diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c
index 192c7aa0e39e..bf14f01c88c4 100644
--- a/drivers/remoteproc/qcom_q6v5.c
+++ b/drivers/remoteproc/qcom_q6v5.c
@@ -15,6 +15,7 @@
 #include <linux/soc/qcom/smem.h>
 #include <linux/soc/qcom/smem_state.h>
 #include <linux/remoteproc.h>
+#include <trace/events/remoteproc_tracepoints.h>
 #include "qcom_common.h"
 #include "qcom_q6v5.h"
 
@@ -113,6 +114,7 @@ static irqreturn_t q6v5_wdog_interrupt(int irq, void *data)
 		dev_err(q6v5->dev, "watchdog without message\n");
 
 	q6v5->running = false;
+	trace_rproc_interrupt_event(q6v5->rproc, "q6v5_wdog", msg);
 	rproc_report_crash(q6v5->rproc, RPROC_WATCHDOG);
 
 	return IRQ_HANDLED;
@@ -134,6 +136,7 @@ static irqreturn_t q6v5_fatal_interrupt(int irq, void *data)
 		dev_err(q6v5->dev, "fatal error without message\n");
 
 	q6v5->running = false;
+	trace_rproc_interrupt_event(q6v5->rproc, "fatal", msg);
 	rproc_report_crash(q6v5->rproc, RPROC_FATAL_ERROR);
 
 	return IRQ_HANDLED;
@@ -165,6 +168,8 @@ int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout)
 	if (!ret)
 		disable_irq(q6v5->handover_irq);
 
+	trace_rproc_interrupt_event(q6v5->rproc, "Ready", !ret ? "-ETIMEDOUT":"done");
+
 	return !ret ? -ETIMEDOUT : 0;
 }
 EXPORT_SYMBOL_GPL(qcom_q6v5_wait_for_start);
@@ -180,6 +185,8 @@ static irqreturn_t q6v5_handover_interrupt(int irq, void *data)
 
 	q6v5->handover_issued = true;
 
+	trace_rproc_interrupt_event(q6v5->rproc, "handover", "Proxy votes removed");
+
 	return IRQ_HANDLED;
 }
 
@@ -216,6 +223,8 @@ int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5, struct qcom_sysmon *sysmon)
 
 	qcom_smem_state_update_bits(q6v5->state, BIT(q6v5->stop_bit), 0);
 
+	trace_rproc_interrupt_event(q6v5->rproc, "Stop", ret ? "done":"-EETIMEDOUT");
+
 	return ret == 0 ? -ETIMEDOUT : 0;
 }
 EXPORT_SYMBOL_GPL(qcom_q6v5_request_stop);
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 695cce218e8c..64c09eff67fe 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -38,6 +38,7 @@
 #include <linux/virtio_ring.h>
 #include <asm/byteorder.h>
 #include <linux/platform_device.h>
+#include <trace/events/remoteproc_tracepoints.h>
 
 #include "remoteproc_internal.h"
 
@@ -1648,6 +1649,7 @@ static int rproc_attach(struct rproc *rproc)
 	if (ret)
 		goto clean_up_resources;
 
+	trace_rproc_start_event(rproc, ret);
 	return 0;
 
 clean_up_resources:
@@ -1730,6 +1732,8 @@ static int rproc_stop(struct rproc *rproc, bool crashed)
 		return ret;
 	}
 
+	trace_rproc_stop_event(rproc, crashed ? "crash stop" : "stop");
+
 	rproc_unprepare_subdevices(rproc);
 
 	rproc->state = RPROC_OFFLINE;
@@ -1951,6 +1955,7 @@ int rproc_boot(struct rproc *rproc)
 		}
 
 		ret = rproc_fw_boot(rproc, firmware_p);
+		trace_rproc_start_event(rproc, ret);
 
 		release_firmware(firmware_p);
 	}
diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h
index d4dbb8d1d80c..f7cb31b94a60 100644
--- a/drivers/remoteproc/remoteproc_internal.h
+++ b/drivers/remoteproc/remoteproc_internal.h
@@ -14,6 +14,7 @@
 
 #include <linux/irqreturn.h>
 #include <linux/firmware.h>
+#include <trace/events/remoteproc_tracepoints.h>
 
 struct rproc;
 
@@ -171,8 +172,13 @@ u64 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw)
 static inline
 int rproc_load_segments(struct rproc *rproc, const struct firmware *fw)
 {
-	if (rproc->ops->load)
-		return rproc->ops->load(rproc, fw);
+	if (rproc->ops->load) {
+		int ret;
+
+		ret = rproc->ops->load(rproc, fw);
+		trace_rproc_load_segment_event(rproc, ret);
+		return ret;
+	}
 
 	return -EINVAL;
 }
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
  2023-06-12 22:03 ` [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
@ 2023-06-13  6:08   ` kernel test robot
  2023-06-13  6:19   ` kernel test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-06-13  6:08 UTC (permalink / raw)
  To: Gokul krishna Krishnakumar, linux-arm-msm, linux-remoteproc,
	linux-trace-kernel
  Cc: oe-kbuild-all, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	linux-kernel, Trilok Soni, Satya Durga Srinivasu Prabhala,
	Rajendra Nayak, Elliot Berman, Guru Das Srinagesh, Sibi Sankar,
	Melody Olvera, Gokul krishna Krishnakumar

Hi Gokul,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1ca04f21b204e99dd704146231adfb79ea2fb366]

url:    https://github.com/intel-lab-lkp/linux/commits/Gokul-krishna-Krishnakumar/remoteproc-Introduce-traces-for-remoteproc-events/20230613-060527
base:   1ca04f21b204e99dd704146231adfb79ea2fb366
patch link:    https://lore.kernel.org/r/12b533c73b8c6b039e90f20afef1c8dcd30b80de.1686606835.git.quic_gokukris%40quicinc.com
patch subject: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
config: i386-randconfig-r025-20230612 (https://download.01.org/0day-ci/archive/20230613/202306131305.GXI4gstL-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build):
        git checkout 1ca04f21b204e99dd704146231adfb79ea2fb366
        b4 shazam https://lore.kernel.org/r/12b533c73b8c6b039e90f20afef1c8dcd30b80de.1686606835.git.quic_gokukris@quicinc.com
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 olddefconfig
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306131305.GXI4gstL-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: drivers/remoteproc/remoteproc_core.o: in function `trace_rproc_stop_event':
>> include/trace/events/remoteproc_tracepoints.h:82: undefined reference to `__tracepoint_rproc_stop_event'
>> ld: include/trace/events/remoteproc_tracepoints.h:82: undefined reference to `__SCT__tp_func_rproc_stop_event'
   ld: drivers/remoteproc/remoteproc_core.o: in function `trace_rproc_load_segment_event':
>> include/trace/events/remoteproc_tracepoints.h:17: undefined reference to `__tracepoint_rproc_load_segment_event'
>> ld: include/trace/events/remoteproc_tracepoints.h:17: undefined reference to `__SCT__tp_func_rproc_load_segment_event'
   ld: drivers/remoteproc/remoteproc_core.o: in function `trace_rproc_start_event':
>> include/trace/events/remoteproc_tracepoints.h:63: undefined reference to `__tracepoint_rproc_start_event'
>> ld: include/trace/events/remoteproc_tracepoints.h:63: undefined reference to `__SCT__tp_func_rproc_start_event'
   ld: drivers/remoteproc/remoteproc_core.o:(__jump_table+0x8): undefined reference to `__tracepoint_rproc_stop_event'
>> ld: drivers/remoteproc/remoteproc_core.o:(__jump_table+0x14): undefined reference to `__tracepoint_rproc_load_segment_event'
   ld: drivers/remoteproc/remoteproc_core.o:(__jump_table+0x20): undefined reference to `__tracepoint_rproc_start_event'


vim +82 include/trace/events/remoteproc_tracepoints.h

f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   13  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   14  /*
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   15   * Tracepoints for remoteproc and subdevice events
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   16   */
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12  @17  TRACE_EVENT(rproc_load_segment_event,
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   18  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   19  	TP_PROTO(struct rproc *rproc, int ret),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   20  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   21  	TP_ARGS(rproc, ret),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   22  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   23  	TP_STRUCT__entry(
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   24  		__string(name, rproc->name)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   25  		__string(firmware, rproc->firmware)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   26  		__field(int, ret)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   27  	),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   28  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   29  	TP_fast_assign(
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   30  		__assign_str(name, rproc->name);
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   31  		__assign_str(firmware, rproc->firmware);
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   32  		__entry->ret = ret;
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   33  	),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   34  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   35  	TP_printk("%s loading firmware %s returned %d",
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   36  			__get_str(name), __get_str(firmware),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   37  			__entry->ret)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   38  );
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   39  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   40  TRACE_EVENT(rproc_attach_event,
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   41  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   42  	TP_PROTO(struct rproc *rproc, int ret),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   43  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   44  	TP_ARGS(rproc, ret),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   45  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   46  	TP_STRUCT__entry(
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   47  		__string(name, rproc->name)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   48  		__string(firmware, rproc->firmware)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   49  		__field(int, ret)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   50  	),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   51  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   52  	TP_fast_assign(
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   53  		__assign_str(name, rproc->name);
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   54  		__assign_str(firmware, rproc->firmware);
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   55  		__entry->ret = ret;
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   56  	),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   57  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   58  	TP_printk("%s attaching returned %d",
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   59  			__get_str(name),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   60  			__entry->ret)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   61  );
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   62  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12  @63  TRACE_EVENT(rproc_start_event,
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   64  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   65  	TP_PROTO(struct rproc *rproc, int ret),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   66  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   67  	TP_ARGS(rproc, ret),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   68  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   69  	TP_STRUCT__entry(
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   70  		__string(name, rproc->name)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   71  		__field(int, ret)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   72  	),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   73  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   74  	TP_fast_assign(
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   75  		__assign_str(name, rproc->name);
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   76  		__entry->ret = ret;
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   77  	),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   78  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   79  	TP_printk("%s %d", __get_str(name), __entry->ret)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   80  );
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   81  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12  @82  TRACE_EVENT(rproc_stop_event,
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   83  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   84  	TP_PROTO(struct rproc *rproc, const char *crash_msg),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   85  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   86  	TP_ARGS(rproc, crash_msg),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   87  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   88  	TP_STRUCT__entry(
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   89  		__string(name, rproc->name)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   90  		__string(crash_msg, crash_msg)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   91  	),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   92  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   93  	TP_fast_assign(
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   94  		__assign_str(name, rproc->name);
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   95  		__assign_str(crash_msg, crash_msg)
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   96  	),
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   97  
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   98  	TP_printk("%s %s", __get_str(name), __get_str(crash_msg))
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12   99  );
f73173f7e78a04 Gokul krishna Krishnakumar 2023-06-12  100  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
  2023-06-12 22:03 ` [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
  2023-06-13  6:08   ` kernel test robot
@ 2023-06-13  6:19   ` kernel test robot
  2023-06-13  7:42   ` kernel test robot
  2023-06-13 15:28   ` Steven Rostedt
  3 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-06-13  6:19 UTC (permalink / raw)
  To: Gokul krishna Krishnakumar, linux-arm-msm, linux-remoteproc,
	linux-trace-kernel
  Cc: llvm, oe-kbuild-all, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	linux-kernel, Trilok Soni, Satya Durga Srinivasu Prabhala,
	Rajendra Nayak, Elliot Berman, Guru Das Srinagesh, Sibi Sankar,
	Melody Olvera, Gokul krishna Krishnakumar

Hi Gokul,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1ca04f21b204e99dd704146231adfb79ea2fb366]

url:    https://github.com/intel-lab-lkp/linux/commits/Gokul-krishna-Krishnakumar/remoteproc-Introduce-traces-for-remoteproc-events/20230613-060527
base:   1ca04f21b204e99dd704146231adfb79ea2fb366
patch link:    https://lore.kernel.org/r/12b533c73b8c6b039e90f20afef1c8dcd30b80de.1686606835.git.quic_gokukris%40quicinc.com
patch subject: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
config: hexagon-randconfig-r041-20230612 (https://download.01.org/0day-ci/archive/20230613/202306131424.QEYiIiQA-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 1ca04f21b204e99dd704146231adfb79ea2fb366
        b4 shazam https://lore.kernel.org/r/12b533c73b8c6b039e90f20afef1c8dcd30b80de.1686606835.git.quic_gokukris@quicinc.com
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=hexagon olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306131424.QEYiIiQA-lkp@intel.com/

All errors (new ones prefixed by >>):

>> ld.lld: error: undefined symbol: __tracepoint_rproc_start_event
   >>> referenced by jump_label.h:260 (include/linux/jump_label.h:260)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_boot) in archive vmlinux.a
   >>> referenced by jump_label.h:260 (include/linux/jump_label.h:260)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_boot) in archive vmlinux.a
   >>> referenced by jump_label.h:260 (include/linux/jump_label.h:260)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_boot) in archive vmlinux.a
   >>> referenced 1 more times
--
>> ld.lld: error: undefined symbol: __traceiter_rproc_start_event
   >>> referenced by remoteproc_tracepoints.h:63 (include/trace/events/remoteproc_tracepoints.h:63)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_boot) in archive vmlinux.a
   >>> referenced by remoteproc_tracepoints.h:63 (include/trace/events/remoteproc_tracepoints.h:63)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_boot) in archive vmlinux.a
   >>> referenced by remoteproc_tracepoints.h:63 (include/trace/events/remoteproc_tracepoints.h:63)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_boot) in archive vmlinux.a
   >>> referenced 1 more times
--
>> ld.lld: error: undefined symbol: __tracepoint_rproc_load_segment_event
   >>> referenced by remoteproc_internal.h:178 (drivers/remoteproc/remoteproc_internal.h:178)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_start) in archive vmlinux.a
   >>> referenced by remoteproc_internal.h:178 (drivers/remoteproc/remoteproc_internal.h:178)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_start) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: __traceiter_rproc_load_segment_event
   >>> referenced by remoteproc_tracepoints.h:17 (include/trace/events/remoteproc_tracepoints.h:17)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_start) in archive vmlinux.a
   >>> referenced by remoteproc_tracepoints.h:17 (include/trace/events/remoteproc_tracepoints.h:17)
   >>>               drivers/remoteproc/remoteproc_core.o:(rproc_start) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: __tracepoint_rproc_stop_event
   >>> referenced by jump_label.h:260 (include/linux/jump_label.h:260)
   >>>               drivers/remoteproc/remoteproc_core.o:(trace_rproc_stop_event) in archive vmlinux.a
   >>> referenced by jump_label.h:260 (include/linux/jump_label.h:260)
   >>>               drivers/remoteproc/remoteproc_core.o:(trace_rproc_stop_event) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: __traceiter_rproc_stop_event
   >>> referenced by remoteproc_tracepoints.h:82 (include/trace/events/remoteproc_tracepoints.h:82)
   >>>               drivers/remoteproc/remoteproc_core.o:(trace_rproc_stop_event) in archive vmlinux.a
   >>> referenced by remoteproc_tracepoints.h:82 (include/trace/events/remoteproc_tracepoints.h:82)
   >>>               drivers/remoteproc/remoteproc_core.o:(trace_rproc_stop_event) in archive vmlinux.a

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
  2023-06-12 22:03 ` [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
  2023-06-13  6:08   ` kernel test robot
  2023-06-13  6:19   ` kernel test robot
@ 2023-06-13  7:42   ` kernel test robot
  2023-06-13 15:28   ` Steven Rostedt
  3 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-06-13  7:42 UTC (permalink / raw)
  To: Gokul krishna Krishnakumar, linux-arm-msm, linux-remoteproc,
	linux-trace-kernel
  Cc: oe-kbuild-all, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	linux-kernel, Trilok Soni, Satya Durga Srinivasu Prabhala,
	Rajendra Nayak, Elliot Berman, Guru Das Srinagesh, Sibi Sankar,
	Melody Olvera, Gokul krishna Krishnakumar

Hi Gokul,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1ca04f21b204e99dd704146231adfb79ea2fb366]

url:    https://github.com/intel-lab-lkp/linux/commits/Gokul-krishna-Krishnakumar/remoteproc-Introduce-traces-for-remoteproc-events/20230613-060527
base:   1ca04f21b204e99dd704146231adfb79ea2fb366
patch link:    https://lore.kernel.org/r/12b533c73b8c6b039e90f20afef1c8dcd30b80de.1686606835.git.quic_gokukris%40quicinc.com
patch subject: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
config: microblaze-randconfig-r003-20230612 (https://download.01.org/0day-ci/archive/20230613/202306131523.EwZZ3cVl-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 1ca04f21b204e99dd704146231adfb79ea2fb366
        b4 shazam https://lore.kernel.org/r/12b533c73b8c6b039e90f20afef1c8dcd30b80de.1686606835.git.quic_gokukris@quicinc.com
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=microblaze olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=microblaze SHELL=/bin/bash

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306131523.EwZZ3cVl-lkp@intel.com/

All errors (new ones prefixed by >>):

   microblaze-linux-ld: drivers/remoteproc/remoteproc_core.o: in function `rproc_stop':
>> .tmp_gl_remoteproc_core.o:(.text+0xe1c): undefined reference to `__tracepoint_rproc_stop_event'
>> microblaze-linux-ld: .tmp_gl_remoteproc_core.o:(.text+0xe94): undefined reference to `__traceiter_rproc_stop_event'
   microblaze-linux-ld: drivers/remoteproc/remoteproc_core.o: in function `rproc_start':
>> .tmp_gl_remoteproc_core.o:(.text.unlikely+0x664): undefined reference to `__tracepoint_rproc_load_segment_event'
>> microblaze-linux-ld: .tmp_gl_remoteproc_core.o:(.text.unlikely+0x6dc): undefined reference to `__traceiter_rproc_load_segment_event'
   microblaze-linux-ld: drivers/remoteproc/remoteproc_core.o: in function `trace_rproc_start_event':
>> .tmp_gl_remoteproc_core.o:(.text.unlikely+0x8c8): undefined reference to `__tracepoint_rproc_start_event'
>> microblaze-linux-ld: .tmp_gl_remoteproc_core.o:(.text.unlikely+0x948): undefined reference to `__traceiter_rproc_start_event'

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
  2023-06-12 22:03 ` [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
                     ` (2 preceding siblings ...)
  2023-06-13  7:42   ` kernel test robot
@ 2023-06-13 15:28   ` Steven Rostedt
  3 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2023-06-13 15:28 UTC (permalink / raw)
  To: Gokul krishna Krishnakumar
  Cc: linux-arm-msm, linux-remoteproc, linux-trace-kernel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, linux-kernel, Trilok Soni,
	Satya Durga Srinivasu Prabhala, Rajendra Nayak, Elliot Berman,
	Guru Das Srinagesh, Sibi Sankar, Melody Olvera

On Mon, 12 Jun 2023 15:03:26 -0700
Gokul krishna Krishnakumar <quic_gokukris@quicinc.com> wrote:

> diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h
> index d4dbb8d1d80c..f7cb31b94a60 100644
> --- a/drivers/remoteproc/remoteproc_internal.h
> +++ b/drivers/remoteproc/remoteproc_internal.h
> @@ -14,6 +14,7 @@
>  
>  #include <linux/irqreturn.h>
>  #include <linux/firmware.h>
> +#include <trace/events/remoteproc_tracepoints.h>
>  
>  struct rproc;
>  
> @@ -171,8 +172,13 @@ u64 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw)
>  static inline
>  int rproc_load_segments(struct rproc *rproc, const struct firmware *fw)
>  {
> -	if (rproc->ops->load)
> -		return rproc->ops->load(rproc, fw);
> +	if (rproc->ops->load) {
> +		int ret;
> +
> +		ret = rproc->ops->load(rproc, fw);
> +		trace_rproc_load_segment_event(rproc, ret);
> +		return ret;
> +	}
>  
>  	return -EINVAL;
>  }

So, tracepoints in header files tend to cause problems due to the way they
are created. See the comment in include/linux/tracepoint-defs.h.

What you need to do is:

#include <linux/tracepoint-defs.h>

DECLARE_TRACEPOINT(rproc_load_segment_event);

extern void call_trace_rproc_load_segment_event(struct rproc *rproc, int ret);

static inline void test_trace_rproc_load_segment_event(struct rproc *rproc, int ret)
{
	if (trace_rproc_load_segment_event_enabled())
		call_trace_rproc_load_segment_event(rproc, ret);
}

After adding the above in the header. In the C file, add:

void call_trace_rproc_load_segment_event(struct rproc *rproc, int ret)
{
	trace_rproc_load_segment_event(rproc, ret);
}

-- Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-13 15:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 22:03 [PATCH v5 0/2] Patches for introducing traces in remoteproc Gokul krishna Krishnakumar
2023-06-12 22:03 ` [PATCH v5 1/2] remoteproc: Introduce traces for remoteproc events Gokul krishna Krishnakumar
2023-06-12 22:03 ` [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
2023-06-13  6:08   ` kernel test robot
2023-06-13  6:19   ` kernel test robot
2023-06-13  7:42   ` kernel test robot
2023-06-13 15:28   ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).