json_free_object(root);
}
-void add_bitmap(int i, __u8 seb, struct json_object *root, int json_flag)
+static void json_add_bitmap(int i, __u8 seb, struct json_object *root)
{
char evt_str[50];
char key[128];
for (int bit = 0; bit < 8; bit++) {
if (nvme_pel_event_to_string(bit + i * 8)) {
- if (json_flag == 1) {
- sprintf(key, "bitmap_%x", (bit + i * 8));
- if ((seb >> bit) & 0x1)
- snprintf(evt_str, sizeof(evt_str), "Support %s",
- nvme_pel_event_to_string(bit + i * 8));
- json_object_add_value_string(root, key, evt_str);
- } else {
- if (nvme_pel_event_to_string(bit + i * 8))
- if ((seb >> bit) & 0x1)
- printf(" Support %s\n",
- nvme_pel_event_to_string(bit + i * 8));
- }
+ sprintf(key, "bitmap_%x", (bit + i * 8));
+ if ((seb >> bit) & 0x1)
+ snprintf(evt_str, sizeof(evt_str), "Support %s",
+ nvme_pel_event_to_string(bit + i * 8));
+ json_object_add_value_string(root, key, evt_str);
}
}
}
for (int i = 0; i < 32; i++) {
if (pevent_log_head->seb[i] == 0)
continue;
- add_bitmap(i, pevent_log_head->seb[i], root, 1);
+ json_add_bitmap(i, pevent_log_head->seb[i], root);
}
} else {
printf("No log data can be shown with this log len at least " \
struct nvme_aggregate_predictable_lat_event *endurance_log,
__u64 log_entries);
void json_lba_status_log(void *lba_status);
-void add_bitmap(int i, __u8 seb, struct json_object *root, int json_flag);
void json_persistent_event_log(void *pevent_log_info, __u32 size);
void json_predictable_latency_event_agg_log(
struct nvme_aggregate_predictable_lat_event *pea_log,
#define json_resv_notif_log(resv)
#define json_endurance_group_event_agg_log(endurance_log, log_entries)
#define json_lba_status_log(lba_status)
-#define add_bitmap(i, seb, root, json_flag)
#define json_persistent_event_log(pevent_log_info, size)
#define json_predictable_latency_event_agg_log(pea_log, log_entries)
#define json_predictable_latency_per_nvmset(plpns_log, nvmset_id)
"Event not associated with any port and PELPID does not apply");
}
+static void add_bitmap(int i, __u8 seb)
+{
+ for (int bit = 0; bit < 8; bit++) {
+ if (nvme_pel_event_to_string(bit + i * 8)) {
+ if (nvme_pel_event_to_string(bit + i * 8))
+ if ((seb >> bit) & 0x1)
+ printf(" Support %s\n",
+ nvme_pel_event_to_string(bit + i * 8));
+ }
+ }
+}
+
void nvme_show_persistent_event_log(void *pevent_log_info,
__u8 action, __u32 size, const char *devname,
enum nvme_print_flags flags)
for (int i = 0; i < 32; i++) {
if (pevent_log_head->seb[i] == 0)
continue;
- add_bitmap(i, pevent_log_head->seb[i], NULL, 0);
+ add_bitmap(i, pevent_log_head->seb[i]);
}
} else {
printf("No log data can be shown with this log len at least " \