From 9f6486bd321973c5b8d4ba570c25d90db0d347ad Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 21 Sep 2005 13:59:23 +0200 Subject: [PATCH] [PATCH] Fix output naming, really It's still confusing since the manual name wont include _out like the automatically generated one will. So now a trace of /dev/sda will generate sda.blktrace.cpu and blkparse -i sda will catch those files. Similarly, a blktrace -o sda will generate the same filename. --- blkparse.c | 2 +- blktrace.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/blkparse.c b/blkparse.c index 482afa5..7a23747 100644 --- a/blkparse.c +++ b/blkparse.c @@ -1494,7 +1494,7 @@ static int do_file(void) pci->cpu = j; snprintf(pci->fname, sizeof(pci->fname)-1, - "%s.%d", pdi->name, j); + "%s.blktrace.%d", pdi->name, j); if (stat(pci->fname, &st) < 0) break; if (!st.st_size) diff --git a/blktrace.c b/blktrace.c index 37e088c..3869163 100644 --- a/blktrace.c +++ b/blktrace.c @@ -406,11 +406,13 @@ static int start_threads(struct device_information *dip) tip->ofd = dup(STDOUT_FILENO); tip->fd_lock = &stdout_mutex; } else { - if (output_name) - sprintf(op, "%s.%d", output_name, tip->cpu); - else - sprintf(op, "%s_out.%d", + if (output_name) { + sprintf(op, "%s.blktrace.%d", output_name, + tip->cpu); + } else { + sprintf(op, "%s.blktrace.%d", dip->buts_name, tip->cpu); + } tip->ofd = open(op, O_CREAT|O_TRUNC|O_WRONLY, 0644); } -- 2.25.1