File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
agent/bench-scripts/postprocess Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -9,22 +9,23 @@ my $tool_group = $ARGV[2];
99my $js_str ;
1010
1111open ( JS, " <$dir /fio-result.txt" ) or die " Can't open $dir /fio-result.txt: $! " ;
12- # skip past the non json stuff
12+ # there may be more than one json array, and we want only the last one
1313while ( <JS> ) {
14+ # skip past the non json stuff
1415 if ( / {/ ) {
15- last ;
16+ $js_str = " {\n " ;
17+ while ( <JS> ) {
18+ $js_str = $js_str . $_ ;
19+ if ( / ^}/ ) {
20+ last ;
21+ }
22+ }
1623 }
1724}
1825
19- if ( eof JS ) {
20- print " Could not read rest of json data\n " ;
21- exit 1;
22- } else {
23- # read the rest of the file in to one string
24- local $/ =undef ;
25- binmode JS;
26- $js_str = <JS>;
27- $js_str = " {\n " . $js_str ;
26+ if ( ! defined $js_str ) {
27+ print " Could not find any json data, exiting\n " ;
28+ exit 1
2829}
2930
3031# convert [json] string in to big hash
You can’t perform that action at this time.
0 commit comments