s390 cio: Rewrite trace point in s390_cio_tpi
authorThomas Richter <tmricht@linux.ibm.com>
Tue, 3 Jul 2018 08:15:10 +0000 (10:15 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 23 Jul 2018 11:49:53 +0000 (13:49 +0200)
Tools like 'perf stat' parse the trace point format files defined
in /sys/kernel/debug/tracing/events/s390/.../format to handle
the print fmt: statement. The kernel provides a library in
directory linux/tools/lib/traceevent/* for this reason.

This library can not handle structures or unions defined in
the TRACE_EVENT/TP_STRUCT__entry macros with __field_struct macro.
There is no possibility to extract a structure member
(which might be a bit field) since there is no packing
information nor bit field offset by parsing the printf fmt line.

Therefore rewrite the TRACE_EVENT macro and add the
__field macro for the members adapter_IO, isc and type
of struct tpi_info.

Note that the same information is displayed, this is no
interface change.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Acked-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/trace.h

index ab0144c8a7d38c8d47409006eb238aae7d3907b0..5c06b680471e807edfe3c3864d442cae24b32399 100644 (file)
@@ -122,6 +122,9 @@ TRACE_EVENT(s390_cio_tpi,
                __field(u8, cssid)
                __field(u8, ssid)
                __field(u16, schno)
+               __field(u8, adapter_IO)
+               __field(u8, isc)
+               __field(u8, type)
        ),
        TP_fast_assign(
                __entry->cc = cc;
@@ -136,11 +139,14 @@ TRACE_EVENT(s390_cio_tpi,
                __entry->cssid = __entry->tpi_info.schid.cssid;
                __entry->ssid = __entry->tpi_info.schid.ssid;
                __entry->schno = __entry->tpi_info.schid.sch_no;
+               __entry->adapter_IO = __entry->tpi_info.adapter_IO;
+               __entry->isc = __entry->tpi_info.isc;
+               __entry->type = __entry->tpi_info.type;
        ),
        TP_printk("schid=%x.%x.%04x cc=%d a=%d isc=%d type=%d",
                  __entry->cssid, __entry->ssid, __entry->schno, __entry->cc,
-                 __entry->tpi_info.adapter_IO, __entry->tpi_info.isc,
-                 __entry->tpi_info.type
+                 __entry->adapter_IO, __entry->isc,
+                 __entry->type
        )
 );