@@ -228,41 +228,87 @@ static const char *nvme_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
228
228
229
229
static const char * nvme_trace_resv_reg (struct trace_seq * p , u8 * cdw10 )
230
230
{
231
+ static const char * const rrega_strs [] = {
232
+ [0x00 ] = "register" ,
233
+ [0x01 ] = "unregister" ,
234
+ [0x02 ] = "replace" ,
235
+ };
231
236
const char * ret = trace_seq_buffer_ptr (p );
232
237
u8 rrega = cdw10 [0 ] & 0x7 ;
233
238
u8 iekey = (cdw10 [0 ] >> 3 ) & 0x1 ;
234
239
u8 ptpl = (cdw10 [3 ] >> 6 ) & 0x3 ;
240
+ const char * rrega_str ;
241
+
242
+ if (rrega < ARRAY_SIZE (rrega_strs ) && rrega_strs [rrega ])
243
+ rrega_str = rrega_strs [rrega ];
244
+ else
245
+ rrega_str = "reserved" ;
235
246
236
- trace_seq_printf (p , "rrega=%u, iekey=%u, ptpl=%u" ,
237
- rrega , iekey , ptpl );
247
+ trace_seq_printf (p , "rrega=%u:%s , iekey=%u, ptpl=%u" ,
248
+ rrega , rrega_str , iekey , ptpl );
238
249
trace_seq_putc (p , 0 );
239
250
240
251
return ret ;
241
252
}
242
253
254
+ static const char * const rtype_strs [] = {
255
+ [0x00 ] = "reserved" ,
256
+ [0x01 ] = "write exclusive" ,
257
+ [0x02 ] = "exclusive access" ,
258
+ [0x03 ] = "write exclusive registrants only" ,
259
+ [0x04 ] = "exclusive access registrants only" ,
260
+ [0x05 ] = "write exclusive all registrants" ,
261
+ [0x06 ] = "exclusive access all registrants" ,
262
+ };
263
+
243
264
static const char * nvme_trace_resv_acq (struct trace_seq * p , u8 * cdw10 )
244
265
{
266
+ static const char * const racqa_strs [] = {
267
+ [0x00 ] = "acquire" ,
268
+ [0x01 ] = "preempt" ,
269
+ [0x02 ] = "preempt and abort" ,
270
+ };
245
271
const char * ret = trace_seq_buffer_ptr (p );
246
272
u8 racqa = cdw10 [0 ] & 0x7 ;
247
273
u8 iekey = (cdw10 [0 ] >> 3 ) & 0x1 ;
248
274
u8 rtype = cdw10 [1 ];
275
+ const char * racqa_str = "reserved" ;
276
+ const char * rtype_str = "reserved" ;
249
277
250
- trace_seq_printf (p , "racqa=%u, iekey=%u, rtype=%u" ,
251
- racqa , iekey , rtype );
278
+ if (racqa < ARRAY_SIZE (racqa_strs ) && racqa_strs [racqa ])
279
+ racqa_str = racqa_strs [racqa ];
280
+
281
+ if (rtype < ARRAY_SIZE (rtype_strs ) && rtype_strs [rtype ])
282
+ rtype_str = rtype_strs [rtype ];
283
+
284
+ trace_seq_printf (p , "racqa=%u:%s, iekey=%u, rtype=%u:%s" ,
285
+ racqa , racqa_str , iekey , rtype , rtype_str );
252
286
trace_seq_putc (p , 0 );
253
287
254
288
return ret ;
255
289
}
256
290
257
291
static const char * nvme_trace_resv_rel (struct trace_seq * p , u8 * cdw10 )
258
292
{
293
+ static const char * const rrela_strs [] = {
294
+ [0x00 ] = "release" ,
295
+ [0x01 ] = "clear" ,
296
+ };
259
297
const char * ret = trace_seq_buffer_ptr (p );
260
298
u8 rrela = cdw10 [0 ] & 0x7 ;
261
299
u8 iekey = (cdw10 [0 ] >> 3 ) & 0x1 ;
262
300
u8 rtype = cdw10 [1 ];
301
+ const char * rrela_str = "reserved" ;
302
+ const char * rtype_str = "reserved" ;
303
+
304
+ if (rrela < ARRAY_SIZE (rrela_strs ) && rrela_strs [rrela ])
305
+ rrela_str = rrela_strs [rrela ];
306
+
307
+ if (rtype < ARRAY_SIZE (rtype_strs ) && rtype_strs [rtype ])
308
+ rtype_str = rtype_strs [rtype ];
263
309
264
- trace_seq_printf (p , "rrela=%u, iekey=%u, rtype=%u" ,
265
- rrela , iekey , rtype );
310
+ trace_seq_printf (p , "rrela=%u:%s , iekey=%u, rtype=%u:%s " ,
311
+ rrela , rrela_str , iekey , rtype , rtype_str );
266
312
trace_seq_putc (p , 0 );
267
313
268
314
return ret ;
0 commit comments