Page MenuHomeFreeBSD

D55019.id.diff
No OneTemporary

D55019.id.diff

diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8
--- a/sbin/nvmecontrol/nvmecontrol.8
+++ b/sbin/nvmecontrol/nvmecontrol.8
@@ -33,7 +33,7 @@
.\"
.\" Author: Jim Harris <jimharris@FreeBSD.org>
.\"
-.Dd July 9, 2025
+.Dd January 31, 2026
.Dt NVMECONTROL 8
.Os
.Sh NAME
@@ -256,6 +256,7 @@
.Ic telemetry-log
.Fl O Ar output-file
.Op Fl d Ar data-area
+.Op Fl v
.Aq Ar device-id
.Sh DESCRIPTION
NVM Express (NVMe) is a storage protocol standard for SSDs and other
@@ -875,6 +876,9 @@
This parameter is mandatory.
.It Fl d Ar data-area
The data area is either 1, 2 or 3.
+.It Fl v
+Verbose output reporing progress.
+This log can be quite large and take minutes to retrieve.
.El
.Sh DEVICE NAMES
Where
diff --git a/sbin/nvmecontrol/telemetry.c b/sbin/nvmecontrol/telemetry.c
--- a/sbin/nvmecontrol/telemetry.c
+++ b/sbin/nvmecontrol/telemetry.c
@@ -51,6 +51,7 @@
const char *outfn;
const char *dev;
uint8_t da;
+ bool verbose;
} opt = {
.outfn = NULL,
.dev = NULL,
@@ -63,6 +64,8 @@
"output file for telemetry data"),
OPT("data-area", 'd', arg_uint8, opt, da,
"output file for telemetry data"),
+ OPT("verbose", 'v', arg_none, opt, verbose,
+ "Be verbose about process"),
{ NULL, 0, arg_none, NULL, NULL }
};
#undef OPT
@@ -96,7 +99,7 @@
int fd, fdout;
char *path;
uint32_t nsid;
- ssize_t size;
+ ssize_t size, blocks;
uint64_t off;
ssize_t chunk;
struct nvme_controller_data cdata;
@@ -151,13 +154,23 @@
default:
errx(EX_USAGE, "Impossible data area %d", opt.da);
}
- size = (size + 1) * 512; /* The count of additional pages */
+ blocks = size + 1;
+ size = blocks * 512; /* The count of additional pages */
chunk = 4096;
- printf("Extracting %llu bytes\n", (unsigned long long)size);
+ if (opt.verbose)
+ printf("Extracting %llu bytes %llu blocks\n", (unsigned long long)size,
+ (unsigned long long)size / 512);
+ else
+ printf("Extracting %llu bytes\n", (unsigned long long)size);
do {
if (chunk > size)
chunk = size;
+ if (opt.verbose && off % 10240 == 0) {
+ printf("%s: %llu / %llu\r", opt.dev, (unsigned long long)off / 512,
+ (unsigned long long)blocks);
+ fflush(stdout);
+ }
read_logpage(fd, NVME_LOG_TELEMETRY_HOST_INITIATED, nsid, 0, 0, true,
off, 0, 0, 0, &buf, chunk);
if (write(fdout, &buf, chunk) != chunk)
@@ -165,6 +178,11 @@
off += chunk;
size -= chunk;
} while (size > 0);
+ if (opt.verbose) {
+ printf("%s: %llu / %llu\n", opt.dev, (unsigned long long)off / 512,
+ (unsigned long long)blocks);
+ fflush(stdout);
+ }
close(fdout);
close(fd);

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 19, 10:00 AM (12 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31714051
Default Alt Text
D55019.id.diff (2 KB)

Event Timeline