From 6119854cc2acfdd1a545fa028f86e3e4b6c040dc Mon Sep 17 00:00:00 2001 From: Alan David Brunelle Date: Thu, 21 Sep 2006 09:15:41 +0200 Subject: [PATCH] [PATCH] Added '-' and '_' in dev IDs in devmap file; output dev name, not numbers Signed-off-by: Alan D. Brunelle Signed-off-by: Jens Axboe --- btt/devmap.c | 2 +- btt/output.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/btt/devmap.c b/btt/devmap.c index 5de57e8..2227617 100644 --- a/btt/devmap.c +++ b/btt/devmap.c @@ -55,7 +55,7 @@ int dev_map_read(char *fname) return 1; } - while (fscanf(fp, "%255[a-zA-Z0-9 :.,/]\n", line) == 1) { + while (fscanf(fp, "%255[a-zA-Z0-9 :.,/_-]\n", line) == 1) { if (strstr(line, "Device") != NULL) continue; if (sscanf(line, "%s %s %u %u %u %u %s %s %u %u %s", &dm.device[0], &dm.model[0], &dm.host, &dm.bus, diff --git a/btt/output.c b/btt/output.c index 969ccae..86dbc58 100644 --- a/btt/output.c +++ b/btt/output.c @@ -90,14 +90,11 @@ void __output_avg2(FILE *ofp, char *hdr, struct avgs_info *ap) char *make_dev_hdr(char *pad, size_t len, struct d_info *dip) { - if (dip->map == NULL) { + if (dip->map == NULL) snprintf(pad, len, "(%3d,%3d)", MAJOR(dip->device), MINOR(dip->device)); - } - else { - snprintf(pad, len, "[%3d,%3d]", - dip->map->host, dip->map->target); - } + else + snprintf(pad, len, "%s", dip->map->device); return pad; } -- 2.25.1