Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40d8c86b authored by Sudarshan Rajagopalan's avatar Sudarshan Rajagopalan Committed by Liam Mark
Browse files

iommu: arm-smmu: Add smmu init latency measurement



Ftrace event to print smmu init latency.

Change-Id: Ie8667a6cd7384347deae03a9ed998e2c198a3eb1
Signed-off-by: default avatarSudarshan Rajagopalan <sudaraja@codeaurora.org>
parent e49e0605
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@
#include <soc/qcom/secure_buffer.h>
#include <linux/of_platform.h>
#include <linux/msm-bus.h>
#include <trace/events/iommu.h>
#include <dt-bindings/msm/msm-bus-ids.h>

#include <linux/amba/bus.h>
@@ -4735,10 +4736,12 @@ static int __init arm_smmu_init(void)
{
	static bool registered;
	int ret = 0;
	ktime_t cur;

	if (registered)
		return 0;

	cur = ktime_get();
	ret = platform_driver_register(&qsmmuv500_tbu_driver);
	if (ret)
		return ret;
@@ -4748,6 +4751,8 @@ static int __init arm_smmu_init(void)
	ret = register_iommu_sec_ptbl();
#endif
	registered = !ret;
	trace_smmu_init(ktime_us_delta(ktime_get(), cur));

	return ret;
}

+18 −0
Original line number Diff line number Diff line
@@ -161,6 +161,24 @@ DEFINE_EVENT(iommu_error, io_page_fault,

	TP_ARGS(dev, iova, flags)
);

TRACE_EVENT(smmu_init,

	TP_PROTO(u64 time),

	TP_ARGS(time),

	TP_STRUCT__entry(
		__field(u64, time)
	),

	TP_fast_assign(
		__entry->time = time;
	),

	TP_printk("ARM SMMU init latency: %lld us", __entry->time)
);

#endif /* _TRACE_IOMMU_H */

/* This part must be outside protection */