(command.CommandList children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tracing) op: Equal rhs: {(/sys/kernel/debug/tracing)} ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:flock) op: Equal rhs: {(/var/tmp/.ftrace-lock)} ) ] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:wroteflock) op:Equal rhs:{(0)})] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_duration) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:duration) op:Equal rhs:(word.Empty))] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_pid) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:pid) op:Equal rhs:(word.Empty))] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_tid) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:tid) op:Equal rhs:(word.Empty))] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_filter) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter) op:Equal rhs:(word.Empty))] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_view) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_headers) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_stack) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:dmesg) op:Equal rhs:{(2)})] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:debug) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_force) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_list) op:Equal rhs:{(0)})] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:target) op:Equal rhs:(word.Empty))] ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:PATH) op: Equal rhs: {($ VSub_DollarName '$PATH') (Lit_Other ':') (/usr/bin) (Lit_Other ':') (/sbin)} ) ] ) (C {(trap)} {(SQ <':'>)} {(INT)} {(QUIT)} {(TERM)} {(PIPE)} {(HUP)}) (command.FuncDef name: usage body: (command.BraceGroup children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(END)} here_end_span_id: 340 stdin_parts: [ ('USAGE: uprobe [-FhHsv] [-d secs] [-p PID] [-L TID] {-l target |\n') (' uprobe_definition [filter]}\n') (' -F # force. trace despite warnings.\n') (' -d seconds # trace duration, and use buffers\n') (' -l target # list functions from this executable\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 user 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') (' # trace readline() calls in all running ') (Right_DoubleQuote '"') (bash) (Right_DoubleQuote '"') (' executables:\n') (' uprobe p:bash:readline\n') (' # trace readline() with explicit executable path:\n') (' uprobe p:/bin/bash:readline\n') (' # trace the return of readline() with return value as a string:\n') (" uprobe 'r:bash:readline +0(") (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) ("retval):string'\n") (' # trace sleep() calls in all running libc shared libraries:\n') (' uprobe p:libc:sleep\n') (' # trace sleep() with register %di (x86):\n') (" uprobe 'p:libc:sleep %di'\n") (' # trace this address (use caution: must be instruction aligned):\n') (' uprobe p:libc:0xbf130\n') (' # trace gettimeofday() for PID 1182 only:\n') (' uprobe -p 1182 p:libc:gettimeofday\n') (' # trace the return of fopen() only when it returns NULL:\n') (" uprobe 'r:libc:fopen file=") (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) ("retval' 'file == 0'\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>) ] ) ) (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.Simple words: [ {(echo)} { (DQ ('WARNING: command failed ') (word_part.EscapedLiteral token: <Lit_EscapedChar '\\"'> ) ($ VSub_At '$@') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) ] ) ] ) ] ) ) (command.FuncDef name: end body: (command.BraceGroup children: [ (command.Simple words: [{(echo)}] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (command.Simple 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/uprobes/') ($ VSub_DollarName '$uname') (/enable))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token:<Lit_ArithVarLike opt_filter>) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(warn)} {(DQ ('echo 0 > events/uprobes/') ($ VSub_DollarName '$uname') (/filter))} ) ] ) ] ) (C {(warn)} {(DQ ('echo -:') ($ VSub_DollarName '$uname') (' >> uprobe_events'))}) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.VarRef token:<Lit_ArithVarLike opt_stack>) ) (C {(warn)} {(DQ ('echo 0 > options/userstacktrace'))}) ] ) (C {(warn)} {(DQ ('echo > trace'))}) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.VarRef token:<Lit_ArithVarLike wroteflock>) ) (C {(warn)} {(DQ ('rm ') ($ VSub_DollarName '$flock'))}) ] ) ] ) ) (command.FuncDef name: die body: (command.BraceGroup children: [ (command.Simple 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)}) ] ) ) (command.FuncDef name: edie body: (command.BraceGroup children: [ (command.Simple words: [{(echo)} {(DQ ($ VSub_At '$@'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.Simple 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)}) ] ) ) (command.FuncDef name: set_path body: (command.BraceGroup children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:name) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:path) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(which)} {($ VSub_DollarName '$name')})] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$path'))} right: {(DQ )} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:path) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [{(ldconfig)} {(-v)}] redirects: [ (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(awk)} {(-v)} {(Lit_VarLike 'lib=') ($ VSub_DollarName '$name')} { (SQ <'\n'> < '\t\t $1 ~ /:/ { sub(/:/, "", $1); path = $1 }\n' > <'\t\t { sub(/\\..*/, "", $1); }\n'> <'\t\t $1 == lib { print path "/" $3 }'> ) } ) ] negated: F ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$path'))} right: {(DQ )} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(die)} { (DQ ('ERROR: segment ') (word_part.EscapedLiteral token: <Lit_EscapedChar '\\"'> ) ($ VSub_DollarName '$name') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' ambiguous.') ) } {(DQ ('Program or library? Try a full path.'))} ) ] ) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.Unary op_id: BoolUnary_x child: {($ VSub_DollarName '$path')} ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(die)} { (DQ ('ERROR: resolved ') (word_part.EscapedLiteral token: <Lit_EscapedChar '\\"'> ) ($ VSub_DollarName '$name') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' to ') (word_part.EscapedLiteral token: <Lit_EscapedChar '\\"'> ) ($ VSub_DollarName '$path') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (', but file missing') ) } ) ] ) ] ) ] ) ) (command.FuncDef name: set_addr body: (command.BraceGroup children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:path) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:name) op: Equal rhs: {($ VSub_Number '$2')} ) ] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:sym) op:Equal rhs:{($ VSub_Number '$3')})] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$path'))} right: {(DQ )} ) ) (C {(die)} {(DQ ('ERROR: missing symbol path.'))}) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$sym'))} right: {(DQ )} ) ) (C {(die)} {(DQ ('ERROR: missing symbol for ') ($ VSub_DollarName '$path'))}) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:addr) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(objdump)} {(-tT)} {($ VSub_DollarName '$path')}) (C {(awk)} {(-v)} {(Lit_VarLike 'sym=') ($ VSub_DollarName '$sym')} { (SQ <'\n'> <'\t $NF == sym && $4 == ".text" { print $1; exit }'> ) } ) ] negated: F ) ] ) ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$addr'))} right: {(DQ )} ) ) (C {(die)} { (DQ ('ERROR: missing symbol ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ($ VSub_DollarName '$sym') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' in ') ($ VSub_DollarName '$path') ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_DEqual left: (arith_expr.ArithWord w: {(Lit_Digits 0) (Lit_ArithVarLike x) ($ VSub_DollarName '$addr')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) (C {(die)} { (DQ ('ERROR: failed resolving ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ($ VSub_DollarName '$sym') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' in ') ($ VSub_DollarName '$path') (.) ) } {(DQ ('Maybe it exists in a different target (eg, library)?'))} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:addr) op: Equal rhs: {(0x) (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(printf)} {(DQ ('%x'))} {(0x) ($ VSub_DollarName '$addr')})] ) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:type) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(file)} {($ VSub_DollarName '$path')})] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_DollarName '$type'))} right: {(Lit_Other '*') (shared) (Lit_Other '?') (object) (Lit_Other '*')} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:base) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(objdump)} {(-x)} {($ VSub_DollarName '$path')}) (C {(awk)} { (SQ <'\n'> < '\t\t $1 == "LOAD" && $3 ~ /^[0x]*$/ { print $5 }' > ) } ) ] negated: F ) ] ) ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_DollarName '$base'))} right: {(0x) (Lit_Other '*')} ) ) (C {(die)} {(DQ ('ERROR: finding base load addr'))} {(DQ ('for ') ($ VSub_DollarName '$path') (.))} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:addr) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.VarRef token:<Lit_ArithVarLike addr>) right: (arith_expr.VarRef token:<Lit_ArithVarLike base>) ) ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:<Lit_ArithVarLike addr>) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) (C {(die)} {(DQ ('ERROR: transposed address for ') ($ VSub_DollarName '$sym'))} {(DQ ('became negative: ') ($ VSub_DollarName '$addr'))} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:addr) op: Equal rhs: {(0x) (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(printf)} {(DQ ('%x'))} {($ VSub_DollarName '$addr')}) ] ) ) } ) ] ) ] ) ] ) ] ) ) (command.WhileUntil keyword: <KW_While while> cond: [ (C {(getopts)} {(Fd) (Lit_Other ':') (hHl) (Lit_Other ':') (p) (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 pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_force) op:Equal rhs:{(1)})] ) ] ) (case_arm pat_list: [{(d)}] action: [ (command.Sentence child: (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_duration) op: Equal rhs: {(1)} ) ] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:duration) op: Equal rhs: {($ VSub_DollarName '$OPTARG')} ) ] ) ] ) (case_arm pat_list: [{(p)}] action: [ (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_pid) op:Equal rhs:{(1)})] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pid) op: Equal rhs: {($ VSub_DollarName '$OPTARG')} ) ] ) ] ) (case_arm pat_list: [{(L)}] action: [ (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_tid) op:Equal rhs:{(1)})] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tid) op: Equal rhs: {($ VSub_DollarName '$OPTARG')} ) ] ) ] ) (case_arm pat_list: [{(l)}] action: [ (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_list) op:Equal rhs:{(1)})] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:target) op: Equal rhs: {($ VSub_DollarName '$OPTARG')} ) ] ) ] ) (case_arm pat_list: [{(H)}] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_headers) op:Equal rhs:{(1)})] ) ] ) (case_arm pat_list: [{(s)}] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_stack) op:Equal rhs:{(1)})] ) ] ) (case_arm pat_list: [{(v)}] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_view) op:Equal rhs:{(1)})] ) ] ) (case_arm pat_list:[{(h)} {(Lit_QMark '?')}] action:[(C {(usage)})]) ] ) ] ) ) (C {(shift)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$OPTIND')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:uprobe) op:Equal rhs:{($ VSub_Number '$1')})] ) (C {(shift)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.ArithWord w:{($ VSub_Pound '$#')})) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_filter) op:Equal rhs:{(1)})] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) ] ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$opt_list'))} right: {(1)} ) right: (bool_expr.Binary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_DollarName '$uprobe'))} right: {(DQ )} ) ) ) (C {(die)} {(DQ ('ERROR: -l takes a target only'))}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike opt_list>)) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_DollarName '$target'))} right: {(Lit_Other '*') (/) (Lit_Other '*')} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(set_path)} {($ VSub_DollarName '$target')}) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:target) op: Equal rhs: {($ VSub_DollarName '$path')} ) ] ) ] ) ] ) (command.Pipeline children: [ (C {(objdump)} {(-tT)} {($ VSub_DollarName '$target')}) (C {(awk)} {(SQ <'$4 == ".text" { print $NF }'>)}) (C {(sort)}) (C {(uniq)}) ] negated: F ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ver) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(uname)} {(-r)})]) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:maj) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name ver> suffix_op: (suffix_op.Unary op_id:VOp1_DPercent arg_word:{('.*')}) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Arith_DAmp left: (arith_expr.Binary op_id: Arith_DEqual left: (arith_expr.VarRef token:<Lit_ArithVarLike opt_force>) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) right: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.ArithWord w:{($ VSub_DollarName '$maj')}) right: (arith_expr.ArithWord w:{(Lit_Digits 4)}) ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(END)} here_end_span_id: 1366 stdin_parts: [ ('ERROR: Kernel version >= 4.0 preferred (you have ') ($ VSub_DollarName '$ver') ('). Aborting.\n') ('\n') ("Background: uprobes were first added in 3.5. I've tested them on 3.13,\n") ('and found them unsafe, as they can crash or lock up processes, which can\n') ('effectively lock up the system. On 4.0, uprobes seem much safer. You\n') ("can use -F to force tracing, but you've been warned.\n") ] ) (redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)}) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) (command.ForEach iter_name: cmd iter_words: [{(file)} {(objdump)} {(ldconfig)} {(awk)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Simple words: [{(which)} {($ VSub_DollarName '$cmd')}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_NEqual left: (arith_expr.ArithWord w:{($ VSub_QMark '$?')}) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) (C {(die)} { (DQ ('ERROR: missing ') ($ VSub_DollarName '$cmd') (' in ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) ('PATH. ') ($ VSub_Number '$0') (' needs') ) } {(DQ ('to use this command. Exiting.'))} ) ] ) ] ) ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id:BoolBinary_GlobDEqual left:{(DQ ($ VSub_DollarName '$uprobe'))} right:{(DQ )}) ) (C {(usage)}) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_Great left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.VarRef token:<Lit_ArithVarLike opt_pid>) right: (arith_expr.VarRef token:<Lit_ArithVarLike opt_filter>) ) right: (arith_expr.VarRef token:<Lit_ArithVarLike opt_tid>) ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) (C {(die)} {(DQ ('ERROR: use at most one of -p, -L, or filter.'))}) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_DAmp left: (arith_expr.VarRef token:<Lit_ArithVarLike opt_duration>) right: (arith_expr.VarRef token:<Lit_ArithVarLike opt_view>) ) ) (C {(die)} {(DQ ('ERROR: use either -d or -v.'))}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike opt_pid>)) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_filter) op:Equal rhs:{(1)})] ) (command.ForEach iter_name: tid iter_words: [{(/proc/) ($ VSub_DollarName '$pid') (/task/) (Lit_Star '*')}] do_arg_iter: F body: (command.DoGroup children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter) op: Equal rhs: { (DQ ($ VSub_DollarName '$filter') (' || common_pid == ') (word_part.BracedVarSub token: <VSub_Name tid> suffix_op: (suffix_op.Unary op_id: VOp1_DPound arg_word: {('*') (Lit_Slash /)} ) ) ) } ) ] ) ] ) ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name filter> suffix_op: (suffix_op.Slice begin:(arith_expr.ArithWord w:{(Lit_Digits 3)})) ) } ) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike opt_tid>)) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:opt_filter) op:Equal rhs:{(1)})] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter) op: Equal rhs: {(DQ ('common_pid == ') ($ VSub_DollarName '$tid'))} ) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_DollarName '$uprobe'))} right: {(p) (Lit_Other ':') (Lit_Other '*')} ) right: (bool_expr.Binary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_DollarName '$uprobe'))} right: {(r) (Lit_Other ':') (Lit_Other '*')} ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('ERROR: invalid uprobe definition (should start with p: or r:)'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (C {(usage)}) ] ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:utype) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name uprobe> suffix_op: (suffix_op.Unary op_id:VOp1_DPercent arg_word:{(':*')}) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:urest) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name uprobe> suffix_op: (suffix_op.Unary op_id:VOp1_Pound arg_word:{('*:')}) ) (' ') ) } ) ] ) (C {(set)} {(--)} {($ VSub_DollarName '$urest')}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number '$1')} right: {(Lit_Other '*') (Lit_Other ':') (Lit_Other '*')} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:uname) op:Equal rhs:(word.Empty))] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:probe) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child:(C {(shift)}) terminator:<Op_Semi ';'>) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:uargs) op: Equal rhs: {(DQ ($ VSub_At '$@'))} ) ] ) ] ) ] else_action: [ (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobNEqual left: {($ VSub_Number '$2')} right: {(Lit_Other '*') (Lit_Other ':') (Lit_Other '*')} ) ) (C {(die)} {(DQ ('ERROR: invalid probe. See usage (-h).'))}) ] ) (command.Sentence child: (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:uname) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:probe) op: Equal rhs: {($ VSub_Number '$2')} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child:(C {(shift)} {(2)}) terminator:<Op_Semi ';'>) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:uargs) op:Equal rhs:{(DQ ($ VSub_At '$@'))})] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:path) op: Equal rhs: {($ VSub_DollarName '$probe')} ) ] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:path) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name path> suffix_op: (suffix_op.Unary op_id:VOp1_DPercent arg_word:{(':*')}) ) } ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:addr) op: Equal rhs: {($ VSub_DollarName '$probe')} ) ] ) terminator: <Op_Semi ';'> ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:addr) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name addr> suffix_op: (suffix_op.Unary op_id:VOp1_DPound arg_word:{('*:')}) ) } ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {($ VSub_DollarName '$path')} right: {(Lit_Other '*') (/) (Lit_Other '*')} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:seg) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name path> suffix_op: (suffix_op.Unary op_id:VOp1_DPound arg_word:{('*') (Lit_Slash /)}) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:seg) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name seg> suffix_op: (suffix_op.Unary op_id:VOp1_DPercent arg_word:{('.*')}) ) } ) ] ) ] ) ] else_action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:seg) op: Equal rhs: {($ VSub_DollarName '$path')} ) ] ) (C {(set_path)} {($ VSub_DollarName '$path')}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$addr'))} right: {(0x) (Lit_Other '*')} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$uname'))} right: {(DQ )} ) ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:uname) op: Equal rhs: {(${ VSub_Name seg) (_) ($ VSub_DollarName '$addr')} ) ] ) ] ) ] ) ] else_action: [ (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_DollarName '$uname'))} right: {(DQ )} ) ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:uname) op: Equal rhs: {($ VSub_DollarName '$addr')} ) ] ) ] ) (C {(set_addr)} {($ VSub_DollarName '$path')} {($ VSub_DollarName '$seg')} {($ VSub_DollarName '$addr')} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:uprobe) op: Equal rhs: { (DQ ($ VSub_DollarName '$utype') (':') ($ VSub_DollarName '$uname') (' ') ($ VSub_DollarName '$path') (':') ($ VSub_DollarName '$addr') ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id:BoolBinary_GlobNEqual left:{(DQ ($ VSub_DollarName '$uargs'))} right:{(DQ )}) ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:uprobe) op: Equal rhs: {(DQ ($ VSub_DollarName '$uprobe') (' ') ($ VSub_DollarName '$uargs'))} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike debug>)) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('uname: ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ($ VSub_DollarName '$uname') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (', uprobe: ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ($ VSub_DollarName '$uprobe') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ) } ) ] ) ] ) (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)') ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Unary op_id: Arith_Bang child: (arith_expr.VarRef token:<Lit_ArithVarLike opt_view>) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token:<Lit_ArithVarLike opt_duration>) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ('Tracing uprobe ') ($ VSub_DollarName '$uname') (' for ') ($ VSub_DollarName '$duration') (' seconds (buffered)...') ) } ) ] ) ] else_action: [ (C {(echo)} { (DQ ('Tracing uprobe ') ($ VSub_DollarName '$uname') (' (') ($ VSub_DollarName '$uprobe') ('). Ctrl-C to end.') ) } ) ] ) ] ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Unary op_id:BoolUnary_e child:{($ VSub_DollarName '$flock')}) ) (C {(die)} { (DQ ('ERROR: ftrace may be in use by PID ') (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(cat)} {($ VSub_DollarName '$flock')})] ) ) (' ') ($ VSub_DollarName '$flock') ) } ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple 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 pairs: [(assign_pair lhs:(lhs_expr.LhsName name:wroteflock) op:Equal rhs:{(1)})] ) (command.Simple 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.Simple words: [{(echo)} {(DQ ($ VSub_DollarName '$uprobe'))}] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(uprobe_events)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('ERROR: adding uprobe ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ($ VSub_DollarName '$uprobe') (word_part.EscapedLiteral 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.VarRef token:<Lit_ArithVarLike dmesg>)) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple 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 ) ] ) ] ) (C {(edie)} {(DQ (Exiting.))}) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike opt_view>)) terminator: <Op_Semi ';'> ) ] action: [(C {(cat)} {(events/uprobes/) ($ VSub_DollarName '$uname') (/format)}) (C {(edie)} {(DQ )})] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike opt_filter>)) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(echo)} {(DQ ($ VSub_DollarName '$filter'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(events/uprobes/) ($ VSub_DollarName '$uname') (/filter)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [(C {(edie)} {(DQ ('ERROR: setting filter or -p. Exiting.'))})] ) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike opt_stack>)) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(options/userstacktrace)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [(C {(edie)} {(DQ ('ERROR: enabling stack traces (-s). Exiting'))})] ) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(events/uprobes/) ($ VSub_DollarName '$uname') (/enable)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(edie)} {(DQ ('ERROR: enabling uprobe ') ($ VSub_DollarName '$uname') ('. Exiting.'))}) ] ) ] ) (C {(warn)} {(DQ ('echo > trace'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike opt_duration>)) terminator: <Op_Semi ';'> ) ] action: [ (C {(sleep)} {($ VSub_DollarName '$duration')}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token:<Lit_ArithVarLike opt_headers>) ) terminator: <Op_Semi ';'> ) ] action: [(C {(cat)} {(trace)})] ) ] else_action: [(C {(grep)} {(-v)} {(SQ <'^#'>)} {(trace)})] ) ] ) ] else_action: [ (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child:(arith_expr.VarRef token:<Lit_ArithVarLike opt_headers>)) (C {(cat)} {(trace)}) ] ) (C {(cat)} {(trace_pipe)}) ] ) (C {(end)}) ] )