[PATCH v2 5/7] platform/x86/intel/ifs: Trace support for array test

From: Jithu Joseph
Date: Tue Feb 14 2023 - 18:46:14 EST


Enable tracing support in array test flow.

Signed-off-by: Jithu Joseph <jithu.joseph@xxxxxxxxx>
Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
---
include/trace/events/intel_ifs.h | 25 ++++++++++++++++++++++++
drivers/platform/x86/intel/ifs/runtest.c | 1 +
2 files changed, 26 insertions(+)

diff --git a/include/trace/events/intel_ifs.h b/include/trace/events/intel_ifs.h
index d7353024016c..d15037943b80 100644
--- a/include/trace/events/intel_ifs.h
+++ b/include/trace/events/intel_ifs.h
@@ -35,6 +35,31 @@ TRACE_EVENT(ifs_status,
__entry->status)
);

+TRACE_EVENT(ifs_array,
+
+ TP_PROTO(int cpu, union ifs_array activate, union ifs_array status),
+
+ TP_ARGS(cpu, activate, status),
+
+ TP_STRUCT__entry(
+ __field( u64, activate )
+ __field( u64, status )
+ __field( int, cpu )
+ ),
+
+ TP_fast_assign(
+ __entry->activate = activate.data;
+ __entry->status = status.data;
+ __entry->cpu = cpu;
+ ),
+
+ TP_printk("cpu: %d, array_list: %.8llx, array_bank: %.4llx, status: %.16llx",
+ __entry->cpu,
+ __entry->activate & 0xffffffff,
+ (__entry->activate >> 32) & 0xffff,
+ __entry->status)
+);
+
#endif /* _TRACE_IFS_H */

/* This part must be outside protection */
diff --git a/drivers/platform/x86/intel/ifs/runtest.c b/drivers/platform/x86/intel/ifs/runtest.c
index 12880fca0aa8..e74004fab1aa 100644
--- a/drivers/platform/x86/intel/ifs/runtest.c
+++ b/drivers/platform/x86/intel/ifs/runtest.c
@@ -299,6 +299,7 @@ static void ifs_array_test_core(int cpu, struct device *dev)
stop_core_cpuslocked(cpu, do_array_test, msrvals);
status.data = msrvals[1];

+ trace_ifs_array(cpu, activate, status);
if (status.ctrl_result)
break;

--
2.25.1