(command.CommandList children: [ (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_buckets) op: assign_op.Equal rhs: {(0)} spids: [124] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:126) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:buckets) op: assign_op.Equal rhs: (word.Empty) spids: [128] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:129) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_power) op: assign_op.Equal rhs: {(0)} spids: [131] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:133) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:power) op: assign_op.Equal rhs: {(4)} spids: [135] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:137) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_max) op: assign_op.Equal rhs: {(0)} spids: [139] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:141) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:max) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w:{(Id.Lit_Digits 1024)}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1024)}) ) ) } spids: [143] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_filter) op: assign_op.Equal rhs: {(0)} spids: [153] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:155) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filter) op: assign_op.Equal rhs: (word.Empty) spids: [157] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:158) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:duration) op: assign_op.Equal rhs: {(0)} spids: [160] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:162) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:debug) op: assign_op.Equal rhs: {(0)} spids: [164] ) ] ) ] ) (C {(trap)} {(SQ (Token id:Id.Lit_Chars val:':' span_id:170))} {(INT)} {(QUIT)} {(TERM)} {(PIPE)} {(HUP)} ) (command.ShFunction name: usage body: (command.BraceGroup children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:193) fd: -1 here_begin: {(END)} here_end_span_id: 232 stdin_parts: [ ('USAGE: perf-stat-hist [-h] [-b buckets|-P power] [-m max] [-f filter]\n') (' tracepoint variable [seconds]\n') (' -b buckets # specify histogram bucket points\n') (' -P power # power-of (default is 4)\n') (' -m max # max value for power-of\n') (' -f filter # specify a filter \n') (' -h # this usage message\n') (' eg,\n') (' perf-stat-hist syscalls:sys_enter_read count 5\n') (' # read() request histogram, 5 seconds\n') (' perf-stat-hist syscalls:sys_exit_read ret 5\n') (' # read() return histogram, 5 seconds\n') (' perf-stat-hist -P 10 syscalls:sys_exit_read ret 5\n') (' # ... use power-of-10\n') (' perf-stat-hist -P 2 -m 1024 syscalls:sys_exit_read ret 5\n') (' # ... use power-of-2, max 1024\n') (' perf-stat-hist -b ') (Id.Right_DoubleQuote '"') ('10 50 100 500') (Id.Right_DoubleQuote '"') (' syscalls:sys_exit_read ret 5\n') (' # ... histogram based on these bucket ranges\n') (' perf-stat-hist -b 10 syscalls:sys_exit_read ret 5\n') (' # ... bifurcate by the value 10 (lowest overhead)\n') (" perf-stat-hist -f 'rwbs == ") (Id.Right_DoubleQuote '"') (WS) (Id.Right_DoubleQuote '"') ("' block:block_rq_complete nr_sector 5\n") (' # ... synchronous writes histogram, 5 seconds\n') ('\n') ('See the man page and example file for more info.\n') ] ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:196) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:234) ) ] ) ) (command.ShFunction name: die body: (command.BraceGroup children: [ (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_At '$@'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:248) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:256) arg_word: {(1)} ) ] ) ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:266) cond: [ (C {(getopts)} {(b) (Id.Lit_Other ':') (hm) (Id.Lit_Other ':') (P) (Id.Lit_Other ':') (f) (Id.Lit_Other ':')} {(opt)} ) ] body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_DollarName '$opt')} arms: [ (case_arm pat_list: [{(b)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_buckets) op: assign_op.Equal rhs: {(1)} spids: [294] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:296) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:buckets) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:299) words: [{($ Id.VSub_DollarName '$OPTARG')}] ) } spids: [298] ) ] ) ] spids: [291 292 303 -1] ) (case_arm pat_list: [{(P)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_power) op: assign_op.Equal rhs: {(1)} spids: [309] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:311) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:power) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$OPTARG')} spids: [313] ) ] ) ] spids: [306 307 316 -1] ) (case_arm pat_list: [{(m)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_max) op: assign_op.Equal rhs: {(1)} spids: [322] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:324) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:max) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$OPTARG')} spids: [326] ) ] ) ] spids: [319 320 329 -1] ) (case_arm pat_list: [{(f)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_filter) op: assign_op.Equal rhs: {(1)} spids: [335] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:337) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filter) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$OPTARG') (' && '))} spids: [339] ) ] ) ] spids: [332 333 345 -1] ) (case_arm pat_list: [{(h)} {(Id.Lit_QMark '?')}] action: [(C {(usage)})] spids: [348 351 355 -1] ) ] ) ] ) ) (C {(shift)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$OPTIND')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.ArithWord w:{($ Id.VSub_Pound '$#')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)}) ) ) (C {(usage)}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tpoint) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [390] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:var) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [396] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:duration) op: assign_op.Equal rhs: {(${ Id.VSub_Number 3)} spids: [402] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_buckets span_id:413) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_power span_id:417) ) ) ) (C {(die)} {(DQ ('ERROR: use either -b or -P'))}) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:opt_power span_id:432)) right: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:power span_id:436)) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)}) ) ) ) (C {(die)} {(DQ ('ERROR: -P power must be 2 or higher'))}) ] ) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (command.Simple words: [ {(grep)} { (DQ ('^') ($ Id.VSub_DollarName '$tpoint') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:466) ) ) } {(/sys/kernel/debug/tracing/available_events)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:471) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('ERROR: tracepoint ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:485) ) ($ Id.VSub_DollarName '$tpoint') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:487) ) (' not found. Exiting...') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:480) fd: -1 arg_word: {(2)} ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.VSub_DollarName '$USER'))} right: {(DQ (root))} ) ) (command.Simple words: [{(echo)} {(DQ ('Not root user?'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:510) fd: -1 arg_word: {(2)} ) ] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:518) arg_word: {(1)} ) ] spids: [457 475] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Unary op_id: Id.Arith_Bang child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_buckets span_id:533) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:537) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:b) op: assign_op.Equal rhs: {(0)} spids: [542] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:s) op: assign_op.Equal rhs: {(1)} spids: [546] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:550) cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_LessEqual left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:s span_id:554) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:max span_id:558) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:562) ) ] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:b) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$b') (' ') ($ Id.VSub_DollarName '$s'))} spids: [567] ) ] ) (command.DParen child: (arith_expr.BinaryAssign op_id: Id.Arith_StarEqual left: (sh_lhs_expr.Name name:s) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:power span_id:581) ) ) ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:buckets) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:591) words: [{($ Id.VSub_DollarName '$b')}] ) } spids: [590] ) ] ) ] spids: [528 539] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:max) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:603) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:607) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) } spids: [601] ) ] ) (command.DParen child: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:max_i) right: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:629) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) (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: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:646) ) ($ Id.VSub_DollarName '$filter') (' ') ($ Id.VSub_DollarName '$var') (' < ') (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:652) bracket_op: (bracket_op.ArrayIndex expr:(arith_expr.ArithWord w:{(Id.Lit_Digits 0)})) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:657)) ) } spids: [641] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:awkarray) op: assign_op.Equal rhs: (word.Empty) spids: [660] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:i) op:assign_op.Equal rhs:{(0)} spids:[662])] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:665) cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:669)) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:max_i span_id:673) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:677) ) ] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:i span_id:686) ) right: (arith_expr.Binary op_id: Id.Arith_LessEqual left: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:691) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) ) ) } ) right: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:700) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) } ) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:712) ) ] action: [(C {(die)} {(DQ ('ERROR: bucket list must increase in size.'))})] spids: [682 714] ) ] ) (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:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:733)) ($ Id.VSub_DollarName '$filter') (' ') ($ Id.VSub_DollarName '$var') (' >= ') (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:739) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) ) (' && ') ) } spids: [727] ) ] ) (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: (Token id:Id.VSub_Name val:buckets span_id:755) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:764)) ) } spids: [748] ) ] ) (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: (Token id:Id.VSub_Name val:buckets span_id:775) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) ) (';') ) } spids: [768] ) ] ) (command.DParen child: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name: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: (Token id:Id.VSub_Name val:buckets span_id:801) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$max_i')}) ) ) (';') ) } spids: [794] ) ] ) (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:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:815)) ($ Id.VSub_DollarName '$filter') (' ') ($ Id.VSub_DollarName '$var') (' >= ') (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:821) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$max_i')}) ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:826)) ) } spids: [809] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:debug span_id:834) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:838) ) ] action: [ (C {(echo)} {(buckets) (Id.Lit_Other ':')} { (braced_var_sub token: (Token id:Id.VSub_Name val:buckets span_id:849) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ) (C {(echo)} {(tracepoints) (Id.Lit_Other ':')} {($ Id.VSub_DollarName '$tpoints')}) (C {(echo)} {(awkarray) (Id.Lit_Other ':')} { (braced_var_sub token: (Token id:Id.VSub_Name val:awkarray span_id:870) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ) ] spids: [830 840] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:duration span_id:886) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:890) ) ] 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: [895] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:cmd) op: assign_op.Equal rhs: {(DQ ('sleep ') ($ Id.VSub_DollarName '$duration'))} spids: [903] ) ] ) ] spids: [882 892] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:etext) op: assign_op.Equal rhs: {(DQ ('until Ctrl-C'))} spids: [912] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:cmd) op: assign_op.Equal rhs: {(DQ ('sleep 999999'))} spids: [918] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:p_tpoint) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$tpoint')} spids: [926] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$filter'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:940) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:p_tpoint) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$tpoint') (' (Filter: ') (braced_var_sub token: (Token id:Id.VSub_Name val:filter span_id:951) suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{('????')}) ) (')') ) } spids: [946] ) ] ) ] spids: [929 942] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_buckets span_id:965) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:969) ) ] action: [ (C {(echo)} { (DQ ('Tracing ') ($ Id.VSub_DollarName '$p_tpoint') (', specified buckets, ') ($ Id.VSub_DollarName '$etext') (...) ) } ) ] spids: [961 971] ) ] else_action: [ (C {(echo)} { (DQ ('Tracing ') ($ Id.VSub_DollarName '$p_tpoint') (', power-of-') ($ Id.VSub_DollarName '$power') (', max ') ($ Id.VSub_DollarName '$max') (', ') ($ 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: [1007] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:stat) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1016) command_list: (command.CommandList children: [ (command.Simple words: [ {(eval)} {(perf)} {(stat)} {($ Id.VSub_DollarName '$tpoints')} {(-a)} {($ Id.VSub_DollarName '$out')} {($ Id.VSub_DollarName '$cmd')} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1031) fd: 2 arg_word: {(1)} ) ] ) ] ) ) } spids: [1015] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_NEqual left: (arith_expr.ArithWord w:{($ Id.VSub_QMark '$?')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1047) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('ERROR running perf:'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1054) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_DollarName '$stat'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1064) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1072) ) ] spids: [1035 1049] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:debug span_id:1081) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1085) ) ] action: [ (C {(echo)} {(raw)} {(output) (Id.Lit_Other ':')}) (C {(echo)} {(DQ ($ Id.VSub_DollarName '$stat'))}) (C {(echo)}) ] spids: [1077 1087] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:most) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1114) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ Id.VSub_DollarName '$stat'))}) (C {(awk)} {(-v)} {(Id.Lit_VarLike 'tpoint=') ($ Id.VSub_DollarName '$tpoint')} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1131) (Token id: Id.Lit_Chars val: '\t$2 == tpoint { gsub(/,/, ""); if ($1 > m) { m = $1 } }\n' span_id: 1132 ) (Token id:Id.Lit_Chars val:'\tEND { print m }' span_id:1133) ) } ) ] negated: F ) ] ) ) } spids: [1113] ) ] ) (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 (Token id:Id.Lit_Chars val:'\n' span_id:1170) (Token id: Id.Lit_Chars val: '\tfunction star(sval, smax, swidth) {\n' span_id: 1171 ) (Token id:Id.Lit_Chars val:'\t\tstars = ""\n' span_id:1172) (Token id:Id.Lit_Chars val:'\t\tif (smax == 0) return ""\n' span_id:1173) (Token id:Id.Lit_Chars val:'\t\tfor (si = 0; si < (swidth * sval / smax); si++) {\n' span_id:1174) (Token id:Id.Lit_Chars val:'\t\t\tstars = stars "#"\n' span_id:1175) (Token id:Id.Lit_Chars val:'\t\t}\n' span_id:1176) (Token id:Id.Lit_Chars val:'\t\treturn stars\n' span_id:1177) (Token id:Id.Lit_Chars val:'\t}\n' span_id:1178) (Token id:Id.Lit_Chars val:'\tBEGIN {\n' span_id:1179) (Token id:Id.Lit_Chars val:'\t\t' span_id:1180) ) (DQ ($ Id.VSub_DollarName '$awkarray')) (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1186) (Token id: Id.Lit_Chars val: '\t\tprintf(" %-15s: %-8s %s\\n", "Range", "Count",\n' span_id: 1187 ) (Token id:Id.Lit_Chars val:'\t\t "Distribution")\n' span_id:1188) (Token id:Id.Lit_Chars val:'\t}\n' span_id:1189) (Token id:Id.Lit_Chars val:'\t/Performance counter stats/ { i = -1 }\n' span_id:1190) (Token id: Id.Lit_Chars val: '\t# reverse order of rule set is important\n' span_id: 1191 ) (Token id:Id.Lit_Chars val:'\t{ ok = 0 }\n' span_id:1192) (Token id: Id.Lit_Chars val: '\t$2 == tpoint { num = $1; gsub(/,/, "", num); ok = 1 }\n' span_id: 1193 ) (Token id:Id.Lit_Chars val:'\tok && i >= max_i {\n' span_id:1194) (Token id: Id.Lit_Chars val: '\t\tprintf(" %10d -> %-10s: %-8s |%-38s|\\n", buckets[i],\n' span_id: 1195 ) (Token id:Id.Lit_Chars val:'\t\t "", num, star(num, most, 38))\n' span_id:1196) (Token id:Id.Lit_Chars val:'\t\tnext\n' span_id:1197) (Token id:Id.Lit_Chars val:'\t}\n' span_id:1198) (Token id: Id.Lit_Chars val: '\tok && i >= 0 && i < max_i {\n' span_id: 1199 ) (Token id: Id.Lit_Chars val: '\t\tprintf(" %10d -> %-10d: %-8s |%-38s|\\n", buckets[i],\n' span_id: 1200 ) (Token id:Id.Lit_Chars val:'\t\t buckets[i+1] - 1, num, star(num, most, 38))\n' span_id:1201) (Token id:Id.Lit_Chars val:'\t\ti++\n' span_id:1202) (Token id:Id.Lit_Chars val:'\t\tnext\n' span_id:1203) (Token id:Id.Lit_Chars val:'\t}\n' span_id:1204) (Token id:Id.Lit_Chars val:'\tok && i == -1 {\n' span_id:1205) (Token id:Id.Lit_Chars val:'\t\tprintf(" %10s -> %-10d: %-8s |%-38s|\\n", "",\n' span_id:1206) (Token id: Id.Lit_Chars val: '\t\t buckets[0] - 1, num, star(num, most, 38))\n' span_id: 1207 ) (Token id:Id.Lit_Chars val:'\t\ti++\n' span_id:1208) (Token id:Id.Lit_Chars val:'\t}\n' span_id:1209) ) } ) ] negated: F ) ] )