From: Michael Davis Date: Thu, 20 Jul 2017 02:32:21 +0000 (-0700) Subject: Fixed get_internal_log to parse the entire nlog and allow selection of specific regio... X-Git-Tag: v1.4~15^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=74c3f746ecfd1bb8e87d2fbd27c8cea90bd96492;p=users%2Fsagi%2Fnvme-cli.git Fixed get_internal_log to parse the entire nlog and allow selection of specific regions to be parsed. --- diff --git a/intel-nvme.c b/intel-nvme.c index 8d777ffe..ca4d2449 100644 --- a/intel-nvme.c +++ b/intel-nvme.c @@ -664,7 +664,9 @@ static int get_internal_log(int argc, char **argv, struct command *command, stru struct config cfg = { .namespace_id = -1, - .file = NULL + .file = NULL, + .lnum = -1, + .core = -1 }; struct intel_cd_log cdlog; @@ -705,7 +707,6 @@ static int get_internal_log(int argc, char **argv, struct command *command, stru memcpy(&intel, buf, sizeof(intel)); cmd.addr = (unsigned long)(void *)buf; - core_num = 1; /* for 1.1 Fultondales will use old nlog, but current assert/event */ if ((intel.ver.major < 1 && intel.ver.minor < 1) || @@ -745,7 +746,7 @@ static int get_internal_log(int argc, char **argv, struct command *command, stru goto out; } - for (j = 0; j < core_num; j++) { + for (j = (cfg.core < 0 ? 0 : cfg.core); j < (cfg.core < 0 ? core_num : cfg.core + 1); j++) { cdlog.u.fields.selectCore = j; for (i = 0; i < count; i++) { if (cfg.log == 0 && ad[i].assertvalid) {