@@ -228,41 +228,87 @@ static const char *nvme_trace_zone_mgmt_recv(struct trace_seq *p, u8 *cdw10)
228228
229229static const char * nvme_trace_resv_reg (struct trace_seq * p , u8 * cdw10 )
230230{
231+ static const char * const rrega_strs [] = {
232+ [0x00 ] = "register" ,
233+ [0x01 ] = "unregister" ,
234+ [0x02 ] = "replace" ,
235+ };
231236 const char * ret = trace_seq_buffer_ptr (p );
232237 u8 rrega = cdw10 [0 ] & 0x7 ;
233238 u8 iekey = (cdw10 [0 ] >> 3 ) & 0x1 ;
234239 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" ;
235246
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 );
238249 trace_seq_putc (p , 0 );
239250
240251 return ret ;
241252}
242253
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+
243264static const char * nvme_trace_resv_acq (struct trace_seq * p , u8 * cdw10 )
244265{
266+ static const char * const racqa_strs [] = {
267+ [0x00 ] = "acquire" ,
268+ [0x01 ] = "preempt" ,
269+ [0x02 ] = "preempt and abort" ,
270+ };
245271 const char * ret = trace_seq_buffer_ptr (p );
246272 u8 racqa = cdw10 [0 ] & 0x7 ;
247273 u8 iekey = (cdw10 [0 ] >> 3 ) & 0x1 ;
248274 u8 rtype = cdw10 [1 ];
275+ const char * racqa_str = "reserved" ;
276+ const char * rtype_str = "reserved" ;
249277
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 );
252286 trace_seq_putc (p , 0 );
253287
254288 return ret ;
255289}
256290
257291static const char * nvme_trace_resv_rel (struct trace_seq * p , u8 * cdw10 )
258292{
293+ static const char * const rrela_strs [] = {
294+ [0x00 ] = "release" ,
295+ [0x01 ] = "clear" ,
296+ };
259297 const char * ret = trace_seq_buffer_ptr (p );
260298 u8 rrela = cdw10 [0 ] & 0x7 ;
261299 u8 iekey = (cdw10 [0 ] >> 3 ) & 0x1 ;
262300 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 ];
263309
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 );
266312 trace_seq_putc (p , 0 );
267313
268314 return ret ;
0 commit comments