Skip to content

Commit

Permalink
Complain about kernel version if format of file is not understood.
Browse files Browse the repository at this point in the history
  • Loading branch information
stolk committed May 12, 2021
1 parent 424a2b9 commit 9726cf8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion diskgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,17 @@ void get_stats( char* fname )
"%u %u %u %u %u %u %u %u %u %u %u %u %u %u %u",
v+0,v+1,v+2,v+3,v+4,v+5,v+6,v+7,v+8,v+9,v+10,v+11,v+12,v+13,v+14
);
assert( numv == 15 );
if ( numv != 15 )
{
fprintf
(
stderr,
"Did not find all the fields in %s that were expected.\n"
"Most likely, your kernel is too old to work with diskgraph.\n",
fname
);
exit(3);
}

uint32_t rd = v[2]; // number of sectors read.
uint32_t wr = v[6]; // number of sectors written.
Expand Down

0 comments on commit 9726cf8

Please sign in to comment.