Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Harald Freudenberger and committed by
Heiko Carstens
507cff24 215231de

+34 -25
+24 -20
arch/s390/include/asm/trace/zcrypt.h
··· 2 2 /* 3 3 * Tracepoint definitions for the s390 zcrypt device driver 4 4 * 5 - * Copyright IBM Corp. 2016 5 + * Copyright IBM Corp. 2016,2025 6 6 * Author(s): Harald Freudenberger <freude@de.ibm.com> 7 7 * 8 8 * Currently there are two tracepoint events defined here. ··· 73 73 74 74 /** 75 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 - * @dev: The adapter nr where this request was actually processed. 83 - * @dom: Domain id of the device where this request was processed. 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. 84 85 * 85 86 * Called upon recognising the reply from the crypto adapter. This 86 87 * message may act as the exit timestamp for the request but also ··· 89 88 * and the returncode from the device driver. 90 89 */ 91 90 TRACE_EVENT(s390_zcrypt_rep, 92 - TP_PROTO(void *ptr, u32 fc, u32 rc, u16 dev, u16 dom), 93 - TP_ARGS(ptr, fc, rc, dev, dom), 91 + TP_PROTO(void *ptr, u32 fc, u32 rc, u16 card, u16 dom, u64 psmid), 92 + TP_ARGS(ptr, fc, rc, card, dom, psmid), 94 93 TP_STRUCT__entry( 95 94 __field(void *, ptr) 96 95 __field(u32, fc) 97 96 __field(u32, rc) 98 - __field(u16, device) 99 - __field(u16, domain)), 97 + __field(u16, card) 98 + __field(u16, dom) 99 + __field(u64, psmid)), 100 100 TP_fast_assign( 101 101 __entry->ptr = ptr; 102 102 __entry->fc = fc; 103 103 __entry->rc = rc; 104 - __entry->device = dev; 105 - __entry->domain = dom;), 106 - TP_printk("ptr=%p fc=0x%04x rc=%d dev=0x%02hx domain=0x%04hx", 104 + __entry->card = card; 105 + __entry->dom = dom; 106 + __entry->psmid = psmid;), 107 + TP_printk("ptr=%p fc=0x%04x rc=%d card=%u dom=%u psmid=0x%016lx", 107 108 __entry->ptr, 108 - (unsigned int) __entry->fc, 109 - (int) __entry->rc, 110 - (unsigned short) __entry->device, 111 - (unsigned short) __entry->domain) 109 + (unsigned int)__entry->fc, 110 + (int)__entry->rc, 111 + (unsigned short)__entry->card, 112 + (unsigned short)__entry->dom, 113 + (unsigned long)__entry->psmid) 112 114 ); 113 115 114 116 #endif /* _TRACE_S390_ZCRYPT_H */
+10 -5
drivers/s390/crypto/zcrypt_api.c
··· 740 740 tr->last_qid = qid; 741 741 } 742 742 trace_s390_zcrypt_rep(mex, func_code, rc, 743 - AP_QID_CARD(qid), AP_QID_QUEUE(qid)); 743 + AP_QID_CARD(qid), AP_QID_QUEUE(qid), 744 + ap_msg.psmid); 744 745 return rc; 745 746 } 746 747 ··· 846 845 tr->last_qid = qid; 847 846 } 848 847 trace_s390_zcrypt_rep(crt, func_code, rc, 849 - AP_QID_CARD(qid), AP_QID_QUEUE(qid)); 848 + AP_QID_CARD(qid), AP_QID_QUEUE(qid), 849 + ap_msg.psmid); 850 850 return rc; 851 851 } 852 852 ··· 982 980 tr->last_qid = qid; 983 981 } 984 982 trace_s390_zcrypt_rep(xcrb, func_code, rc, 985 - AP_QID_CARD(qid), AP_QID_QUEUE(qid)); 983 + AP_QID_CARD(qid), AP_QID_QUEUE(qid), 984 + ap_msg.psmid); 986 985 return rc; 987 986 } 988 987 ··· 1185 1182 tr->last_qid = qid; 1186 1183 } 1187 1184 trace_s390_zcrypt_rep(xcrb, func_code, rc, 1188 - AP_QID_CARD(qid), AP_QID_QUEUE(qid)); 1185 + AP_QID_CARD(qid), AP_QID_QUEUE(qid), 1186 + ap_msg.psmid); 1189 1187 return rc; 1190 1188 } 1191 1189 ··· 1278 1274 out: 1279 1275 ap_release_apmsg(&ap_msg); 1280 1276 trace_s390_zcrypt_rep(buffer, func_code, rc, 1281 - AP_QID_CARD(qid), AP_QID_QUEUE(qid)); 1277 + AP_QID_CARD(qid), AP_QID_QUEUE(qid), 1278 + ap_msg.psmid); 1282 1279 return rc; 1283 1280 } 1284 1281