(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tracing spids:[148]) op: Equal rhs: {(/sys/kernel/debug/tracing)} spids: [148] ) ] spids: [148] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:flock spids:[151]) op: Equal rhs: {(/var/tmp/.ftrace-lock)} spids: [151] ) ] spids: [151] ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:wroteflock spids:[155]) op: Equal rhs: {(0)} spids: [155] ) ] spids: [155] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_duration spids:[158]) op: Equal rhs: {(0)} spids: [158] ) ] spids: [158] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:duration spids:[162]) op: Equal rhs: (word.EmptyWord) spids: [162] ) ] spids: [162] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_pid spids:[165]) op: Equal rhs: {(0)} spids: [165] ) ] spids: [165] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pid spids:[169]) op: Equal rhs: (word.EmptyWord) spids: [169] ) ] spids: [169] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_tid spids:[172]) op: Equal rhs: {(0)} spids: [172] ) ] spids: [172] ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tid spids:[176]) op: Equal rhs: (word.EmptyWord) spids: [176] ) ] spids: [176] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_filter spids:[178]) op: Equal rhs: {(0)} spids: [178] ) ] spids: [178] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter spids:[182]) op: Equal rhs: (word.EmptyWord) spids: [182] ) ] spids: [182] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_view spids:[185]) op: Equal rhs: {(0)} spids: [185] ) ] spids: [185] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_headers spids:[189]) op: Equal rhs: {(0)} spids: [189] ) ] spids: [189] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_stack spids:[193]) op: Equal rhs: {(0)} spids: [193] ) ] spids: [193] ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:dmesg spids:[197]) op: Equal rhs: {(2)} spids: [197] ) ] spids: [197] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:debug spids:[200]) op: Equal rhs: {(0)} spids: [200] ) ] spids: [200] ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_force spids:[204]) op: Equal rhs: {(0)} spids: [204] ) ] spids: [204] ) ] ) (C {(trap)} {(SQ <':'>)} {(INT)} {(QUIT)} {(TERM)} {(PIPE)} {(HUP)}) (command.FuncDef name: usage body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(END)} here_end_span_id: 286 stdin_parts: [ ( 'USAGE: kprobe [-FhHsv] [-d secs] [-p PID] [-L TID] kprobe_definition [filter]\n' ) (' -F # force. trace despite warnings.\n') (' -d seconds # trace duration, and use buffers\n') (' -p PID # PID to match on events\n') (' -L TID # thread id to match on events\n') (" -v # view format file (don't trace)\n") (' -H # include column headers\n') (' -s # show kernel stack traces\n') (' -h # this usage message\n') ('\n') ('Note that these examples may need modification to match your kernel\n') ("version's function names and platform's register usage.\n") (' eg,\n') (' kprobe p:do_sys_open\n') (' # trace open() entry\n') (' kprobe r:do_sys_open\n') (' # trace open() return\n') (" kprobe 'r:do_sys_open ") (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("retval'\n") (' # trace open() return value\n') (" kprobe 'r:myopen do_sys_open ") (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ("retval'\n") (' # use a custom probe name\n') (" kprobe 'p:myopen do_sys_open mode=%cx:u16'\n") (' # trace open() file mode\n') (" kprobe 'p:myopen do_sys_open filename=+0(%si):string'\n") (' # trace open() with filename\n') (" kprobe -s 'p:myprobe tcp_retransmit_skb'\n") (' # show kernel stacks\n') (" kprobe 'p:do_sys_open file=+0(%si):string' 'file ~ ") (Right_DoubleQuote '"') ('*stat') (Right_DoubleQuote '"') ("'\n") (' # opened files ending in ') (Right_DoubleQuote '"') (stat) (Right_DoubleQuote '"') ('\n') ('\n') ('See the man page and example file for more info.\n') ] ) (redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)}) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] spids: [231] ) spids: [227 230] ) (command.FuncDef name: warn body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [(C {(eval)} {(DQ ($ VSub_At '$@'))})] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [ {(echo)} { (DQ ('WARNING: command failed ') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) ($ VSub_At '$@') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) ] spids: [16777215 311] ) ] spids: [16777215 327] ) ] spids: [297] ) spids: [293 296] ) (command.FuncDef name: end body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(echo)}] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (command.SimpleCommand words: [{(echo)} {(DQ ('Ending tracing...'))}] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (C {(cd)} {($ VSub_DollarName '$tracing')}) (C {(warn)} {(DQ ('echo 0 > events/kprobes/') ($ VSub_DollarName '$kname') (/enable))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_filter>) spids: [375 380] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(warn)} {(DQ ('echo 0 > events/kprobes/') ($ VSub_DollarName '$kname') (/filter))} ) ] spids: [16777215 383] ) ] spids: [16777215 395] ) (C {(warn)} {(DQ ('echo -:') ($ VSub_DollarName '$kname') (' >> kprobe_events'))}) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_stack>) spids: [407 412] ) (C {(warn)} {(DQ ('echo 0 > options/stacktrace'))}) ] ) (C {(warn)} {(DQ ('echo > trace'))}) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike wroteflock>) spids: [430 435] ) (C {(warn)} {(DQ ('rm ') ($ VSub_DollarName '$flock'))}) ] ) ] spids: [336] ) spids: [332 335] ) (command.FuncDef name: die body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_At '$@'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [453] ) spids: [449 452] ) (command.FuncDef name: edie body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_At '$@'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.SimpleCommand words: [{(exec)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) (C {(end)}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [477] ) spids: [473 476] ) (command.WhileUntil keyword: <KW_While while> cond: [ (C {(getopts)} {(Fd) (Lit_Other ':') (hHp) (Lit_Other ':') (L) (Lit_Other ':') (sv)} {(opt)}) ] body: (command.DoGroup children: [ (command.Case to_match: {($ VSub_DollarName '$opt')} arms: [ (case_arm pat_list: [{(F)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_force spids:[543]) op: Equal rhs: {(1)} spids: [543] ) ] spids: [543] ) ] spids: [540 541 546 16777215] ) (case_arm pat_list: [{(d)}] action: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_duration spids:[552]) op: Equal rhs: {(1)} spids: [552] ) ] spids: [552] ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:duration spids:[556]) op: Equal rhs: {($ VSub_DollarName '$OPTARG')} spids: [556] ) ] spids: [556] ) ] spids: [549 550 559 16777215] ) (case_arm pat_list: [{(p)}] action: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_pid spids:[565]) op: Equal rhs: {(1)} spids: [565] ) ] spids: [565] ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pid spids:[569]) op: Equal rhs: {($ VSub_DollarName '$OPTARG')} spids: [569] ) ] spids: [569] ) ] spids: [562 563 572 16777215] ) (case_arm pat_list: [{(L)}] action: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_tid spids:[578]) op: Equal rhs: {(1)} spids: [578] ) ] spids: [578] ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tid spids:[582]) op: Equal rhs: {($ VSub_DollarName '$OPTARG')} spids: [582] ) ] spids: [582] ) ] spids: [575 576 585 16777215] ) (case_arm pat_list: [{(H)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_headers spids:[591]) op: Equal rhs: {(1)} spids: [591] ) ] spids: [591] ) ] spids: [588 589 594 16777215] ) (case_arm pat_list: [{(s)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_stack spids:[600]) op: Equal rhs: {(1)} spids: [600] ) ] spids: [600] ) ] spids: [597 598 603 16777215] ) (case_arm pat_list: [{(v)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_view spids:[609]) op: Equal rhs: {(1)} spids: [609] ) ] spids: [609] ) ] spids: [606 607 612 16777215] ) (case_arm pat_list: [{(h)} {(Lit_Other '?')}] action: [(C {(usage)})] spids: [615 618 622 16777215] ) ] spids: [533 537 625] ) ] spids: [530 627] ) ) (C {(shift)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$OPTIND')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) spids: [631 640] ) } ) (command.AndOr ops: [Op_DPipe] children: [ (command.DParen child:(arith_expr.ArithWord w:{($ VSub_Pound '$#')}) spids:[642 647]) (C {(usage)}) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:kprobe spids:[653]) op: Equal rhs: {($ VSub_Number '$1')} spids: [653] ) ] spids: [653] ) (C {(shift)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithWord w:{($ VSub_Pound '$#')}) spids: [660 665] ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_filter spids:[671]) op: Equal rhs: {(1)} spids: [671] ) ] spids: [671] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter spids:[675]) op: Equal rhs: {($ VSub_Number '$1')} spids: [675] ) ] spids: [675] ) ] spids: [16777215 668] ) ] spids: [16777215 678] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.ArithBinary op_id: Arith_Great left: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_pid>) right: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_filter>) ) right: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_tid>) ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) spids: [684 701] ) (C {(die)} {(DQ ('ERROR: use at most one of -p, -L, or filter.'))}) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.ArithBinary op_id: Arith_DAmp left: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_duration>) right: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_view>) ) spids: [713 722] ) (C {(die)} {(DQ ('ERROR: use either -d or -v.'))}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_pid>) spids: [734 739] ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_filter spids:[749]) op: Equal rhs: {(1)} spids: [749] ) ] spids: [749] ) (command.ForEach iter_name: tid iter_words: [{(/proc/) ($ VSub_DollarName '$pid') (/task/) (Lit_Other '*')}] do_arg_iter: F body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter spids:[772]) op: Equal rhs: { (DQ ($ VSub_DollarName '$filter') (' || common_pid == ') (word_part.BracedVarSub token: <VSub_Name tid> suffix_op: (suffix_op.StringUnary op_id: VOp1_DPound arg_word: {('*') (Lit_Slash /)} ) spids: [776 781] ) ) } spids: [772] ) ] spids: [772] ) ] spids: [769 785] ) spids: [762 767] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter spids:[788]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name filter> suffix_op: (suffix_op.Slice begin:(arith_expr.ArithWord w:{(Lit_Digits 3)})) spids: [789 793] ) } spids: [788] ) ] spids: [788] ) ] spids: [16777215 742] ) ] spids: [16777215 798] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_tid>) spids: [802 807] ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_filter spids:[813]) op: Equal rhs: {(1)} spids: [813] ) ] spids: [813] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter spids:[817]) op: Equal rhs: {(DQ ('common_pid == ') ($ VSub_DollarName '$tid'))} spids: [817] ) ] spids: [817] ) ] spids: [16777215 810] ) ] spids: [16777215 823] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_DollarName '$kprobe'))} right: {(p) (Lit_Other ':') (Lit_Other '*')} ) right: (bool_expr.BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_DollarName '$kprobe'))} right: {(r) (Lit_Other ':') (Lit_Other '*')} ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ('ERROR: invalid kprobe definition (should start with p: or r:)'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (C {(usage)}) ] spids: [16777215 854] ) ] spids: [16777215 869] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:krest spids:[907]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name kprobe> suffix_op: (suffix_op.StringUnary op_id:VOp1_Pound arg_word:{('*:')}) spids: [908 912] ) } spids: [907] ) ] spids: [907] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:kname spids:[914]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name krest> suffix_op: (suffix_op.StringUnary op_id:VOp1_DPercent arg_word:{(' *')}) spids: [915 919] ) } spids: [914] ) ] spids: [914] ) (C {(set)} {(--)} {($ VSub_DollarName '$krest')}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number '$2')} right: {(DQ )} ) right: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number '$2')} right: {(Lit_Other '*') (Lit_Other '[') (BoolBinary_GlobEqual '=') (Lit_Other '%') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (Lit_Other ']') (Lit_Other '*') } ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ktype spids:[962]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name kprobe> suffix_op: (suffix_op.StringUnary op_id:VOp1_DPercent arg_word:{(':*')}) spids: [963 967] ) } spids: [962] ) ] spids: [962] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:kprobe spids:[970]) op: Equal rhs: { (DQ ($ VSub_DollarName '$ktype') (':') ($ VSub_DollarName '$kname') (' ') ($ VSub_DollarName '$krest') ) } spids: [970] ) ] spids: [970] ) ] spids: [16777215 955] ) ] spids: [16777215 979] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike debug>) spids: [983 988] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('kname: ') ($ VSub_DollarName '$kname') (', kprobe: ') ($ VSub_DollarName '$kprobe') ) } ) ] spids: [16777215 991] ) ] spids: [16777215 1003] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(cd)} {($ VSub_DollarName '$tracing')}) (C {(die)} { (DQ ('ERROR: accessing tracing. Root user? Kernel has FTRACE?\n') (' debugfs mounted? (mount -t debugfs debugfs /sys/kernel/debug)') ) } ) ] ) (C {(set)} {(--)} {($ VSub_DollarName '$kprobe')}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:fname spids:[1032]) op: Equal rhs: {($ VSub_Number '$2')} spids: [1032] ) ] spids: [1032] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.ArithUnary op_id: Arith_Bang child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_force>) ) spids: [1037 1043] ) (command.Pipeline children: [ (command.SimpleCommand words: [ {(grep)} {(-w)} {($ VSub_DollarName '$fname')} {(available_filter_functions)} ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] ) ] negated: T ) ] ) ] action: [ (command.SimpleCommand words: [ {(echo)} { (DQ ('ERROR: func ') ($ VSub_DollarName '$fname') (' not in ') ($ VSub_DollarName '$PWD') (/available_filter_functions.) ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.SimpleCommand words: [{(printf)} {(DQ ("Either it doesn't exist, or, it might be unsafe to kprobe. "))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.SimpleCommand words: [{(echo)} {(DQ ('Exiting. Use -F to override.'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 1065] ) ] spids: [16777215 1106] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithUnary op_id: Arith_Bang child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_view>) ) spids: [1111 1117] ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_duration>) spids: [1125 1130] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('Tracing kprobe ') ($ VSub_DollarName '$kname') (' for ') ($ VSub_DollarName '$duration') (' seconds (buffered)...') ) } ) ] spids: [16777215 1133] ) ] else_action: [ (C {(echo)} {(DQ ('Tracing kprobe ') ($ VSub_DollarName '$kname') ('. Ctrl-C to end.'))}) ] spids: [1147 1159] ) ] spids: [16777215 1120] ) ] spids: [16777215 1161] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.BoolUnary op_id:BoolUnary_e child:{($ VSub_DollarName '$flock')}) ) (C {(die)} { (DQ ('ERROR: ftrace may be in use by PID ') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(cat)} {($ VSub_DollarName '$flock')})] ) left_token: <Left_CommandSub '$('> spids: [1181 1185] ) (' ') ($ VSub_DollarName '$flock') ) } ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(echo)} {($ VSub_Dollar '$$')}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {($ VSub_DollarName '$flock')} ) ] ) (C {(die)} {(DQ ('ERROR: unable to write ') ($ VSub_DollarName '$flock') (.))}) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:wroteflock spids:[1208]) op: Equal rhs: {(1)} spids: [1208] ) ] spids: [1208] ) (command.SimpleCommand words: [{(echo)} {(nop)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(current_tracer)})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_DollarName '$kprobe'))}] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(kprobe_events)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [ {(echo)} { (DQ ('ERROR: adding kprobe ') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_DollarName '$kprobe') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (.) ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike dmesg>) spids: [1257 1262] ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [ {(echo)} { (DQ ('Last ') ($ VSub_DollarName '$dmesg') (' dmesg entries (might contain reason):') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.Pipeline children: [ (C {(dmesg)}) (C {(tail)} {(-) ($ VSub_DollarName '$dmesg')}) (C {(sed)} {(SQ <'s/^/ /'>)}) ] negated: F ) ] spids: [16777215 1265] ) ] spids: [16777215 1298] ) (C {(edie)} {(DQ (Exiting.))}) ] spids: [16777215 1238] ) ] spids: [16777215 1307] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_view>) spids: [1311 1316] ) terminator: <Op_Semi ';'> ) ] action: [(C {(cat)} {(events/kprobes/) ($ VSub_DollarName '$kname') (/format)}) (C {(edie)} {(DQ )})] spids: [16777215 1319] ) ] spids: [16777215 1334] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_filter>) spids: [1338 1343] ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_DollarName '$filter'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(events/kprobes/) ($ VSub_DollarName '$kname') (/filter)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [(C {(edie)} {(DQ ('ERROR: setting filter or -p. Exiting.'))})] spids: [16777215 1366] ) ] spids: [16777215 1376] ) ] spids: [16777215 1346] ) ] spids: [16777215 1378] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_stack>) spids: [1382 1387] ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.SimpleCommand words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(options/stacktrace)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [(C {(edie)} {(DQ ('ERROR: enabling stack traces (-s). Exiting'))})] spids: [16777215 1406] ) ] spids: [16777215 1416] ) ] spids: [16777215 1390] ) ] spids: [16777215 1418] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.SimpleCommand words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(events/kprobes/) ($ VSub_DollarName '$kname') (/enable)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(edie)} {(DQ ('ERROR: enabling kprobe ') ($ VSub_DollarName '$kname') ('. Exiting.'))}) ] spids: [16777215 1435] ) ] spids: [16777215 1446] ) (C {(warn)} {(DQ ('echo > trace'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_duration>) spids: [1460 1465] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(sleep)} {($ VSub_DollarName '$duration')}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_headers>) spids: [1478 1483] ) terminator: <Op_Semi ';'> ) ] action: [(C {(cat)} {(trace)})] spids: [16777215 1486] ) ] else_action: [(C {(grep)} {(-v)} {(SQ <'^#'>)} {(trace)})] spids: [1494 1508] ) ] spids: [16777215 1468] ) ] else_action: [ (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.ArithVarRef token:<Lit_ArithVarLike opt_headers>) spids: [1517 1522] ) (C {(cat)} {(trace)}) ] ) (C {(cat)} {(trace_pipe)}) ] spids: [1510 1535] ) (C {(end)}) ] )