Skip to content

Commit 91a530c

Browse files
HaroPanosyanigaw
authored andcommitted
plugin/solidigm fixing identify logs generation
Identify logs were not setting transfer data size for the buffer. Also PEL log was not incrementing the counter. Signed-off-by: Haro Panosyan <[email protected]>
1 parent 74b30d2 commit 91a530c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

plugins/solidigm/solidigm-internal-logs.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ static int ilog_dump_identify_page(struct nvme_transport_handle *hdl,
498498
_cleanup_free_ char *filename = NULL;
499499
int err;
500500

501-
err = nvme_identify(hdl, nsid, NVME_CSI_NVM, cns->id, buff, 0);
501+
err = nvme_identify(hdl, nsid, NVME_CSI_NVM, cns->id, buff,
502+
sizeof(data));
502503
if (err)
503504
return err;
504505

@@ -524,7 +525,7 @@ static int ilog_ensure_dump_id_ctrl(struct nvme_transport_handle *hdl,
524525
first = false;
525526
err = ilog_dump_identify_page(hdl, ilog, &idctrl, 0);
526527

527-
if (!err)
528+
if (err == 0)
528529
ilog->count++;
529530

530531
return err;
@@ -815,6 +816,8 @@ static int ilog_dump_pel(struct nvme_transport_handle *hdl, struct ilog *ilog)
815816
if (err)
816817
return err;
817818

819+
ilog->count++;
820+
818821
err = log_save(&lp, ilog->cfg->out_dir, "log_pages", "lid_0x0d_lsp_0x00_lsi_0x0000.bin",
819822
pevent_log_full, lp.buffer_size);
820823

@@ -997,7 +1000,7 @@ int solidigm_get_internal_log(int argc, char **argv, struct command *acmd,
9971000
if (err > 0)
9981001
nvme_show_status(err);
9991002

1000-
} else if ((ilog.count > 1) || cfg.verbose)
1003+
} else if ((ilog.count > 0) || cfg.verbose)
10011004
printf("Total: %d log files in %s/%s\n", ilog.count, initial_folder, output_path);
10021005

10031006
return err;

0 commit comments

Comments
 (0)