(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tracing) op: Equal rhs: {(/sys/kernel/debug/tracing)} spids: [124] ) ] spids: [124] ) (CommandList children: [ (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: {(EmptyPart)} 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] ) ] ) (CommandList children: [ (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:{(EmptyPart)} 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: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(END)} here_end_span_id: 217 stdin_parts: [ ('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') ] ) (Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)}) ] ) (ControlFlow token:<ControlFlow_Exit 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:T) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ('WARNING: command failed ') (EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) ($ VSub_At '$@') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ) } ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) ] spids: [16777215 242] ) ] spids: [16777215 258] ) ] spids: [228] ) spids: [224 227] ) (FuncDef name: die body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_At '$@'))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [267] ) spids: [263 266] ) (WhileUntil keyword: <KW_While 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: [317] ) ] spids: [317] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:duration) op: Equal rhs: {($ VSub_Name '$OPTARG')} spids: [321] ) ] spids: [321] ) ] spids: [314 315 324 16777215] ) (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: [330] ) ] spids: [330] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:interval) op: Equal rhs: {($ VSub_Name '$OPTARG')} spids: [334] ) ] spids: [334] ) ] spids: [327 328 337 16777215] ) (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: [343] ) ] spids: [343] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tnum) op: Equal rhs: {($ VSub_Name '$OPTARG')} spids: [347] ) ] spids: [347] ) ] spids: [340 341 350 16777215] ) (case_arm pat_list: [{(T)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_timestamp) op: Equal rhs: {(1)} spids: [356] ) ] spids: [356] ) ] spids: [353 354 359 16777215] ) (case_arm pat_list: [{(h)} {(Lit_Other '?')}] action: [(C {(usage)})] spids: [362 365 369 16777215] ) ] spids: [307 311 372] ) ] spids: [304 374] ) ) (C {(shift)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$OPTIND')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [378 387] ) } ) (AndOr ops: [Op_DAmp] children: [ (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Pound '$#')}) right: (ArithWord w:{(Lit_Digits 0)}) ) spids: [393 402] ) (C {(usage)}) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:funcs) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [408] ) ] spids: [408] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:opt_tail) spids:[415 420]) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tcmd) op: Equal rhs: {(DQ ('tail -') ($ VSub_Name '$tnum'))} spids: [426] ) ] spids: [426] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ttext) op: Equal rhs: {(DQ (' Top ') ($ VSub_Name '$tnum') (' only.'))} spids: [433] ) ] spids: [433] ) ] spids: [16777215 423] ) ] spids: [16777215 440] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:opt_duration) spids:[444 449]) 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: [16777215 452] ) ] 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: [469 484] ) (AndOr ops: [Op_DAmp] children: [ (DParen child: (ArithBinary op_id: Arith_DAmp left: (ArithVarRef name:opt_duration) right: (ArithUnary op_id:Arith_Bang child:(ArithVarRef name:opt_interval)) ) spids: [486 496] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:interval) op: Equal rhs: {($ VSub_Name '$duration')} spids: [500] ) ] spids: [500] ) ] ) (AndOr ops: [Op_DPipe] 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)') ) } ) ] ) (C {(sysctl)} {(-q)} {(kernel.ftrace_enabled) (Lit_Other '=') (1)}) (AndOr ops: [Op_DPipe] children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$funcs'))}] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(set_ftrace_filter)})] ) (C {(die)} { (DQ ('ERROR: enabling ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$funcs') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('. Exiting.') ) } ) ] ) (C {(warn)} {(DQ ('echo nop > current_tracer'))}) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(echo)} {(1)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(function_profile_enabled)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)}] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(set_ftrace_filter)})] ) (C {(die)} {(DQ ('ERROR: enabling function profiling.'))} {(DQ ('Have CONFIG_FUNCTION_PROFILER? Exiting.'))} ) ] spids: [16777215 576] ) ] spids: [16777215 597] ) (CommandList children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:quit) op:Equal rhs:{(0)} spids:[603])] spids: [603] ) terminator: <Op_Semi ';'> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:secs) op:Equal rhs:{(0)} spids:[607])] spids: [607] ) ] ) (WhileUntil keyword: <KW_While 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) ) ) ) spids: [612 633] ) terminator: <Op_Semi ';'> ) ] body: (DoGroup children: [ (DParen child: (BinaryAssign op_id: Arith_PlusEqual left: (LhsName name:secs) right: (ArithVarRef name:interval) ) spids: [639 648] ) (SimpleCommand words: [{(echo)} {(0)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(function_profile_enabled)} ) ] ) (SimpleCommand words: [{(echo)} {(1)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(function_profile_enabled)} ) ] ) (C {(sleep)} {($ VSub_Name '$interval')}) (C {(echo)}) (AndOr ops: [Op_DAmp] children: [(DParen child:(ArithVarRef name:opt_timestamp) spids:[678 683]) (C {(date)})] ) (C {(printf)} {(DQ ('%-30s %8s') (Lit_Other '\\') (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: F ) ] spids: [636 740] ) ) (SimpleCommand words: [{(echo)}] redirects: [(Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (SimpleCommand words: [{(echo)} {(DQ ('Ending tracing...'))}] redirects: [(Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (C {(warn)} {(DQ ('echo 0 > function_profile_enabled'))}) (C {(warn)} {(DQ ('echo > set_ftrace_filter'))}) ] )