Skip to content

Commit

Permalink
plugins/ocp: underflow + index fixes for telemetry
Browse files Browse the repository at this point in the history
Printing the GUID was crashing due to the unsigned int never becoming
less than 0, and fixing that triggered a warning about an incorrect max
index when printing Event FIFO data.

Signed-off-by: Brandon Paupore <[email protected]>
  • Loading branch information
brandon-paupore-sndk authored and igaw committed Jun 19, 2024
1 parent 7a90df9 commit af5f508
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/ocp/ocp-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ static void print_telemetry_data_area_1(struct telemetry_data_area_1 *da1,
int tele_type)
{
if (da1) {
unsigned int i = 0;
int i = 0;
if (tele_type == TELEMETRY_TYPE_HOST)
printf("============ Telemetry Host Data area 1 ============\n");
else
Expand Down Expand Up @@ -974,7 +974,7 @@ static void print_telemetry_data_area_1(struct telemetry_data_area_1 *da1,
printf("Data Area 2 Statistic Size : 0x%x\n", le16_to_cpu(da1->da2_stat_size));
for (i = 0; i < 32; i++)
printf("reserved5 : 0x%x\n", da1->reserved5[i]);
for (i = 0; i < 17; i++){
for (i = 0; i < 16; i++) {
printf("Event FIFO %d Data Area : 0x%x\n", i, da1->event_fifo_da[i]);
printf("Event FIFO %d Start : %"PRIu64"\n", i, le64_to_cpu(da1->event_fifo_start[i]));
printf("Event FIFO %d Size : %"PRIu64"\n", i, le64_to_cpu(da1->event_fifo_size[i]));
Expand Down

0 comments on commit af5f508

Please sign in to comment.