(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tracing) op: assign_op.Equal rhs: {(/sys/kernel/debug/tracing)} spids: [187] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:flock) op: assign_op.Equal rhs: {(/var/tmp/.ftrace-lock)} spids: [190] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:192) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:wroteflock) op: assign_op.Equal rhs: {(0)} spids: [194] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_duration) op: assign_op.Equal rhs: {(0)} spids: [197] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:199) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:duration) op: assign_op.Equal rhs: (word.Empty) spids: [201] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:202) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_pid) op: assign_op.Equal rhs: {(0)} spids: [204] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:206) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pid) op: assign_op.Equal rhs: (word.Empty) spids: [208] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:209) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_tid) op: assign_op.Equal rhs: {(0)} spids: [211] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:213) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tid) op: assign_op.Equal rhs: (word.Empty) spids: [215] ) ] ) ] ) (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: [217] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:219) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filter) op: assign_op.Equal rhs: (word.Empty) spids: [221] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:222) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_view) op: assign_op.Equal rhs: {(0)} spids: [224] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:226) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_headers) op: assign_op.Equal rhs: {(0)} spids: [228] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:230) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_stack) op: assign_op.Equal rhs: {(0)} spids: [232] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:234) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dmesg) op: assign_op.Equal rhs: {(2)} spids: [236] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:debug) op: assign_op.Equal rhs: {(0)} spids: [239] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:241) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_force) op: assign_op.Equal rhs: {(0)} spids: [243] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:245) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_list) op: assign_op.Equal rhs: {(0)} spids: [247] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:249) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:target) op: assign_op.Equal rhs: (word.Empty) spids: [251] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PATH) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$PATH') (Id.Lit_Other ':') (/usr/bin) (Id.Lit_Other ':') (/sbin)} spids: [253] ) ] ) (C {(trap)} {(SQ (Token id:Id.Lit_Chars val:':' span_id:266))} {(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:292) fd: -1 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 ') (Id.Right_DoubleQuote '"') (bash) (Id.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: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:323) ) ("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: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:335) ) ("retval' 'file == 0'\n") ('\n') ('See the man page and example file for more info.\n') ] ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:295) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:342) ) ] ) ) (command.ShFunction name: warn body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [(C {(eval)} {(DQ ($ Id.VSub_At '$@'))})] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:363) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('WARNING: command failed ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:375) ) ($ Id.VSub_At '$@') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:377) ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:370) fd: -1 arg_word: {(2)} ) ] ) ] spids: [354 365] ) ] ) ] ) ) (command.ShFunction name: end body: (command.BraceGroup children: [ (command.Simple words: [{(echo)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:399) fd: 2 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [{(echo)} {(DQ ('Ending tracing...'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:409) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(cd)} {($ Id.VSub_DollarName '$tracing')}) (C {(warn)} {(DQ ('echo 0 > events/uprobes/') ($ Id.VSub_DollarName '$uname') (/enable))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_filter span_id:431) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:435) ) ] action: [ (C {(warn)} {(DQ ('echo 0 > events/uprobes/') ($ Id.VSub_DollarName '$uname') (/filter))} ) ] spids: [427 437] ) ] ) (C {(warn)} {(DQ ('echo -:') ($ Id.VSub_DollarName '$uname') (' >> uprobe_events'))}) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_stack span_id:463) ) ) (C {(warn)} {(DQ ('echo 0 > options/userstacktrace'))}) ] ) (C {(warn)} {(DQ ('echo > trace'))}) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:wroteflock span_id:486) ) ) (C {(warn)} {(DQ ('rm ') ($ Id.VSub_DollarName '$flock'))}) ] ) ] ) ) (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:512) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:520) arg_word: {(1)} ) ] ) ) (command.ShFunction name: edie body: (command.BraceGroup children: [ (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_At '$@'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:540) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [{(exec)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:550) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:553) fd: 2 arg_word: {(1)} ) ] ) (C {(end)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:560) arg_word: {(1)} ) ] ) ) (command.ShFunction name: set_path body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [574] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:path) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:580) command_list: (command.CommandList children: [(C {(which)} {($ Id.VSub_DollarName '$name')})] ) ) } spids: [579] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$path'))} right: {(DQ )} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:601) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:path) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:607) command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [{(ldconfig)} {(-v)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:612) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(awk)} {(-v)} {(Id.Lit_VarLike 'lib=') ($ Id.VSub_DollarName '$name')} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:625) (Token id: Id.Lit_Chars val: '\t\t $1 ~ /:/ { sub(/:/, "", $1); path = $1 }\n' span_id: 626 ) (Token id:Id.Lit_Chars val:'\t\t { sub(/\\..*/, "", $1); }\n' span_id:627) (Token id: Id.Lit_Chars val: '\t\t $1 == lib { print path "/" $3 }' span_id: 628 ) ) } ) ] negated: F ) ] ) ) } spids: [606] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$path'))} right: {(DQ )} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:647) ) ] action: [ (C {(die)} { (DQ ('ERROR: segment ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:656) ) ($ Id.VSub_DollarName '$name') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:658) ) (' ambiguous.') ) } {(DQ ('Program or library? Try a full path.'))} ) ] spids: [633 649] ) ] ) ] spids: [587 603] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.Unary op_id: Id.BoolUnary_x child: {($ Id.VSub_DollarName '$path')} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:687) ) ] action: [ (C {(die)} { (DQ ('ERROR: resolved ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:696) ) ($ Id.VSub_DollarName '$name') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:698) ) (' to ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:700)) ($ Id.VSub_DollarName '$path') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:702)) (', but file missing') ) } ) ] spids: [676 689] ) ] ) ] ) ) (command.ShFunction name: set_addr body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:path) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [719] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [723] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sym) op: assign_op.Equal rhs: {($ Id.VSub_Number '$3')} spids: [727] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$path'))} right: {(DQ )} ) ) (C {(die)} {(DQ ('ERROR: missing symbol path.'))}) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$sym'))} right: {(DQ )} ) ) (C {(die)} {(DQ ('ERROR: missing symbol for ') ($ Id.VSub_DollarName '$path'))}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:addr) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:779) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(objdump)} {(-tT)} {($ Id.VSub_DollarName '$path')}) (C {(awk)} {(-v)} {(Id.Lit_VarLike 'sym=') ($ Id.VSub_DollarName '$sym')} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:796) (Token id: Id.Lit_Chars val: '\t $NF == sym && $4 == ".text" { print $1; exit }' span_id: 797 ) ) } ) ] negated: F ) ] ) ) } spids: [778] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$addr'))} right: {(DQ )} ) ) (C {(die)} { (DQ ('ERROR: missing symbol ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:821) ) ($ Id.VSub_DollarName '$sym') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:823) ) (' in ') ($ Id.VSub_DollarName '$path') ) } ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: (arith_expr.ArithWord w: {(Id.Lit_Digits 0) (Id.Lit_ArithVarLike x) ($ Id.VSub_DollarName '$addr')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) (C {(die)} { (DQ ('ERROR: failed resolving ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:848) ) ($ Id.VSub_DollarName '$sym') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:850) ) (' in ') ($ Id.VSub_DollarName '$path') (.) ) } {(DQ ('Maybe it exists in a different target (eg, library)?'))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:addr) op: assign_op.Equal rhs: {(0x) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:865) command_list: (command.CommandList children: [ (C {(printf)} {(DQ ('%x'))} {(0x) ($ Id.VSub_DollarName '$addr')}) ] ) ) } spids: [863] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:type) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:884) command_list: (command.CommandList children: [(C {(file)} {($ Id.VSub_DollarName '$path')})] ) ) } spids: [883] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.VSub_DollarName '$type'))} right: {(Id.Lit_Other '*') (shared) (Id.Lit_Other '?') (object) (Id.Lit_Other '*') } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:908) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:base) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:922) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(objdump)} {(-x)} {($ Id.VSub_DollarName '$path')}) (C {(awk)} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:934) (Token id: Id.Lit_Chars val: '\t\t $1 == "LOAD" && $3 ~ /^[0x]*$/ { print $5 }' span_id: 935 ) ) } ) ] negated: F ) ] ) ) } spids: [921] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.VSub_DollarName '$base'))} right: {(0x) (Id.Lit_Other '*')} ) ) (C {(die)} {(DQ ('ERROR: finding base load addr'))} {(DQ ('for ') ($ Id.VSub_DollarName '$path') (.))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:addr) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:addr span_id:972) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:base span_id:976) ) ) ) } spids: [969] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:addr span_id:984) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) (C {(die)} {(DQ ('ERROR: transposed address for ') ($ Id.VSub_DollarName '$sym'))} {(DQ ('became negative: ') ($ Id.VSub_DollarName '$addr'))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:addr) op: assign_op.Equal rhs: {(0x) (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1011) command_list: (command.CommandList children: [ (C {(printf)} {(DQ ('%x'))} {($ Id.VSub_DollarName '$addr')}) ] ) ) } spids: [1009] ) ] ) ] spids: [891 910] ) ] ) ] ) ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:1031) cond: [ (C {(getopts)} {(Fd) (Id.Lit_Other ':') (hHl) (Id.Lit_Other ':') (p) (Id.Lit_Other ':') (L) (Id.Lit_Other ':') (sv) } {(opt)} ) ] body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_DollarName '$opt')} arms: [ (case_arm pat_list: [{(F)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_force) op: assign_op.Equal rhs: {(1)} spids: [1060] ) ] ) ] spids: [1057 1058 1063 -1] ) (case_arm pat_list: [{(d)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_duration) op: assign_op.Equal rhs: {(1)} spids: [1069] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1071) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:duration) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$OPTARG')} spids: [1073] ) ] ) ] spids: [1066 1067 1076 -1] ) (case_arm pat_list: [{(p)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_pid) op: assign_op.Equal rhs: {(1)} spids: [1082] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1084) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pid) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$OPTARG')} spids: [1086] ) ] ) ] spids: [1079 1080 1089 -1] ) (case_arm pat_list: [{(L)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_tid) op: assign_op.Equal rhs: {(1)} spids: [1095] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1097) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tid) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$OPTARG')} spids: [1099] ) ] ) ] spids: [1092 1093 1102 -1] ) (case_arm pat_list: [{(l)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_list) op: assign_op.Equal rhs: {(1)} spids: [1108] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1110) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:target) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$OPTARG')} spids: [1112] ) ] ) ] spids: [1105 1106 1115 -1] ) (case_arm pat_list: [{(H)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_headers) op: assign_op.Equal rhs: {(1)} spids: [1121] ) ] ) ] spids: [1118 1119 1124 -1] ) (case_arm pat_list: [{(s)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_stack) op: assign_op.Equal rhs: {(1)} spids: [1130] ) ] ) ] spids: [1127 1128 1133 -1] ) (case_arm pat_list: [{(v)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_view) op: assign_op.Equal rhs: {(1)} spids: [1139] ) ] ) ] spids: [1136 1137 1142 -1] ) (case_arm pat_list: [{(h)} {(Id.Lit_QMark '?')}] action: [(C {(usage)})] spids: [1145 1148 1152 -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.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uprobe) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1172] ) ] ) (C {(shift)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child:(arith_expr.ArithWord w:{($ Id.VSub_Pound '$#')})) terminator: (Token id:Id.Op_Semi val:';' span_id:1185) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_filter) op: assign_op.Equal rhs: {(1)} spids: [1190] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filter) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1194] ) ] ) ] spids: [1177 1187] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$opt_list'))} right: {(1)} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.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: (Token id:Id.Lit_ArithVarLike val:opt_list span_id:1238) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1242) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.VSub_DollarName '$target'))} right: {(Id.Lit_Other '*') (/) (Id.Lit_Other '*')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1262) ) ] action: [ (C {(set_path)} {($ Id.VSub_DollarName '$target')}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:target) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$path')} spids: [1272] ) ] ) ] spids: [1247 1264] ) ] ) (command.Pipeline children: [ (C {(objdump)} {(-tT)} {($ Id.VSub_DollarName '$target')}) (C {(awk)} {(SQ (Token id:Id.Lit_Chars val:'$4 == ".text" { print $NF }' span_id:1290))}) (C {(sort)}) (C {(uniq)}) ] negated: F ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1302) ) ] spids: [1234 1244] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ver) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1311) command_list: (command.CommandList children:[(C {(uname)} {(-r)})]) ) } spids: [1310] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:maj) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:ver span_id:1319) suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPercent arg_word:{('.*')}) ) } spids: [1317] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.Binary op_id: Id.Arith_DEqual left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_force span_id:1328) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) right: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$maj')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 4)}) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1344) ) ] action: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:1351) fd: -1 here_begin: {(END)} here_end_span_id: 1366 stdin_parts: [ ('ERROR: Kernel version >= 4.0 preferred (you have ') ($ Id.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: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1354) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1368) ) ] spids: [1324 1346] ) ] ) (command.ForEach iter_name: cmd iter_words: [{(file)} {(objdump)} {(ldconfig)} {(awk)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Simple words: [{(which)} {($ Id.VSub_DollarName '$cmd')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1398) fd: -1 arg_word: {(/dev/null)} ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (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)}) ) ) (C {(die)} { (DQ ('ERROR: missing ') ($ Id.VSub_DollarName '$cmd') (' in ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:1422) ) ('PATH. ') ($ Id.VSub_Number '$0') (' needs') ) } {(DQ ('to use this command. Exiting.'))} ) ] ) ] ) ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$uprobe'))} right: {(DQ )} ) ) (C {(usage)}) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_pid span_id:1459) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_filter span_id:1463) ) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_tid span_id:1467) ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) (C {(die)} {(DQ ('ERROR: use at most one of -p, -L, or filter.'))}) ] ) (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_duration span_id:1488) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_view span_id:1492) ) ) ) (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: (Token id:Id.Lit_ArithVarLike val:opt_pid span_id:1509) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1513) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_filter) op: assign_op.Equal rhs: {(1)} spids: [1522] ) ] ) (command.ForEach iter_name: tid iter_words: [{(/proc/) ($ Id.VSub_DollarName '$pid') (/task/) (Id.Lit_Star '*')}] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filter) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$filter') (' || common_pid == ') (braced_var_sub token: (Token id:Id.VSub_Name val:tid span_id:1550) suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {('*') (Id.Lit_Slash /)} ) ) ) } spids: [1545] ) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filter) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:filter span_id:1563) suffix_op: (suffix_op.Slice begin:(arith_expr.ArithWord w:{(Id.Lit_Digits 3)})) ) } spids: [1561] ) ] ) ] spids: [1505 1515] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_tid span_id:1577) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1581) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opt_filter) op: assign_op.Equal rhs: {(1)} spids: [1586] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filter) op: assign_op.Equal rhs: {(DQ ('common_pid == ') ($ Id.VSub_DollarName '$tid'))} spids: [1590] ) ] ) ] spids: [1573 1583] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.VSub_DollarName '$uprobe'))} right: {(p) (Id.Lit_Other ':') (Id.Lit_Other '*')} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.VSub_DollarName '$uprobe'))} right: {(r) (Id.Lit_Other ':') (Id.Lit_Other '*')} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1625) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('ERROR: invalid uprobe definition (should start with p: or r:)'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1632) fd: -1 arg_word: {(2)} ) ] ) (C {(usage)}) ] spids: [1598 1627] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:utype) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:uprobe span_id:1697) suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPercent arg_word:{(':*')}) ) } spids: [1695] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:urest) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:uprobe span_id:1705) suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{('*:')}) ) (' ') ) } spids: [1702] ) ] ) (C {(Id.KW_Set set)} {(--)} {($ Id.VSub_DollarName '$urest')}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Number '$1')} right: {(Id.Lit_Other '*') (Id.Lit_Other ':') (Id.Lit_Other '*')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1731) ) ] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uname) op: assign_op.Equal rhs: (word.Empty) spids: [1736] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1737) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:probe) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1739] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1741) ) (command.Sentence child: (C {(shift)}) terminator: (Token id:Id.Op_Semi val:';' span_id:1744) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uargs) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_At '$@'))} spids: [1746] ) ] ) ] spids: [1718 1733] ) ] else_action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_Number '$2')} right: {(Id.Lit_Other '*') (Id.Lit_Other ':') (Id.Lit_Other '*')} ) ) (C {(die)} {(DQ ('ERROR: invalid probe. See usage (-h).'))}) ] ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uname) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1775] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1777) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:probe) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [1779] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1781) ) (command.Sentence child: (C {(shift)} {(2)}) terminator: (Token id:Id.Op_Semi val:';' span_id:1786) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uargs) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_At '$@'))} spids: [1788] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:path) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$probe')} spids: [1795] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1797) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:path) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:path span_id:1801) suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPercent arg_word:{(':*')}) ) } spids: [1799] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:addr) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$probe')} spids: [1806] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1808) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:addr) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:addr span_id:1812) suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPound arg_word:{('*:')}) ) } spids: [1810] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$path')} right: {(Id.Lit_Other '*') (/) (Id.Lit_Other '*')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1834) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:seg) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:path span_id:1841) suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {('*') (Id.Lit_Slash /)} ) ) } spids: [1839] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:seg) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:seg span_id:1850) suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPercent arg_word:{('.*')}) ) } spids: [1848] ) ] ) ] spids: [1821 1836] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:seg) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$path')} spids: [1858] ) ] ) (C {(set_path)} {($ Id.VSub_DollarName '$path')}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$addr'))} right: {(0x) (Id.Lit_Other '*')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1890) ) ] action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$uname'))} right: {(DQ )} ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uname) op: assign_op.Equal rhs: {(${ Id.VSub_Name seg) (_) ($ Id.VSub_DollarName '$addr')} spids: [1914] ) ] ) ] ) ] spids: [1876 1892] ) ] else_action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$uname'))} right: {(DQ )} ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uname) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$addr')} spids: [1939] ) ] ) ] ) (C {(set_addr)} {($ Id.VSub_DollarName '$path')} {($ Id.VSub_DollarName '$seg')} {($ Id.VSub_DollarName '$addr')} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uprobe) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$utype') (':') ($ Id.VSub_DollarName '$uname') (' ') ($ Id.VSub_DollarName '$path') (':') ($ Id.VSub_DollarName '$addr') ) } spids: [1957] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ ($ Id.VSub_DollarName '$uargs'))} right: {(DQ )} ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:uprobe) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$uprobe') (' ') ($ Id.VSub_DollarName '$uargs'))} spids: [1983] ) ] ) ] ) (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:1995) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1999) ) ] action: [ (C {(echo)} { (DQ ('uname: ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:2008) ) ($ Id.VSub_DollarName '$uname') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:2010) ) (', uprobe: ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:2012)) ($ Id.VSub_DollarName '$uprobe') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:2014)) ) } ) ] spids: [1991 2001] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(cd)} {($ Id.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: Id.Arith_Bang child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_view span_id:2042) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2046) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_duration span_id:2055) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2059) ) ] action: [ (C {(echo)} { (DQ ('Tracing uprobe ') ($ Id.VSub_DollarName '$uname') (' for ') ($ Id.VSub_DollarName '$duration') (' seconds (buffered)...') ) } ) ] spids: [2051 2061] ) ] else_action: [ (C {(echo)} { (DQ ('Tracing uprobe ') ($ Id.VSub_DollarName '$uname') (' (') ($ Id.VSub_DollarName '$uprobe') ('). Ctrl-C to end.') ) } ) ] ) ] spids: [2037 2048] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_e child:{($ Id.VSub_DollarName '$flock')}) ) (C {(die)} { (DQ ('ERROR: ftrace may be in use by PID ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2111) command_list: (command.CommandList children: [(C {(cat)} {($ Id.VSub_DollarName '$flock')})] ) ) (' ') ($ Id.VSub_DollarName '$flock') ) } ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{(echo)} {($ Id.VSub_Dollar '$$')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:2124) fd: -1 arg_word: {($ Id.VSub_DollarName '$flock')} ) ] ) (C {(die)} {(DQ ('ERROR: unable to write ') ($ Id.VSub_DollarName '$flock') (.))}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:wroteflock) op: assign_op.Equal rhs: {(1)} spids: [2138] ) ] ) (command.Simple words: [{(echo)} {(nop)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:2149) fd: -1 arg_word: {(current_tracer)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_DollarName '$uprobe'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:2163) fd: -1 arg_word: {(uprobe_events)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:2166) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('ERROR: adding uprobe ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:2178) ) ($ Id.VSub_DollarName '$uprobe') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:2180) ) (.) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:2173) fd: -1 arg_word: {(2)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:dmesg span_id:2189) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2193) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('Last ') ($ Id.VSub_DollarName '$dmesg') (' dmesg entries (might contain reason):') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:2200) fd: -1 arg_word: {(2)} ) ] ) (command.Pipeline children: [ (C {(dmesg)}) (C {(tail)} {(-) ($ Id.VSub_DollarName '$dmesg')}) (C {(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/^/ /' span_id:2224))}) ] negated: F ) ] spids: [2185 2195] ) ] ) (C {(edie)} {(DQ (Exiting.))}) ] spids: [2153 2168] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_view span_id:2243) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2247) ) ] action: [ (C {(cat)} {(events/uprobes/) ($ Id.VSub_DollarName '$uname') (/format)}) (C {(edie)} {(DQ )}) ] spids: [2239 2249] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_filter span_id:2270) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2274) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(echo)} {(DQ ($ Id.VSub_DollarName '$filter'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:2289) fd: -1 arg_word: {(events/uprobes/) ($ Id.VSub_DollarName '$uname') (/filter)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:2294) ) ] action: [(C {(edie)} {(DQ ('ERROR: setting filter or -p. Exiting.'))})] spids: [2279 2296] ) ] ) ] spids: [2266 2276] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_stack span_id:2314) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2318) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:2331) fd: -1 arg_word: {(options/userstacktrace)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:2334) ) ] action: [(C {(edie)} {(DQ ('ERROR: enabling stack traces (-s). Exiting'))})] spids: [2323 2336] ) ] ) ] spids: [2310 2320] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(echo)} {(1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:2358) fd: -1 arg_word: {(events/uprobes/) ($ Id.VSub_DollarName '$uname') (/enable)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:2363) ) ] action: [ (C {(edie)} {(DQ ('ERROR: enabling uprobe ') ($ Id.VSub_DollarName '$uname') ('. Exiting.'))} ) ] spids: [2350 2365] ) ] ) (C {(warn)} {(DQ ('echo > trace'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_duration span_id:2392) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2396) ) ] action: [ (C {(sleep)} {($ Id.VSub_DollarName '$duration')}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_headers span_id:2410) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2414) ) ] action: [(C {(cat)} {(trace)})] spids: [2406 2416] ) ] else_action: [ (C {(grep)} {(-v)} {(SQ (Token id:Id.Lit_Chars val:'^#' span_id:2432))} {(trace)}) ] ) ] spids: [2388 2398] ) ] else_action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:opt_headers span_id:2449) ) ) (C {(cat)} {(trace)}) ] ) (C {(cat)} {(trace_pipe)}) ] ) (C {(end)}) ] )