(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tracing) op: Equal rhs: {(/sys/kernel/debug/tracing)} spids: [124] ) ] spids: [124] ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_duration) op:Equal rhs:{(0)} spids:[127])] spids: [127] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:duration) op:Equal rhs:{(SQ )} spids:[131])] spids: [131] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_interval) op:Equal rhs:{(0)} spids:[134])] spids: [134] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:interval) op:Equal rhs:{(999999)} spids:[138])] spids: [138] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_timestamp) op:Equal rhs:{(0)} spids:[142])] spids: [142] ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_tail) op:Equal rhs:{(0)} spids:[145])] spids: [145] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:tcmd) op:Equal rhs:{(cat)} spids:[149])] spids: [149] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:ttext) op:Equal rhs:{(SQ )} spids:[153])] spids: [153] ) (C {(trap)} {(SQ <'quit=1'>)} {(INT)} {(QUIT)} {(TERM)} {(PIPE)} {(HUP)}) (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLessDash fd: -1 body: { (DQ ('USAGE: funccount [-hT] [-i secs] [-d secs] [-t top] funcstring\n') (' -d seconds # total duration of trace\n') (' -h # this usage message\n') (' -i seconds # interval summary\n') (' -t top # show top num entries only\n') (' -T # include timestamp (for -i)\n') (' eg,\n') (" funccount 'vfs*' # trace all funcs that match ") (Right_DoubleQuote '"') ('vfs*') (Right_DoubleQuote '"') ('\n') (" funccount -d 5 'tcp*' # trace ") (Right_DoubleQuote '"') ('tcp*') (Right_DoubleQuote '"') (' funcs for 5 seconds\n') (" funccount -t 10 'ext3*' # show top 10 ") (Right_DoubleQuote '"') ('ext3*') (Right_DoubleQuote '"') (' funcs\n') (" funccount -i 1 'ext3*' # summary every 1 second\n") (" funccount -i 1 -d 5 'ext3*' # 5 x 1 second summaries\n") ('\n') ('See the man page and example file for more info.\n') ) } do_expansion: True here_end: END was_filled: True spids: [184] ) (Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[187]) ] ) (C {(exit)}) ] spids: [179] ) spids: [175 178] ) (FuncDef name: warn body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children:[(C {(eval)} {(DQ ($ VSub_At '$@'))})] negated:True) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ('WARNING: command failed ') (EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) ($ VSub_At '$@') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[245])] ) ] spids: [-1 240] ) ] spids: [-1 256] ) ] spids: [226] ) spids: [222 225] ) (FuncDef name: die body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_At '$@'))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[270])] ) (C {(exit)} {(1)}) ] spids: [265] ) spids: [261 264] ) (While cond: [(C {(getopts)} {(d) (Lit_Other ':') (hi) (Lit_Other ':') (t) (Lit_Other ':') (T)} {(opt)})] body: (DoGroup children: [ (Case to_match: {($ VSub_Name '$opt')} arms: [ (case_arm pat_list: [{(d)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_duration) op: Equal rhs: {(1)} spids: [315] ) ] spids: [315] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:duration) op: Equal rhs: {($ VSub_Name '$OPTARG')} spids: [319] ) ] spids: [319] ) ] spids: [312 313 322 -1] ) (case_arm pat_list: [{(i)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_interval) op: Equal rhs: {(1)} spids: [328] ) ] spids: [328] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:interval) op: Equal rhs: {($ VSub_Name '$OPTARG')} spids: [332] ) ] spids: [332] ) ] spids: [325 326 335 -1] ) (case_arm pat_list: [{(t)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_tail) op: Equal rhs: {(1)} spids: [341] ) ] spids: [341] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tnum) op: Equal rhs: {($ VSub_Name '$OPTARG')} spids: [345] ) ] spids: [345] ) ] spids: [338 339 348 -1] ) (case_arm pat_list: [{(T)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_timestamp) op: Equal rhs: {(1)} spids: [354] ) ] spids: [354] ) ] spids: [351 352 357 -1] ) (case_arm pat_list: [{(h)} {(Lit_Other '?')}] action: [(C {(usage)})] spids: [360 363 367 -1] ) ] spids: [305 309 370] ) ] spids: [302 372] ) ) (C {(shift)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$OPTIND')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [376 385] ) } ) (AndOr children: [ (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Pound '$#')}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) (C {(usage)}) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:funcs) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [406] ) ] spids: [406] ) (If arms: [ (if_arm cond: [(Sentence child:(DParen child:(ArithVarRef name:opt_tail)) terminator:<Op_Semi ';'>)] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tcmd) op: Equal rhs: {(DQ ('tail -') ($ VSub_Name '$tnum'))} spids: [424] ) ] spids: [424] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ttext) op: Equal rhs: {(DQ (' Top ') ($ VSub_Name '$tnum') (' only.'))} spids: [431] ) ] spids: [431] ) ] spids: [-1 421] ) ] spids: [-1 438] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:opt_duration)) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('Tracing ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$funcs') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' for ') ($ VSub_Name '$duration') (' seconds.') ($ VSub_Name '$ttext') (..) ) } ) ] spids: [-1 450] ) ] else_action: [ (C {(echo)} { (DQ ('Tracing ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$funcs') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (.) ($ VSub_Name '$ttext') ('.. Ctrl-C to end.') ) } ) ] spids: [467 482] ) (AndOr children: [ (DParen child: (ArithBinary op_id: Arith_DAmp left: (ArithVarRef name:opt_duration) right: (ArithUnary op_id:Arith_Bang child:(ArithVarRef name:opt_interval)) ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:interval) op: Equal rhs: {($ VSub_Name '$duration')} spids: [498] ) ] spids: [498] ) ] op_id: Op_DAmp ) (AndOr children: [ (C {(cd)} {($ VSub_Name '$tracing')}) (C {(die)} { (DQ ('ERROR: accessing tracing. Root user? Kernel has FTRACE?\n') (' debugfs mounted? (mount -t debugfs debugfs /sys/kernel/debug)') ) } ) ] op_id: Op_DPipe ) (C {(sysctl)} {(-q)} {(kernel.ftrace_enabled) (Lit_Other '=') (1)}) (AndOr children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$funcs'))}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(set_ftrace_filter)} spids:[539])] ) (C {(die)} { (DQ ('ERROR: enabling ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$funcs') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('. Exiting.') ) } ) ] op_id: Op_DPipe ) (C {(warn)} {(DQ ('echo nop > current_tracer'))}) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(echo)} {(1)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(function_profile_enabled)} spids: [569] ) ] ) ] negated: True ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(set_ftrace_filter)} spids:[579])] ) (C {(die)} {(DQ ('ERROR: enabling function profiling.'))} {(DQ ('Have CONFIG_FUNCTION_PROFILER? Exiting.'))} ) ] spids: [-1 574] ) ] spids: [-1 595] ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:quit) op:Equal rhs:{(0)} spids:[601])] spids: [601] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:secs) op:Equal rhs:{(0)} spids:[605])] spids: [605] ) (While cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DAmp left: (ArithUnary op_id:Arith_Bang child:(ArithVarRef name:quit)) right: (ArithBinary op_id: Arith_DPipe left: (ArithUnary op_id:Arith_Bang child:(ArithVarRef name:opt_duration)) right: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:secs) right: (ArithVarRef name:duration) ) ) ) ) terminator: <Op_Semi ';'> ) ] body: (DoGroup children: [ (DParen child: (BinaryAssign op_id: Arith_PlusEqual left: (LhsName name:secs) right: (ArithVarRef name:interval) ) ) (SimpleCommand words: [{(echo)} {(0)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(function_profile_enabled)} spids: [653] ) ] ) (SimpleCommand words: [{(echo)} {(1)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(function_profile_enabled)} spids: [662] ) ] ) (C {(sleep)} {($ VSub_Name '$interval')}) (C {(echo)}) (AndOr children: [(DParen child:(ArithVarRef name:opt_timestamp)) (C {(date)})] op_id: Op_DAmp ) (C {(printf)} {(DQ ('%-30s %8s') (EscapedLiteralPart token:<Lit_EscapedChar '\\n'>))} {(DQ (FUNC))} {(DQ (COUNT))} ) (Pipeline children: [ (C {(cat)} {(trace_stat/function) (Lit_Other '*')}) (C {(awk)} { (SQ <'\n'> <'\t# skip headers by matching on the numeric hit column\n'> <'\t$2 ~ /[0-9]/ { a[$1] += $2 }\n'> <'\tEND {\n'> <'\t\tfor (k in a) {\n'> <'\t\t\tprintf "%-30s %8d\\n", k, a[k]\n'> <'\t\t}\n'> <'\t}'> ) } ) (C {(sort)} {(-n)} {(-k2)}) (C {($ VSub_Name '$tcmd')}) ] negated: False ) ] spids: [634 737] ) ) (SimpleCommand words: [{(echo)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[745])] ) (SimpleCommand words: [{(echo)} {(DQ ('Ending tracing...'))}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[754])] ) (C {(warn)} {(DQ ('echo 0 > function_profile_enabled'))}) (C {(warn)} {(DQ ('echo > set_ftrace_filter'))}) ] )