(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:duration) op: assign_op.Equal rhs: {<0>} spids: [133] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:buckets) op: assign_op.Equal rhs: {(sh_array_literal left:<Id.Op_LParen _> words:[{<1>} {<8>} {<64>} {<128>}])} spids: [136] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:secsz) op: assign_op.Equal rhs: {<512>} spids: [147] ) ] ) (C {<trap>} {(SQ <':'>)} {<INT>} {<QUIT>} {<TERM>} {<PIPE>} {<HUP>}) (command.ShFunction name: usage body: (BraceGroup children: [ (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<END>} here_end_span_id: 194 stdin_parts: [ <'USAGE: bitesize [-h] [-b buckets] [seconds]\n'> <' -b buckets # specify histogram buckets (Kbytes)\n'> <' -h # this usage message\n'> <' eg,\n'> <' bitesize # trace I/O size until Ctrl-C\n'> <' bitesize 10 # trace I/O size for 10 seconds\n'> <' bitesize -b '> <Id.Right_DoubleQuote '"'> <'8 16 32'> <Id.Right_DoubleQuote '"'> <' # specify custom bucket points\n'> ] ) ) (redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>}) ] do_fork: T ) (command.ControlFlow token:<Id.ControlFlow_Exit exit>) ] ) ) (command.ShFunction name: die body: (BraceGroup children: [ (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_At '$@'))}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands:[(C {<getopts>} {<b> <Id.Lit_Colon ':'> <h>} {<opt>})]) body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_DollarName '$opt')} arms: [ (case_arm pat_list: [{<b>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:buckets) op: assign_op.Equal rhs: { (sh_array_literal left: <Id.Op_LParen _> words: [{($ Id.VSub_DollarName '$OPTARG')}] ) } spids: [251] ) ] ) ] spids: [248 249 256 -1] ) (case_arm pat_list: [{<h>} {<Id.Lit_QMark '?'>}] action: [(C {<usage>})] spids: [259 262 266 -1] ) ] ) ] ) ) (C {<shift>} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$OPTIND')} right: {<Id.Lit_Digits 1>} ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoint) op: assign_op.Equal rhs: {<block> <Id.Lit_Colon ':'> <block_rq_issue>} spids: [286] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:var) op: assign_op.Equal rhs: {<nr_sector>} spids: [291] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:duration) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [294] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:i) op:assign_op.Equal rhs:{<0>} spids:[301])] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sectors) op: assign_op.Equal rhs: { (sh_array_literal left: <Id.Op_LParen _> words: [ { (braced_var_sub token: <Id.VSub_Name buckets> bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ] ) } spids: [304] ) ] ) (command.DParen child: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: <Id.Lit_ArithVarLike max_i> right: (arith_expr.Binary op_id: Id.Arith_Minus left: { (braced_var_sub token: <Id.VSub_Name buckets> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } right: {<Id.Lit_Digits 1>} ) ) ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_LessEqual left: <Id.Lit_ArithVarLike i> right: <Id.Lit_ArithVarLike max_i> ) ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.DParen child: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (arith_expr.Binary op_id: Id.Arith_LBracket left: <Id.Lit_ArithVarLike sectors> right: {($ Id.VSub_DollarName '$i')} ) right: (arith_expr.Binary op_id: Id.Arith_Slash left: (arith_expr.Binary op_id: Id.Arith_Star left: { (braced_var_sub token: <Id.VSub_Name sectors> bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$i')}) ) } right: {<Id.Lit_Digits 1024>} ) right: {($ Id.VSub_DollarName '$secsz')} ) ) ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: <Id.Lit_ArithVarLike i> right: {<Id.Lit_Digits 0>} ) ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_LessEqual left: { (braced_var_sub token: <Id.VSub_Name sectors> bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName '$i')} ) ) } right: { (braced_var_sub token: <Id.VSub_Name sectors> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$i')} right: {<Id.Lit_Digits 1>} ) ) ) } ) ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<die>} {(DQ <'ERROR: bucket list must increase in size.'>)})] spids: [398 426] ) ] ) ] spids: [382 395] ) ] ) (command.DParen child: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:<Id.Lit_ArithVarLike i>) ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:max_b) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name buckets> bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$max_i')}) ) } spids: [456] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:max_s) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name sectors> bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$max_i')}) ) } spids: [464] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoints) op: assign_op.Equal rhs: { (DQ <'-e '> ($ Id.VSub_DollarName '$tpoint') <' --filter '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$var') <' < '> (braced_var_sub token: <Id.VSub_Name sectors> bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>}) ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ) } spids: [472] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:awkarray) op: assign_op.Equal rhs: (word.Empty) spids: [489] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:i) op:assign_op.Equal rhs:{<0>} spids:[491])] ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Less left: <Id.Lit_ArithVarLike i> right: <Id.Lit_ArithVarLike max_i> ) ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoints) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$tpoints') <' -e '> ($ Id.VSub_DollarName '$tpoint') <' --filter '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$var') <' >= '> (braced_var_sub token: <Id.VSub_Name sectors> bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$i')}) ) <' && '> ) } spids: [511] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoints) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$tpoints') <' '> ($ Id.VSub_DollarName '$var') <' < '> (braced_var_sub token: <Id.VSub_Name sectors> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Plus left: {($ Id.VSub_DollarName '$i')} right: {<Id.Lit_Digits 1>} ) ) ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ) } spids: [530] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:awkarray) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$awkarray') <' buckets['> ($ Id.VSub_DollarName '$i') <']='> (braced_var_sub token: <Id.VSub_Name buckets> bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$i')}) ) <';'> ) } spids: [550] ) ] ) (command.DParen child: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:<Id.Lit_ArithVarLike i>) ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:awkarray) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$awkarray') <' buckets['> ($ Id.VSub_DollarName '$max_i') <']='> (braced_var_sub token: <Id.VSub_Name buckets> bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$max_i')}) ) <';'> ) } spids: [576] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoints) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$tpoints') <' -e '> ($ Id.VSub_DollarName '$tpoint') <' --filter '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ($ Id.VSub_DollarName '$var') <' >= '> (braced_var_sub token: <Id.VSub_Name sectors> bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$max_i')}) ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) ) } spids: [591] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child:<Id.Lit_ArithVarLike duration>) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:etext) op: assign_op.Equal rhs: {(DQ <'for '> ($ Id.VSub_DollarName '$duration') <' seconds'>)} spids: [626] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:cmd) op: assign_op.Equal rhs: {(DQ <'sleep '> ($ Id.VSub_DollarName '$duration'))} spids: [634] ) ] ) ] spids: [613 623] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:etext) op: assign_op.Equal rhs: {(DQ <'until Ctrl-C'>)} spids: [643] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:cmd) op: assign_op.Equal rhs: {(DQ <'sleep 999999'>)} spids: [649] ) ] ) ] ) (C {<echo>} {(DQ <'Tracing block I/O size (bytes), '> ($ Id.VSub_DollarName '$etext') <...>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:out) op: assign_op.Equal rhs: {(DQ <'-o /dev/stdout'>)} spids: [668] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:stat) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Simple words: [ {<eval>} {<perf>} {<stat>} {($ Id.VSub_DollarName '$tpoints')} {<-a>} {($ Id.VSub_DollarName '$out')} {($ Id.VSub_DollarName '$cmd')} ] redirects: [(redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>})] do_fork: T ) ) } spids: [676] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_NEqual left: {($ Id.VSub_QMark '$?')} right: {<Id.Lit_Digits 0>} ) ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [{<echo>} {(DQ <'ERROR running perf:'>)}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_DollarName '$stat'))}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (command.ControlFlow token:<Id.ControlFlow_Exit exit>) ] spids: [696 710] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:most) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$stat'))}) (C {<awk>} {<-v>} {<Id.Lit_VarLike 'tpoint='> ($ Id.VSub_DollarName '$tpoint')} { (SQ <'\n'> <'\t$2 == tpoint { gsub(/,/, ""); if ($1 > m) { m = $1 } }\n'> <'\tEND { print m }'> ) } ) ] negated: F ) ) } spids: [741] ) ] ) (C {<echo>}) (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$stat'))}) (C {<awk>} {<-v>} {<Id.Lit_VarLike 'tpoint='> ($ Id.VSub_DollarName '$tpoint')} {<-v>} {<Id.Lit_VarLike 'max_i='> ($ Id.VSub_DollarName '$max_i')} {<-v>} {<Id.Lit_VarLike 'most='> ($ Id.VSub_DollarName '$most')} { (SQ <'\n'> <'\tfunction star(sval, smax, swidth) {\n'> <'\t\tstars = ""\n'> <'\t\t# using int could avoid error on gawk\n'> <'\t\tif (int(smax) == 0) return ""\n'> <'\t\tfor (si = 0; si < (swidth * sval / smax); si++) {\n'> <'\t\t\tstars = stars "#"\n'> <'\t\t}\n'> <'\t\treturn stars\n'> <'\t}\n'> <'\tBEGIN {\n'> <'\t\t'> ) (DQ ($ Id.VSub_DollarName '$awkarray')) (SQ <'\n'> <'\t\tprintf(" %-15s: %-8s %s\\n", "Kbytes", "I/O",\n'> <'\t\t "Distribution")\n'> <'\t}\n'> <'\t/Performance counter stats/ { i = -1 }\n'> <'\t# reverse order of rule set is important\n'> <'\t{ ok = 0 }\n'> <'\t$2 == tpoint { num = $1; gsub(/,/, "", num); ok = 1 }\n'> <'\tok && i >= max_i {\n'> <'\t\tprintf(" %10.1f -> %-10s: %-8s |%-38s|\\n",\n'> <'\t\t buckets[i], "", num, star(num, most, 38))\n'> <'\t\tnext\n'> <'\t}\n'> <'\tok && i >= 0 && i < max_i {\n'> <'\t\tprintf(" %10.1f -> %-10.1f: %-8s |%-38s|\\n",\n'> <'\t\t buckets[i], buckets[i+1] - 0.1, num,\n'> <'\t\t star(num, most, 38))\n'> <'\t\ti++\n'> <'\t\tnext\n'> <'\t}\n'> <'\tok && i == -1 {\n'> <'\t\tprintf(" %10s -> %-10.1f: %-8s |%-38s|\\n", "",\n'> <'\t\t buckets[0] - 0.1, num, star(num, most, 38))\n'> <'\t\ti++\n'> <'\t}\n'> ) } ) ] negated: F ) ] )