From 234db09d1aa776f92738bb8d20771d945039b348 Mon Sep 17 00:00:00 2001 From: "Alan D. Brunelle" Date: Mon, 13 Nov 2006 14:49:48 +0100 Subject: [PATCH] [PATCH] blkparse Added --no-text-output (-O) Removes textual output, useful for bin only. Signed-off-by: Jens Axboe --- blkparse.c | 167 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 67 deletions(-) diff --git a/blkparse.c b/blkparse.c index a73d3dd..607d17e 100644 --- a/blkparse.c +++ b/blkparse.c @@ -104,7 +104,7 @@ static struct per_process_info *ppi_hash_table[PPI_HASH_SIZE]; static struct per_process_info *ppi_list; static int ppi_list_entries; -#define S_OPTS "a:A:i:o:b:stqw:f:F:vVhD:d:" +#define S_OPTS "a:A:b:D:d:f:F:hi:o:Oqstw:vV" static struct option l_opts[] = { { .name = "act-mask", @@ -119,88 +119,94 @@ static struct option l_opts[] = { .val = 'A' }, { - .name = "input", + .name = "batch", .has_arg = required_argument, .flag = NULL, - .val = 'i' + .val = 'b' }, { - .name = "output", + .name = "input-directory", .has_arg = required_argument, .flag = NULL, - .val = 'o' + .val = 'D' }, { - .name = "batch", + .name = "dump-binary", .has_arg = required_argument, .flag = NULL, - .val = 'b' + .val = 'd' }, { - .name = "per-program-stats", - .has_arg = no_argument, + .name = "format", + .has_arg = required_argument, .flag = NULL, - .val = 's' + .val = 'f' }, { - .name = "track-ios", - .has_arg = no_argument, + .name = "format-spec", + .has_arg = required_argument, .flag = NULL, - .val = 't' + .val = 'F' }, { - .name = "quiet", + .name = "hash-by-name", .has_arg = no_argument, .flag = NULL, - .val = 'q' + .val = 'h' }, { - .name = "stopwatch", + .name = "input", .has_arg = required_argument, .flag = NULL, - .val = 'w' + .val = 'i' }, { - .name = "format", + .name = "output", .has_arg = required_argument, .flag = NULL, - .val = 'f' + .val = 'o' }, { - .name = "format-spec", - .has_arg = required_argument, + .name = "no-text-output", + .has_arg = no_argument, .flag = NULL, - .val = 'F' + .val = 'O' }, { - .name = "hash-by-name", + .name = "quiet", .has_arg = no_argument, .flag = NULL, - .val = 'h' + .val = 'q' }, { - .name = "verbose", + .name = "per-program-stats", .has_arg = no_argument, .flag = NULL, - .val = 'v' + .val = 's' }, { - .name = "version", + .name = "track-ios", .has_arg = no_argument, .flag = NULL, - .val = 'V' + .val = 't' }, { - .name = "input-directory", + .name = "stopwatch", .has_arg = required_argument, .flag = NULL, - .val = 'D' + .val = 'w' }, { - .name = "dump-binary", - .has_arg = required_argument, + .name = "verbose", + .has_arg = no_argument, .flag = NULL, - .val = 'd' + .val = 'v' + }, + { + .name = "version", + .has_arg = no_argument, + .flag = NULL, + .val = 'V' }, { .name = NULL, @@ -277,6 +283,8 @@ static unsigned int rb_batch = RB_BATCH_DEFAULT; static int pipeline; +static int text_output = 1; + #define is_done() (*(volatile int *)(&done)) static volatile int done; @@ -1415,10 +1423,12 @@ static void dump_trace_fs(struct blk_io_trace *t, struct per_dev_info *pdi, static void dump_trace(struct blk_io_trace *t, struct per_cpu_info *pci, struct per_dev_info *pdi) { - if (t->action & BLK_TC_ACT(BLK_TC_PC)) - dump_trace_pc(t, pci); - else - dump_trace_fs(t, pdi, pci); + if (text_output) { + if (t->action & BLK_TC_ACT(BLK_TC_PC)) + dump_trace_pc(t, pci); + else + dump_trace_fs(t, pdi, pci); + } if (!pdi->events) pdi->first_reported_time = t->time; @@ -2194,24 +2204,41 @@ static int find_stopwatch_interval(char *string) return 0; } -static char usage_str[] = \ - "[ -i ] [-o [ -s ] [ -t ] [ -q ]\n" \ - "[ -w start:stop ] [ -f output format ] [ -F format spec ] [ -v] \n\n" \ - "\t-i Input file containing trace data, or '-' for stdin\n" \ +#define S_OPTS "a:A:b:D:d:f:F:hi:o:Oqstw:vV" +static char usage_str[] = "\n\n" \ + "-i | --input=\n" \ + "[ -a | --act-mask= ]\n" \ + "[ -A | --set-mask= ]\n" \ + "[ -b | --batch= ]\n" \ + "[ -d | --dump-binary= ]\n" \ + "[ -D | --input-directory= ]\n" \ + "[ -f | --format= ]\n" \ + "[ -F | --format-spec= ]\n" \ + "[ -h | --hash-by-name ]\n" \ + "[ -o | --output= ]\n" \ + "[ -O | --no-text-output ]\n" \ + "[ -q | --quiet ]\n" \ + "[ -s | --per-program-stats ]\n" \ + "[ -t | --track-ios ]\n" \ + "[ -w