File Index
Files and directories
Sign in
FILE

zcrypt.h

File preview with syntax highlighting.

linux-6.19.14/arch/s390/include/asm/trace/zcrypt.h C
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 * Tracepoint definitions for the s390 zcrypt device driver
  4 *
  5 * Copyright IBM Corp. 2016,2025
  6 * Author(s): Harald Freudenberger <freude@de.ibm.com>
  7 *
  8 * Currently there are two tracepoint events defined here.
  9 * An s390_zcrypt_req request event occurs as soon as the request is
 10 * recognized by the zcrypt ioctl function. This event may act as some kind
 11 * of request-processing-starts-now indication.
 12 * As late as possible within the zcrypt ioctl function there occurs the
 13 * s390_zcrypt_rep event which may act as the point in time where the
 14 * request has been processed by the kernel and the result is about to be
 15 * transferred back to userspace.
 16 * The glue which binds together request and reply event is the ptr
 17 * parameter, which is the local buffer address where the request from
 18 * userspace has been stored by the ioctl function.
 19 *
 20 * The main purpose of this zcrypt tracepoint api is to get some data for
 21 * performance measurements together with information about on which card
 22 * and queue the request has been processed. It is not an ffdc interface as
 23 * there is already code in the zcrypt device driver to serve the s390
 24 * debug feature interface.
 25 */
 26
 27#undef TRACE_SYSTEM
 28#define TRACE_SYSTEM s390
 29
 30#if !defined(_TRACE_S390_ZCRYPT_H) || defined(TRACE_HEADER_MULTI_READ)
 31#define _TRACE_S390_ZCRYPT_H
 32
 33#include <linux/tracepoint.h>
 34
 35#define TP_ICARSAMODEXPO  0x0001
 36#define TP_ICARSACRT	  0x0002
 37#define TB_ZSECSENDCPRB   0x0003
 38#define TP_ZSENDEP11CPRB  0x0004
 39#define TP_HWRNGCPRB	  0x0005
 40
 41#define show_zcrypt_tp_type(type)				\
 42	__print_symbolic(type,					\
 43			 { TP_ICARSAMODEXPO, "ICARSAMODEXPO" }, \
 44			 { TP_ICARSACRT, "ICARSACRT" },		\
 45			 { TB_ZSECSENDCPRB, "ZSECSENDCPRB" },	\
 46			 { TP_ZSENDEP11CPRB, "ZSENDEP11CPRB" }, \
 47			 { TP_HWRNGCPRB, "HWRNGCPRB" })
 48
 49/**
 50 * trace_s390_zcrypt_req - zcrypt request tracepoint function
 51 * @ptr:  Address of the local buffer where the request from userspace
 52 *	  is stored. Can be used as a unique id to relate together
 53 *	  request and reply.
 54 * @type: One of the TP_ defines above.
 55 *
 56 * Called when a request from userspace is recognised within the ioctl
 57 * function of the zcrypt device driver and may act as an entry
 58 * timestamp.
 59 */
 60TRACE_EVENT(s390_zcrypt_req,
 61	    TP_PROTO(void *ptr, u32 type),
 62	    TP_ARGS(ptr, type),
 63	    TP_STRUCT__entry(
 64		    __field(void *, ptr)
 65		    __field(u32, type)),
 66	    TP_fast_assign(
 67		    __entry->ptr = ptr;
 68		    __entry->type = type;),
 69	    TP_printk("ptr=%p type=%s",
 70		      __entry->ptr,
 71		      show_zcrypt_tp_type(__entry->type))
 72);
 73
 74/**
 75 * trace_s390_zcrypt_rep - zcrypt reply tracepoint function
 76 * @ptr:   Address of the local buffer where the request from userspace
 77 *	   is stored. Can be used as a unique id to match together
 78 *	   request and reply.
 79 * @fc:    Function code.
 80 * @rc:    The bare returncode as returned by the device driver ioctl
 81 *	   function.
 82 * @card:  The adapter nr where this request was actually processed.
 83 * @dom:   Domain id of the device where this request was processed.
 84 * @psmid: Unique id identifying this request/reply.
 85 *
 86 * Called upon recognising the reply from the crypto adapter. This
 87 * message may act as the exit timestamp for the request but also
 88 * carries some info about on which adapter the request was processed
 89 * and the returncode from the device driver.
 90 */
 91TRACE_EVENT(s390_zcrypt_rep,
 92	    TP_PROTO(void *ptr, u32 fc, u32 rc, u16 card, u16 dom, u64 psmid),
 93	    TP_ARGS(ptr, fc, rc, card, dom, psmid),
 94	    TP_STRUCT__entry(
 95		    __field(void *, ptr)
 96		    __field(u32, fc)
 97		    __field(u32, rc)
 98		    __field(u16, card)
 99		    __field(u16, dom)
100		    __field(u64, psmid)),
101	    TP_fast_assign(
102		    __entry->ptr = ptr;
103		    __entry->fc = fc;
104		    __entry->rc = rc;
105		    __entry->card = card;
106		    __entry->dom = dom;
107		    __entry->psmid = psmid;),
108	    TP_printk("ptr=%p fc=0x%04x rc=%d card=%u dom=%u psmid=0x%016lx",
109		      __entry->ptr,
110		      (unsigned int)__entry->fc,
111		      (int)__entry->rc,
112		      (unsigned short)__entry->card,
113		      (unsigned short)__entry->dom,
114		      (unsigned long)__entry->psmid)
115);
116
117#endif /* _TRACE_S390_ZCRYPT_H */
118
119/* This part must be outside protection */
120
121#undef TRACE_INCLUDE_PATH
122#undef TRACE_INCLUDE_FILE
123
124#define TRACE_INCLUDE_PATH asm/trace
125#define TRACE_INCLUDE_FILE zcrypt
126
127#include <trace/define_trace.h>
~/ Read-only file preview.