cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

spmi.h (3336B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2#undef TRACE_SYSTEM
      3#define TRACE_SYSTEM spmi
      4
      5#if !defined(_TRACE_SPMI_H) || defined(TRACE_HEADER_MULTI_READ)
      6#define _TRACE_SPMI_H
      7
      8#include <linux/spmi.h>
      9#include <linux/tracepoint.h>
     10
     11/*
     12 * drivers/spmi/spmi.c
     13 */
     14
     15TRACE_EVENT(spmi_write_begin,
     16	TP_PROTO(u8 opcode, u8 sid, u16 addr, u8 len, const u8 *buf),
     17	TP_ARGS(opcode, sid, addr, len, buf),
     18
     19	TP_STRUCT__entry(
     20		__field		( u8,         opcode    )
     21		__field		( u8,         sid       )
     22		__field		( u16,        addr      )
     23		__field		( u8,         len       )
     24		__dynamic_array	( u8,   buf,  len + 1   )
     25	),
     26
     27	TP_fast_assign(
     28		__entry->opcode = opcode;
     29		__entry->sid    = sid;
     30		__entry->addr   = addr;
     31		__entry->len    = len + 1;
     32		memcpy(__get_dynamic_array(buf), buf, len + 1);
     33	),
     34
     35	TP_printk("opc=%d sid=%02d addr=0x%04x len=%d buf=0x[%*phD]",
     36		  (int)__entry->opcode, (int)__entry->sid,
     37		  (int)__entry->addr, (int)__entry->len,
     38		  (int)__entry->len, __get_dynamic_array(buf))
     39);
     40
     41TRACE_EVENT(spmi_write_end,
     42	TP_PROTO(u8 opcode, u8 sid, u16 addr, int ret),
     43	TP_ARGS(opcode, sid, addr, ret),
     44
     45	TP_STRUCT__entry(
     46		__field		( u8,         opcode    )
     47		__field		( u8,         sid       )
     48		__field		( u16,        addr      )
     49		__field		( int,        ret       )
     50	),
     51
     52	TP_fast_assign(
     53		__entry->opcode = opcode;
     54		__entry->sid    = sid;
     55		__entry->addr   = addr;
     56		__entry->ret    = ret;
     57	),
     58
     59	TP_printk("opc=%d sid=%02d addr=0x%04x ret=%d",
     60		  (int)__entry->opcode, (int)__entry->sid,
     61		  (int)__entry->addr, __entry->ret)
     62);
     63
     64TRACE_EVENT(spmi_read_begin,
     65	TP_PROTO(u8 opcode, u8 sid, u16 addr),
     66	TP_ARGS(opcode, sid, addr),
     67
     68	TP_STRUCT__entry(
     69		__field		( u8,         opcode    )
     70		__field		( u8,         sid       )
     71		__field		( u16,        addr      )
     72	),
     73
     74	TP_fast_assign(
     75		__entry->opcode = opcode;
     76		__entry->sid    = sid;
     77		__entry->addr   = addr;
     78	),
     79
     80	TP_printk("opc=%d sid=%02d addr=0x%04x",
     81		  (int)__entry->opcode, (int)__entry->sid,
     82		  (int)__entry->addr)
     83);
     84
     85TRACE_EVENT(spmi_read_end,
     86	TP_PROTO(u8 opcode, u8 sid, u16 addr, int ret, u8 len, const u8 *buf),
     87	TP_ARGS(opcode, sid, addr, ret, len, buf),
     88
     89	TP_STRUCT__entry(
     90		__field		( u8,         opcode    )
     91		__field		( u8,         sid       )
     92		__field		( u16,        addr      )
     93		__field		( int,        ret       )
     94		__field		( u8,         len       )
     95		__dynamic_array	( u8,   buf,  len + 1   )
     96	),
     97
     98	TP_fast_assign(
     99		__entry->opcode = opcode;
    100		__entry->sid    = sid;
    101		__entry->addr   = addr;
    102		__entry->ret    = ret;
    103		__entry->len    = len + 1;
    104		memcpy(__get_dynamic_array(buf), buf, len + 1);
    105	),
    106
    107	TP_printk("opc=%d sid=%02d addr=0x%04x ret=%d len=%02d buf=0x[%*phD]",
    108		  (int)__entry->opcode, (int)__entry->sid,
    109		  (int)__entry->addr, __entry->ret, (int)__entry->len,
    110		  (int)__entry->len, __get_dynamic_array(buf))
    111);
    112
    113TRACE_EVENT(spmi_cmd,
    114	TP_PROTO(u8 opcode, u8 sid, int ret),
    115	TP_ARGS(opcode, sid, ret),
    116
    117	TP_STRUCT__entry(
    118		__field		( u8,         opcode    )
    119		__field		( u8,         sid       )
    120		__field		( int,        ret       )
    121	),
    122
    123	TP_fast_assign(
    124		__entry->opcode = opcode;
    125		__entry->sid    = sid;
    126		__entry->ret    = ret;
    127	),
    128
    129	TP_printk("opc=%d sid=%02d ret=%d", (int)__entry->opcode,
    130		  (int)__entry->sid, ret)
    131);
    132
    133#endif /* _TRACE_SPMI_H */
    134
    135/* This part must be outside protection */
    136#include <trace/define_trace.h>