(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tracing) op: Equal rhs: {(/sys/kernel/debug/tracing)} spids: [187] ) ] spids: [187] ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:flock) op: Equal rhs: {(/var/tmp/.ftrace-lock)} spids: [190] ) ] spids: [190] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:wroteflock) op:Equal rhs:{(0)} spids:[194])] spids: [194] ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_duration) op:Equal rhs:{(0)} spids:[197])] spids: [197] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:duration) op:Equal rhs:{(SQ )} spids:[201])] spids: [201] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_pid) op:Equal rhs:{(0)} spids:[204])] spids: [204] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pid) op:Equal rhs:{(SQ )} spids:[208])] spids: [208] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_tid) op:Equal rhs:{(0)} spids:[211])] spids: [211] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:tid) op:Equal rhs:{(SQ )} spids:[215])] spids: [215] ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_filter) op:Equal rhs:{(0)} spids:[217])] spids: [217] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:filter) op:Equal rhs:{(SQ )} spids:[221])] spids: [221] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_view) op:Equal rhs:{(0)} spids:[224])] spids: [224] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_headers) op:Equal rhs:{(0)} spids:[228])] spids: [228] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_stack) op:Equal rhs:{(0)} spids:[232])] spids: [232] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:dmesg) op:Equal rhs:{(2)} spids:[236])] spids: [236] ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:debug) op:Equal rhs:{(0)} spids:[239])] spids: [239] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_force) op:Equal rhs:{(0)} spids:[243])] spids: [243] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_list) op:Equal rhs:{(0)} spids:[247])] spids: [247] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:target) op:Equal rhs:{(SQ )} spids:[251])] spids: [251] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PATH) op: Equal rhs: {($ VSub_Name "$PATH") (Lit_Other ":") (/usr/bin) (Lit_Other ":") (/sbin)} spids: [253] ) ] spids: [253] ) (C {(trap)} {(SQ <":">)} {(INT)} {(QUIT)} {(TERM)} {(PIPE)} {(HUP)}) (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLessDash fd: -1 body: { (DQ ("USAGE: 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(") (EscapedLiteralPart 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=") (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("retval' 'file == 0'\n") ("\n") ("See the man page and example file for more info.\n") ) } do_expansion: True here_end: END was_filled: True spids: [292] ) (Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[295]) ] ) (C {(exit)}) ] spids: [287] ) spids: [283 286] ) (FuncDef name: warn body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children:[(C {(eval)} {(DQ ($ VSub_At "$@"))})] negated:True) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("WARNING: command failed ") (EscapedLiteralPart token: <Lit_EscapedChar "\\\""> ) ($ VSub_At "$@") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[368])] ) ] spids: [-1 363] ) ] spids: [-1 379] ) ] spids: [349] ) spids: [345 348] ) (FuncDef name: end body: (BraceGroup children: [ (SimpleCommand words: [{(echo)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[397])] ) (SimpleCommand words: [{(echo)} {(DQ ("Ending tracing..."))}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[407])] ) (C {(cd)} {($ VSub_Name "$tracing")}) (C {(warn)} {(DQ ("echo 0 > events/uprobes/") ($ VSub_Name "$uname") (/enable))}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:opt_filter)) terminator: <Op_Semi ";"> ) ] action: [ (C {(warn)} {(DQ ("echo 0 > events/uprobes/") ($ VSub_Name "$uname") (/filter))}) ] spids: [-1 435] ) ] spids: [-1 447] ) (C {(warn)} {(DQ ("echo -:") ($ VSub_Name "$uname") (" >> uprobe_events"))}) (AndOr children: [ (DParen child:(ArithVarRef name:opt_stack)) (C {(warn)} {(DQ ("echo 0 > options/userstacktrace"))}) ] op_id: Op_DAmp ) (C {(warn)} {(DQ ("echo > trace"))}) (AndOr children: [ (DParen child:(ArithVarRef name:wroteflock)) (C {(warn)} {(DQ ("rm ") ($ VSub_Name "$flock"))}) ] op_id: Op_DAmp ) ] spids: [388] ) spids: [384 387] ) (FuncDef name: die body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_At "$@"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[510])] ) (C {(exit)} {(1)}) ] spids: [505] ) spids: [501 504] ) (FuncDef name: edie body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_At "$@"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[538])] ) (SimpleCommand words: [{(exec)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[548]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[551]) ] ) (C {(end)}) (C {(exit)} {(1)}) ] spids: [529] ) spids: [525 528] ) (FuncDef name: set_path body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {($ VSub_Number "$1")} spids: [572] ) ] spids: [572] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(which)} {($ VSub_Name "$name")})]) left_token: <Left_CommandSub "$("> spids: [578 582] ) } spids: [577] ) ] spids: [577] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name "$path"))} right: {(DQ )} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [{(ldconfig)} {(-v)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [610] ) ] ) (C {(awk)} {(-v)} {(Lit_VarLike "lib=") ($ VSub_Name "$name")} { (SQ <"\n"> < "\t\t $1 ~ /:/ { sub(/:/, \"\", $1); path = $1 }\n" > <"\t\t { sub(/\\..*/, \"\", $1); }\n"> <"\t\t $1 == lib { print path \"/\" $3 }"> ) } ) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [605 628] ) } spids: [604] ) ] spids: [604] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name "$path"))} right: {(DQ )} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(die)} { (DQ ("ERROR: segment ") (EscapedLiteralPart token: <Lit_EscapedChar "\\\""> ) ($ VSub_Name "$name") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" ambiguous.") ) } {(DQ ("Program or library? Try a full path."))} ) ] spids: [-1 647] ) ] spids: [-1 667] ) ] spids: [-1 601] ) ] spids: [-1 670] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalNot child: (BoolUnary op_id:BoolUnary_x child:{($ VSub_Name "$path")}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(die)} { (DQ ("ERROR: resolved ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$name") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" to ") (EscapedLiteralPart token: <Lit_EscapedChar "\\\""> ) ($ VSub_Name "$path") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (", but file missing") ) } ) ] spids: [-1 687] ) ] spids: [-1 705] ) ] spids: [569] ) spids: [565 568] ) (FuncDef name: set_addr body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: {($ VSub_Number "$1")} spids: [717] ) ] spids: [717] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {($ VSub_Number "$2")} spids: [721] ) ] spids: [721] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sym) op: Equal rhs: {($ VSub_Number "$3")} spids: [725] ) ] spids: [725] ) (AndOr children: [ (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{(DQ ($ VSub_Name "$path"))} right:{(DQ )}) ) (C {(die)} {(DQ ("ERROR: missing symbol path."))}) ] op_id: Op_DAmp ) (AndOr children: [ (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{(DQ ($ VSub_Name "$sym"))} right:{(DQ )}) ) (C {(die)} {(DQ ("ERROR: missing symbol for ") ($ VSub_Name "$path"))}) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:addr) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(objdump)} {(-tT)} {($ VSub_Name "$path")}) (C {(awk)} {(-v)} {(Lit_VarLike "sym=") ($ VSub_Name "$sym")} { (SQ <"\n"> <"\t $NF == sym && $4 == \".text\" { print $1; exit }"> ) } ) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [777 797] ) } spids: [776] ) ] spids: [776] ) (AndOr children: [ (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{(DQ ($ VSub_Name "$addr"))} right:{(DQ )}) ) (C {(die)} { (DQ ("ERROR: missing symbol ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$sym") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" in ") ($ VSub_Name "$path") ) } ) ] op_id: Op_DAmp ) (AndOr children: [ (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{(Lit_Digits 0) (Lit_ArithVarLike x) ($ VSub_Name "$addr")}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) (C {(die)} { (DQ ("ERROR: failed resolving ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$sym") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" in ") ($ VSub_Name "$path") (.) ) } {(DQ ("Maybe it exists in a different target (eg, library)?"))} ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:addr) op: Equal rhs: {(0x) (CommandSubPart command_list: (CommandList children: [(C {(printf)} {(DQ ("%x"))} {(0x) ($ VSub_Name "$addr")})] ) left_token: <Left_CommandSub "$("> spids: [863 874] ) } spids: [861] ) ] spids: [861] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:type) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(file)} {($ VSub_Name "$path")})]) left_token: <Left_CommandSub "$("> spids: [882 886] ) } spids: [881] ) ] spids: [881] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$type"))} right: {(Lit_Other "*") (shared) (Lit_Other "?") (object) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(objdump)} {(-x)} {($ VSub_Name "$path")}) (C {(awk)} { (SQ <"\n"> < "\t\t $1 == \"LOAD\" && $3 ~ /^[0x]*$/ { print $5 }" > ) } ) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [920 935] ) } spids: [919] ) ] spids: [919] ) (AndOr children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$base"))} right: {(0x) (Lit_Other "*")} ) ) (C {(die)} {(DQ ("ERROR: finding base load addr"))} {(DQ ("for ") ($ VSub_Name "$path") (.))} ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:addr) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:addr) right: (ArithVarRef name:base) ) spids: [968 977] ) } spids: [967] ) ] spids: [967] ) (AndOr children: [ (DParen child: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:addr) right: (ArithWord w:{(Lit_Digits 0)}) ) ) (C {(die)} {(DQ ("ERROR: transposed address for ") ($ VSub_Name "$sym"))} {(DQ ("became negative: ") ($ VSub_Name "$addr"))} ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:addr) op: Equal rhs: {(0x) (CommandSubPart command_list: (CommandList children: [(C {(printf)} {(DQ ("%x"))} {($ VSub_Name "$addr")})] ) left_token: <Left_CommandSub "$("> spids: [1009 1018] ) } spids: [1007] ) ] spids: [1007] ) ] spids: [-1 908] ) ] spids: [-1 1021] ) ] spids: [714] ) spids: [710 713] ) (While cond: [ (C {(getopts)} {(Fd) (Lit_Other ":") (hHl) (Lit_Other ":") (p) (Lit_Other ":") (L) (Lit_Other ":") (sv)} {(opt)} ) ] body: (DoGroup children: [ (Case to_match: {($ VSub_Name "$opt")} arms: [ (case_arm pat_list: [{(F)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_force) op: Equal rhs: {(1)} spids: [1058] ) ] spids: [1058] ) ] spids: [1055 1056 1061 -1] ) (case_arm pat_list: [{(d)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_duration) op: Equal rhs: {(1)} spids: [1067] ) ] spids: [1067] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:duration) op: Equal rhs: {($ VSub_Name "$OPTARG")} spids: [1071] ) ] spids: [1071] ) ] spids: [1064 1065 1074 -1] ) (case_arm pat_list: [{(p)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_pid) op: Equal rhs: {(1)} spids: [1080] ) ] spids: [1080] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pid) op: Equal rhs: {($ VSub_Name "$OPTARG")} spids: [1084] ) ] spids: [1084] ) ] spids: [1077 1078 1087 -1] ) (case_arm pat_list: [{(L)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_tid) op: Equal rhs: {(1)} spids: [1093] ) ] spids: [1093] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tid) op: Equal rhs: {($ VSub_Name "$OPTARG")} spids: [1097] ) ] spids: [1097] ) ] spids: [1090 1091 1100 -1] ) (case_arm pat_list: [{(l)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_list) op: Equal rhs: {(1)} spids: [1106] ) ] spids: [1106] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:target) op: Equal rhs: {($ VSub_Name "$OPTARG")} spids: [1110] ) ] spids: [1110] ) ] spids: [1103 1104 1113 -1] ) (case_arm pat_list: [{(H)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_headers) op: Equal rhs: {(1)} spids: [1119] ) ] spids: [1119] ) ] spids: [1116 1117 1122 -1] ) (case_arm pat_list: [{(s)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_stack) op: Equal rhs: {(1)} spids: [1128] ) ] spids: [1128] ) ] spids: [1125 1126 1131 -1] ) (case_arm pat_list: [{(v)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:opt_view) op: Equal rhs: {(1)} spids: [1137] ) ] spids: [1137] ) ] spids: [1134 1135 1140 -1] ) (case_arm pat_list: [{(h)} {(Lit_Other "?")}] action: [(C {(usage)})] spids: [1143 1146 1150 -1] ) ] spids: [1048 1052 1153] ) ] spids: [1045 1155] ) ) (C {(shift)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name "$OPTIND")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [1159 1168] ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uprobe) op: Equal rhs: {($ VSub_Number "$1")} spids: [1170] ) ] spids: [1170] ) (C {(shift)}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithWord w:{($ VSub_Pound "$#")})) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_filter) op:Equal rhs:{(1)} spids:[1188])] spids: [1188] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:filter) op: Equal rhs: {($ VSub_Number "$1")} spids: [1192] ) ] spids: [1192] ) ] spids: [-1 1185] ) ] spids: [-1 1195] ) (AndOr children: [ (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name "$opt_list"))} right: {(1)} ) right: (BoolBinary op_id:BoolBinary_GlobNEqual left:{(DQ ($ VSub_Name "$uprobe"))} right:{(DQ )}) ) ) (C {(die)} {(DQ ("ERROR: -l takes a target only"))}) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [(Sentence child:(DParen child:(ArithVarRef name:opt_list)) terminator:<Op_Semi ";">)] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$target"))} right: {(Lit_Other "*") (/) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(set_path)} {($ VSub_Name "$target")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:target) op: Equal rhs: {($ VSub_Name "$path")} spids: [1270] ) ] spids: [1270] ) ] spids: [-1 1262] ) ] spids: [-1 1274] ) (Pipeline children: [ (C {(objdump)} {(-tT)} {($ VSub_Name "$target")}) (C {(awk)} {(SQ <"$4 == \".text\" { print $NF }">)}) (C {(sort)}) (C {(uniq)}) ] negated: False ) (C {(exit)}) ] spids: [-1 1242] ) ] spids: [-1 1302] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ver) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(uname)} {(-r)})]) left_token: <Left_CommandSub "$("> spids: [1309 1313] ) } spids: [1308] ) ] spids: [1308] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:maj) op: Equal rhs: { (BracedVarSub token: <VSub_Name ver> suffix_op: (StringUnary op_id:VOp1_DPercent arg_word:{(".*")}) spids: [1316 1320] ) } spids: [1315] ) ] spids: [1315] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DAmp left: (ArithBinary op_id: Arith_DEqual left: (ArithVarRef name:opt_force) right: (ArithWord w:{(Lit_Digits 0)}) ) right: (ArithBinary op_id: Arith_Less left: (ArithWord w:{($ VSub_Name "$maj")}) right: (ArithWord w:{(Lit_Digits 4)}) ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLessDash fd: -1 body: { (DQ ("ERROR: Kernel version >= 4.0 preferred (you have ") ($ VSub_Name "$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") ) } do_expansion: True here_end: END was_filled: True spids: [1349] ) (Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1352]) ] ) (C {(exit)}) ] spids: [-1 1344] ) ] spids: [-1 1366] ) (ForEach iter_name: cmd iter_words: [{(file)} {(objdump)} {(ldconfig)} {(awk)}] do_arg_iter: False body: (DoGroup children: [ (SimpleCommand words: [{(which)} {($ VSub_Name "$cmd")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[1394])] ) (AndOr children: [ (DParen child: (ArithBinary op_id: Arith_NEqual left: (ArithWord w:{($ VSub_QMark "$?")}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) (C {(die)} { (DQ ("ERROR: missing ") ($ VSub_Name "$cmd") (" in ") (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("PATH. ") ($ VSub_Number "$0") (" needs") ) } {(DQ ("to use this command. Exiting."))} ) ] op_id: Op_DAmp ) ] spids: [1387 1430] ) spids: [1377 1385] ) (AndOr children: [ (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{(DQ ($ VSub_Name "$uprobe"))} right:{(DQ )}) ) (C {(usage)}) ] op_id: Op_DAmp ) (AndOr children: [ (DParen child: (ArithBinary op_id: Arith_Great left: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Plus left: (ArithVarRef name:opt_pid) right: (ArithVarRef name:opt_filter) ) right: (ArithVarRef name:opt_tid) ) right: (ArithWord w:{(Lit_Digits 1)}) ) ) (C {(die)} {(DQ ("ERROR: use at most one of -p, -L, or filter."))}) ] op_id: Op_DAmp ) (AndOr children: [ (DParen child: (ArithBinary op_id: Arith_DAmp left: (ArithVarRef name:opt_duration) right: (ArithVarRef name:opt_view) ) ) (C {(die)} {(DQ ("ERROR: use either -d or -v."))}) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [(Sentence child:(DParen child:(ArithVarRef name:opt_pid)) terminator:<Op_Semi ";">)] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_filter) op:Equal rhs:{(1)} spids:[1518])] spids: [1518] ) (ForEach iter_name: tid iter_words: [{(/proc/) ($ VSub_Name "$pid") (/task/) (Lit_Other "*")}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:filter) op: Equal rhs: { (DQ ($ VSub_Name "$filter") (" || common_pid == ") (BracedVarSub token: <VSub_Name tid> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {("*") (Lit_Slash /)} ) spids: [1545 1550] ) ) } spids: [1541] ) ] spids: [1541] ) ] spids: [1538 1554] ) spids: [1531 1536] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:filter) op: Equal rhs: { (BracedVarSub token: <VSub_Name filter> suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 3)})) spids: [1558 1562] ) } spids: [1557] ) ] spids: [1557] ) ] spids: [-1 1511] ) ] spids: [-1 1567] ) (If arms: [ (if_arm cond: [(Sentence child:(DParen child:(ArithVarRef name:opt_tid)) terminator:<Op_Semi ";">)] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:opt_filter) op:Equal rhs:{(1)} spids:[1582])] spids: [1582] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:filter) op: Equal rhs: {(DQ ("common_pid == ") ($ VSub_Name "$tid"))} spids: [1586] ) ] spids: [1586] ) ] spids: [-1 1579] ) ] spids: [-1 1592] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$uprobe"))} right: {(p) (Lit_Other ":") (Lit_Other "*")} ) right: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$uprobe"))} right: {(r) (Lit_Other ":") (Lit_Other "*")} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("ERROR: invalid uprobe definition (should start with p: or r:)"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1628])] ) (C {(usage)}) ] spids: [-1 1623] ) ] spids: [-1 1638] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:utype) op: Equal rhs: { (BracedVarSub token: <VSub_Name uprobe> suffix_op: (StringUnary op_id:VOp1_DPercent arg_word:{(":*")}) spids: [1692 1696] ) } spids: [1691] ) ] spids: [1691] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:urest) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name uprobe> suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{("*:")}) spids: [1700 1704] ) (" ") ) } spids: [1698] ) ] spids: [1698] ) (C {(set)} {(--)} {($ VSub_Name "$urest")}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number "$1")} right: {(Lit_Other "*") (Lit_Other ":") (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:uname) op:Equal rhs:{(SQ )} spids:[1732])] spids: [1732] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:probe) op: Equal rhs: {($ VSub_Number "$1")} spids: [1735] ) ] spids: [1735] ) terminator: <Op_Semi ";"> ) (Sentence child:(C {(shift)}) terminator:<Op_Semi ";">) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uargs) op: Equal rhs: {(DQ ($ VSub_At "$@"))} spids: [1742] ) ] spids: [1742] ) ] spids: [-1 1729] ) ] else_action: [ (AndOr children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {($ VSub_Number "$2")} right: {(Lit_Other "*") (Lit_Other ":") (Lit_Other "*")} ) ) (C {(die)} {(DQ ("ERROR: invalid probe. See usage (-h)."))}) ] op_id: Op_DAmp ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uname) op: Equal rhs: {($ VSub_Number "$1")} spids: [1771] ) ] spids: [1771] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:probe) op: Equal rhs: {($ VSub_Number "$2")} spids: [1775] ) ] spids: [1775] ) terminator: <Op_Semi ";"> ) (Sentence child:(C {(shift)} {(2)}) terminator:<Op_Semi ";">) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uargs) op: Equal rhs: {(DQ ($ VSub_At "$@"))} spids: [1784] ) ] spids: [1784] ) ] spids: [1747 1789] ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: {($ VSub_Name "$probe")} spids: [1791] ) ] spids: [1791] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: { (BracedVarSub token: <VSub_Name path> suffix_op: (StringUnary op_id:VOp1_DPercent arg_word:{(":*")}) spids: [1796 1800] ) } spids: [1795] ) ] spids: [1795] ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:addr) op: Equal rhs: {($ VSub_Name "$probe")} spids: [1802] ) ] spids: [1802] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:addr) op: Equal rhs: { (BracedVarSub token: <VSub_Name addr> suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{("*:")}) spids: [1807 1811] ) } spids: [1806] ) ] spids: [1806] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name "$path")} right: {(Lit_Other "*") (/) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:seg) op: Equal rhs: { (BracedVarSub token: <VSub_Name path> suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{("*") (Lit_Slash /)}) spids: [1836 1841] ) } spids: [1835] ) ] spids: [1835] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:seg) op: Equal rhs: { (BracedVarSub token: <VSub_Name seg> suffix_op: (StringUnary op_id:VOp1_DPercent arg_word:{(".*")}) spids: [1845 1849] ) } spids: [1844] ) ] spids: [1844] ) ] spids: [-1 1832] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:seg) op: Equal rhs: {($ VSub_Name "$path")} spids: [1854] ) ] spids: [1854] ) (C {(set_path)} {($ VSub_Name "$path")}) ] spids: [1851 1866] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name "$addr"))} right: {(0x) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (AndOr children: [ (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{(DQ ($ VSub_Name "$uname"))} right:{(DQ )}) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uname) op: Equal rhs: {(${ VSub_Name seg) (_) ($ VSub_Name "$addr")} spids: [1910] ) ] spids: [1910] ) ] op_id: Op_DAmp ) ] spids: [-1 1888] ) ] else_action: [ (AndOr children: [ (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{(DQ ($ VSub_Name "$uname"))} right:{(DQ )}) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uname) op: Equal rhs: {($ VSub_Name "$addr")} spids: [1935] ) ] spids: [1935] ) ] op_id: Op_DAmp ) (C {(set_addr)} {($ VSub_Name "$path")} {($ VSub_Name "$seg")} {($ VSub_Name "$addr")}) ] spids: [1917 1947] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uprobe) op: Equal rhs: { (DQ ($ VSub_Name "$utype") (":") ($ VSub_Name "$uname") (" ") ($ VSub_Name "$path") (":") ($ VSub_Name "$addr") ) } spids: [1953] ) ] spids: [1953] ) (AndOr children: [ (DBracket expr: (BoolBinary op_id:BoolBinary_GlobNEqual left:{(DQ ($ VSub_Name "$uargs"))} right:{(DQ )}) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uprobe) op: Equal rhs: {(DQ ($ VSub_Name "$uprobe") (" ") ($ VSub_Name "$uargs"))} spids: [1979] ) ] spids: [1979] ) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [(Sentence child:(DParen child:(ArithVarRef name:debug)) terminator:<Op_Semi ";">)] action: [ (C {(echo)} { (DQ ("uname: ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$uname") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (", uprobe: ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$uprobe") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ) } ) ] spids: [-1 1997] ) ] spids: [-1 2013] ) (AndOr children: [ (C {(cd)} {($ VSub_Name "$tracing")}) (C {(die)} { (DQ ("ERROR: accessing tracing. Root user? Kernel has FTRACE?\n") (" debugfs mounted? (mount -t debugfs debugfs /sys/kernel/debug)") ) } ) ] op_id: Op_DPipe ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithUnary op_id:Arith_Bang child:(ArithVarRef name:opt_view))) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:opt_duration)) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("Tracing uprobe ") ($ VSub_Name "$uname") (" for ") ($ VSub_Name "$duration") (" seconds (buffered)...") ) } ) ] spids: [-1 2057] ) ] else_action: [ (C {(echo)} { (DQ ("Tracing uprobe ") ($ VSub_Name "$uname") (" (") ($ VSub_Name "$uprobe") ("). Ctrl-C to end.") ) } ) ] spids: [2071 2085] ) ] spids: [-1 2044] ) ] spids: [-1 2087] ) (AndOr children: [ (DBracket expr:(BoolUnary op_id:BoolUnary_e child:{($ VSub_Name "$flock")})) (C {(die)} { (DQ ("ERROR: ftrace may be in use by PID ") (CommandSubPart command_list: (CommandList children:[(C {(cat)} {($ VSub_Name "$flock")})]) left_token: <Left_CommandSub "$("> spids: [2107 2111] ) (" ") ($ VSub_Name "$flock") ) } ) ] op_id: Op_DAmp ) (AndOr children: [ (SimpleCommand words: [{(echo)} {($ VSub_Dollar "$$")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{($ VSub_Name "$flock")} spids:[2120])] ) (C {(die)} {(DQ ("ERROR: unable to write ") ($ VSub_Name "$flock") (.))}) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:wroteflock) op:Equal rhs:{(1)} spids:[2134])] spids: [2134] ) (SimpleCommand words: [{(echo)} {(nop)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(current_tracer)} spids:[2145])] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$uprobe"))}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(uprobe_events)} spids: [2159] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("ERROR: adding uprobe ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$uprobe") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (.) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[2169])] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:dmesg)) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Last ") ($ VSub_Name "$dmesg") (" dmesg entries (might contain reason):") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[2196])] ) (Pipeline children: [ (C {(dmesg)}) (C {(tail)} {(-) ($ VSub_Name "$dmesg")}) (C {(sed)} {(SQ <"s/^/ /">)}) ] negated: False ) ] spids: [-1 2191] ) ] spids: [-1 2224] ) (C {(edie)} {(DQ (Exiting.))}) ] spids: [-1 2164] ) ] spids: [-1 2233] ) (If arms: [ (if_arm cond: [(Sentence child:(DParen child:(ArithVarRef name:opt_view)) terminator:<Op_Semi ";">)] action: [(C {(cat)} {(events/uprobes/) ($ VSub_Name "$uname") (/format)}) (C {(edie)} {(DQ )})] spids: [-1 2245] ) ] spids: [-1 2260] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:opt_filter)) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$filter"))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(events/uprobes/) ($ VSub_Name "$uname") (/filter)} spids: [2285] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [(C {(edie)} {(DQ ("ERROR: setting filter or -p. Exiting."))})] spids: [-1 2292] ) ] spids: [-1 2302] ) ] spids: [-1 2272] ) ] spids: [-1 2304] ) (If arms: [ (if_arm cond: [(Sentence child:(DParen child:(ArithVarRef name:opt_stack)) terminator:<Op_Semi ";">)] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(echo)} {(1)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(options/userstacktrace)} spids: [2327] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [(C {(edie)} {(DQ ("ERROR: enabling stack traces (-s). Exiting"))})] spids: [-1 2332] ) ] spids: [-1 2342] ) ] spids: [-1 2316] ) ] spids: [-1 2344] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(echo)} {(1)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(events/uprobes/) ($ VSub_Name "$uname") (/enable)} spids: [2354] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [(C {(edie)} {(DQ ("ERROR: enabling uprobe ") ($ VSub_Name "$uname") (". Exiting."))})] spids: [-1 2361] ) ] spids: [-1 2372] ) (C {(warn)} {(DQ ("echo > trace"))}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:opt_duration)) terminator: <Op_Semi ";"> ) ] action: [ (C {(sleep)} {($ VSub_Name "$duration")}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child:(ArithVarRef name:opt_headers)) terminator: <Op_Semi ";"> ) ] action: [(C {(cat)} {(trace)})] spids: [-1 2412] ) ] else_action: [(C {(grep)} {(-v)} {(SQ <"^#">)} {(trace)})] spids: [2420 2434] ) ] spids: [-1 2394] ) ] else_action: [ (AndOr children: [(DParen child:(ArithVarRef name:opt_headers)) (C {(cat)} {(trace)})] op_id: Op_DAmp ) (C {(cat)} {(trace_pipe)}) ] spids: [2436 2461] ) (C {(end)}) ] )