summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.ibm.com>2025-10-17 12:14:13 +0200
committerHeiko Carstens <hca@linux.ibm.com>2025-10-21 11:09:21 +0200
commit507cff242a98a9712081197d63e0fdc99d9ed3dd (patch)
tree23f30e2a9e08eb745d1b7f69ec5e0eba76bab793
parent215231deeadd5942ce9fd61ea420c2c2105f6459 (diff)
s390/zcrypt: Rework zcrypt request and reply trace event definition
This is a slight rework of the s390_zcrypt_req and s390_zcrypt_rep trace event: - the psmid has been added to the s390_zcrypt_rep - "dev" renamed to "card" - "domain" renamed to "dom" The motivation of these changes is to make these traces more aligned to new upcoming traces for AP bus related trace events. Additionally the psmid is needed to match the reply (and thus indirect the request) to AP bus related trace events where only the psmid is unique identifying AP messages. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Anthony Krowiak <akrowiak@linux.ibm.com> Reviewed-by: Holger Dengler <dengler@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-rw-r--r--arch/s390/include/asm/trace/zcrypt.h44
-rw-r--r--drivers/s390/crypto/zcrypt_api.c15
2 files changed, 34 insertions, 25 deletions
diff --git a/arch/s390/include/asm/trace/zcrypt.h b/arch/s390/include/asm/trace/zcrypt.h
index 457ddaa99e19..bfb01e335f31 100644
--- a/arch/s390/include/asm/trace/zcrypt.h
+++ b/arch/s390/include/asm/trace/zcrypt.h
@@ -2,7 +2,7 @@
/*
* Tracepoint definitions for the s390 zcrypt device driver
*
- * Copyright IBM Corp. 2016
+ * Copyright IBM Corp. 2016,2025
* Author(s): Harald Freudenberger <freude@de.ibm.com>
*
* Currently there are two tracepoint events defined here.
@@ -73,14 +73,15 @@ TRACE_EVENT(s390_zcrypt_req,
/**
* trace_s390_zcrypt_rep - zcrypt reply tracepoint function
- * @ptr: Address of the local buffer where the request from userspace
- * is stored. Can be used as a unique id to match together
- * request and reply.
- * @fc: Function code.
- * @rc: The bare returncode as returned by the device driver ioctl
- * function.
- * @dev: The adapter nr where this request was actually processed.
- * @dom: Domain id of the device where this request was processed.
+ * @ptr: Address of the local buffer where the request from userspace
+ * is stored. Can be used as a unique id to match together
+ * request and reply.
+ * @fc: Function code.
+ * @rc: The bare returncode as returned by the device driver ioctl
+ * function.
+ * @card: The adapter nr where this request was actually processed.
+ * @dom: Domain id of the device where this request was processed.
+ * @psmid: Unique id identifying this request/reply.
*
* Called upon recognising the reply from the crypto adapter. This
* message may act as the exit timestamp for the request but also
@@ -88,26 +89,29 @@ TRACE_EVENT(s390_zcrypt_req,
* and the returncode from the device driver.
*/
TRACE_EVENT(s390_zcrypt_rep,
- TP_PROTO(void *ptr, u32 fc, u32 rc, u16 dev, u16 dom),
- TP_ARGS(ptr, fc, rc, dev, dom),
+ TP_PROTO(void *ptr, u32 fc, u32 rc, u16 card, u16 dom, u64 psmid),
+ TP_ARGS(ptr, fc, rc, card, dom, psmid),
TP_STRUCT__entry(
__field(void *, ptr)
__field(u32, fc)
__field(u32, rc)
- __field(u16, device)
- __field(u16, domain)),
+ __field(u16, card)
+ __field(u16, dom)
+ __field(u64, psmid)),
TP_fast_assign(
__entry->ptr = ptr;
__entry->fc = fc;
__entry->rc = rc;
- __entry->device = dev;
- __entry->domain = dom;),
- TP_printk("ptr=%p fc=0x%04x rc=%d dev=0x%02hx domain=0x%04hx",
+ __entry->card = card;
+ __entry->dom = dom;
+ __entry->psmid = psmid;),
+ TP_printk("ptr=%p fc=0x%04x rc=%d card=%u dom=%u psmid=0x%016lx",
__entry->ptr,
- (unsigned int) __entry->fc,
- (int) __entry->rc,
- (unsigned short) __entry->device,
- (unsigned short) __entry->domain)
+ (unsigned int)__entry->fc,
+ (int)__entry->rc,
+ (unsigned short)__entry->card,
+ (unsigned short)__entry->dom,
+ (unsigned long)__entry->psmid)
);
#endif /* _TRACE_S390_ZCRYPT_H */
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index 4e6bf1cb3475..2b67b6b02ad5 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -740,7 +740,8 @@ out:
tr->last_qid = qid;
}
trace_s390_zcrypt_rep(mex, func_code, rc,
- AP_QID_CARD(qid), AP_QID_QUEUE(qid));
+ AP_QID_CARD(qid), AP_QID_QUEUE(qid),
+ ap_msg.psmid);
return rc;
}
@@ -845,7 +846,8 @@ out:
tr->last_qid = qid;
}
trace_s390_zcrypt_rep(crt, func_code, rc,
- AP_QID_CARD(qid), AP_QID_QUEUE(qid));
+ AP_QID_CARD(qid), AP_QID_QUEUE(qid),
+ ap_msg.psmid);
return rc;
}
@@ -980,7 +982,8 @@ out:
tr->last_qid = qid;
}
trace_s390_zcrypt_rep(xcrb, func_code, rc,
- AP_QID_CARD(qid), AP_QID_QUEUE(qid));
+ AP_QID_CARD(qid), AP_QID_QUEUE(qid),
+ ap_msg.psmid);
return rc;
}
@@ -1182,7 +1185,8 @@ out:
tr->last_qid = qid;
}
trace_s390_zcrypt_rep(xcrb, func_code, rc,
- AP_QID_CARD(qid), AP_QID_QUEUE(qid));
+ AP_QID_CARD(qid), AP_QID_QUEUE(qid),
+ ap_msg.psmid);
return rc;
}
@@ -1274,7 +1278,8 @@ static long zcrypt_rng(char *buffer)
out:
ap_release_apmsg(&ap_msg);
trace_s390_zcrypt_rep(buffer, func_code, rc,
- AP_QID_CARD(qid), AP_QID_QUEUE(qid));
+ AP_QID_CARD(qid), AP_QID_QUEUE(qid),
+ ap_msg.psmid);
return rc;
}