@@ -489,9 +489,9 @@ int get_telemetry_das_offset_and_size(
489489 return 0 ;
490490}
491491
492- int get_static_id_ascii_string (int identifier , char * description )
492+ int get_statistic_id_ascii_string (int identifier , char * description )
493493{
494- if (pstring_buffer == NULL )
494+ if (! pstring_buffer || ! description )
495495 return -1 ;
496496
497497 struct nvme_ocp_telemetry_string_header * pocp_ts_header =
@@ -522,16 +522,17 @@ int get_static_id_ascii_string(int identifier, char *description)
522522 memcpy (description , pdescription ,
523523 peach_statistic_entry -> ascii_id_length + 1 );
524524
525- // If ASCII string isn't found, see in our internal Map
526- // for 2.5 Spec defined strings (id < 0x1D).
527- if ((description == NULL ) && (identifier < 0x1D ))
528- memcpy (description ,
529- statistic_identifiers_map [identifier ].description ,
530- peach_statistic_entry -> ascii_id_length + 1 );
531525 return 0 ;
532526 }
533527 }
534528
529+ // If ASCII string isn't found, see in our internal Map
530+ // for 2.5 Spec defined strings
531+ if (identifier <= 0x1D ) {
532+ strcpy (description , statistic_identifiers_map [identifier ].description );
533+ return 0 ;
534+ }
535+
535536 return -1 ;
536537}
537538
@@ -629,10 +630,10 @@ int parse_ocp_telemetry_string_log(int event_fifo_num, int identifier, int debug
629630 }
630631
631632 if (string_table == STATISTICS_IDENTIFIER_STRING )
632- get_static_id_ascii_string (identifier , description );
633- else if (string_table == EVENT_STRING )
633+ get_statistic_id_ascii_string (identifier , description );
634+ else if (string_table == EVENT_STRING && debug_event_class < 0x80 )
634635 get_event_id_ascii_string (identifier , debug_event_class , description );
635- else if (string_table == VU_EVENT_STRING )
636+ else if (string_table == VU_EVENT_STRING || debug_event_class >= 0x80 )
636637 get_vu_event_id_ascii_string (identifier , debug_event_class , description );
637638
638639 return 0 ;
0 commit comments