* [PATCH 24/31] verify_blkparse: inform on bad line, report line no
@ 2018-04-27 13:07 Steffen Maier
0 siblings, 0 replies; only message in thread
From: Steffen Maier @ 2018-04-27 13:07 UTC (permalink / raw)
To: linux-btrace
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
---
verify_blkparse.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/verify_blkparse.c b/verify_blkparse.c
index 3f3e92a563c9..97dbc2970dee 100644
--- a/verify_blkparse.c
+++ b/verify_blkparse.c
@@ -48,12 +48,18 @@ int main(int argc, char *argv[])
alias = nr = 0;
total_entries = 0;
while ((p = fgets(line, sizeof(line), f)) != NULL) {
- if (sscanf(p, "%3d,%3d %5d %8d %lf", &major, &minor, &cpu, &seq, &this_time) != 5)
+ if (sscanf(p, "%3d,%3d %5d %8d %lf",
+ &major, &minor, &cpu, &seq, &this_time) != 5) {
+ fprintf(stdout, "unrecognized line, aborting\n");
+ fprintf(stdout, "this (line no %llu): %s",
+ total_entries + 1, p);
break;
+ }
if (this_time < last_time) {
fprintf(stdout, "last: %s", last_line);
- fprintf(stdout, "this: %s", p);
+ fprintf(stdout, "this (line no %llu): %s",
+ total_entries + 1, p);
nr++;
}
@@ -66,6 +72,8 @@ int main(int argc, char *argv[])
if (last_seq[cpu] = seq) {
fprintf(stdout, "alias on sequence %u\n", seq);
+ fprintf(stdout, "this (line no %llu): %s",
+ total_entries + 1, p);
alias++;
}
--
2.14.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-04-27 13:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27 13:07 [PATCH 24/31] verify_blkparse: inform on bad line, report line no Steffen Maier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.