(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tracing='> name:tracing) op: assign_op.Equal rhs: {<'/sys/kernel/debug/tracing'>} spids: [142] ) ] redirects: [] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'flock='> name:flock) op: assign_op.Equal rhs: {<'/var/tmp/.ftrace-lock'>} spids: [145] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'wroteflock='> name:wroteflock) op: assign_op.Equal rhs: {<0>} spids: [149] ) ] redirects: [] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_duration='> name:opt_duration) op: assign_op.Equal rhs: {<0>} spids: [152] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'duration='> name:duration) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [156] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_name='> name:opt_name) op: assign_op.Equal rhs: {<0>} spids: [159] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'name='> name:name) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [163] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_pid='> name:opt_pid) op: assign_op.Equal rhs: {<0>} spids: [166] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'pid='> name:pid) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [170] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_tid='> name:opt_tid) op: assign_op.Equal rhs: {<0>} spids: [173] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tid='> name:tid) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [177] ) ] redirects: [] ) ] ) (command.CommandList children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ftext='> name:ftext) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [179] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_time='> name:opt_time) op: assign_op.Equal rhs: {<0>} spids: [182] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_fail='> name:opt_fail) op: assign_op.Equal rhs: {<0>} spids: [186] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_file='> name:opt_file) op: assign_op.Equal rhs: {<0>} spids: [190] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'file='> name:file) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [194] ) ] redirects: [] ) ] ) (C {<trap>} {(SQ <':'>)} {<INT>} {<QUIT>} {<TERM>} {<PIPE>} {<HUP>}) (command.ShFunction name: usage body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<END>} here_end_span_id: 259 stdin_parts: [ < 'USAGE: opensnoop [-htx] [-d secs] [-p PID] [-L TID] [-n name] [filename]\n' > <' -d seconds # trace duration, and use buffers\n'> <' -n name # process name to match on open\n'> <' -p PID # PID to match on open\n'> <' -L TID # PID to match on open\n'> <' -t # include time (seconds)\n'> <' -x # only show failed opens\n'> <' -h # this usage message\n'> <' filename # match filename (partials, REs, ok)\n'> <' eg,\n'> <' opensnoop # watch open()s live (unbuffered)\n'> <' opensnoop -d 1 # trace 1 sec (buffered)\n'> <' opensnoop -p 181 # trace I/O issued by PID 181 only\n'> <' opensnoop conf # trace filenames containing '> <Id.Right_DoubleQuote '"'> <conf> <Id.Right_DoubleQuote '"'> <'\n'> <' opensnoop \'log'> <Id.Lit_Dollar '$'> <'\' # filenames ending in '> <Id.Right_DoubleQuote '"'> <log> <Id.Right_DoubleQuote '"'> <'\n'> <'\n'> <'See the man page and example file for more info.\n'> ] ) ) (redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>}) ] more_env: [] do_fork: T ) (command.ControlFlow token:<Id.ControlFlow_Exit exit>) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: warn body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [(C {<eval>} {(DQ ($ Id.VSub_At '@'))})] negated: T stderr_indices: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [ {<echo>} { (DQ <'WARNING: command failed '> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\"'> ch: '"' ) ($ Id.VSub_At '@') (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') ) } ] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] more_env: [] do_fork: T ) ] spids: [273 284] ) ] else_action: [] redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: end body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple words: [{<echo>}] redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})] more_env: [] do_fork: T ) (command.Simple words: [{<echo>} {(DQ <'Ending tracing...'>)}] redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})] more_env: [] do_fork: T ) (C {<cd>} {($ Id.VSub_DollarName tracing)}) (C {<warn>} {(DQ <'echo 0 > events/kprobes/getnameprobe/enable'>)}) (C {<warn>} {(DQ <'echo 0 > events/syscalls/sys_exit_open/enable'>)}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DPipe left: ($ Id.Lit_ArithVarLike opt_pid) right: ($ Id.Lit_ArithVarLike opt_tid) ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<warn>} {(DQ <'echo 0 > events/kprobes/getnameprobe/filter'>)}) (C {<warn>} {(DQ <'echo 0 > events/syscalls/sys_exit_open/filter'>)}) ] spids: [351 365] ) ] else_action: [] redirects: [] ) (C {<warn>} {(DQ <'echo -:getnameprobe >> kprobe_events'>)}) (C {<warn>} {(DQ <'echo > trace'>)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: ($ Id.Lit_ArithVarLike wroteflock) redirects: [] ) (C {<warn>} {(DQ <'rm '> ($ Id.VSub_DollarName flock))}) ] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: die body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_At '@'))}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] more_env: [] do_fork: T ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: edie body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_At '@'))}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] more_env: [] do_fork: T ) (command.Simple words: [{<exec>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) (redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>}) ] more_env: [] do_fork: T ) (C {<end>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (C {<getopts>} {<d> <Id.Lit_Colon ':'> <hn> <Id.Lit_Colon ':'> <p> <Id.Lit_Colon ':'> <L> <Id.Lit_Colon ':'> <tx> } {<opt>} ) ] ) body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_DollarName opt)} arms: [ (case_arm pat_list: [{<d>}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'opt_duration='> name: opt_duration ) op: assign_op.Equal rhs: {<1>} spids: [514] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'duration='> name:duration) op: assign_op.Equal rhs: {($ Id.VSub_DollarName OPTARG)} spids: [518] ) ] redirects: [] ) ] spids: [511 512 521 -1] ) (case_arm pat_list: [{<n>}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_name='> name:opt_name) op: assign_op.Equal rhs: {<1>} spids: [527] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'name='> name:name) op: assign_op.Equal rhs: {($ Id.VSub_DollarName OPTARG)} spids: [531] ) ] redirects: [] ) ] spids: [524 525 534 -1] ) (case_arm pat_list: [{<p>}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_pid='> name:opt_pid) op: assign_op.Equal rhs: {<1>} spids: [540] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'pid='> name:pid) op: assign_op.Equal rhs: {($ Id.VSub_DollarName OPTARG)} spids: [544] ) ] redirects: [] ) ] spids: [537 538 547 -1] ) (case_arm pat_list: [{<L>}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_tid='> name:opt_tid) op: assign_op.Equal rhs: {<1>} spids: [553] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tid='> name:tid) op: assign_op.Equal rhs: {($ Id.VSub_DollarName OPTARG)} spids: [557] ) ] redirects: [] ) ] spids: [550 551 560 -1] ) (case_arm pat_list: [{<t>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_time='> name:opt_time) op: assign_op.Equal rhs: {<1>} spids: [566] ) ] redirects: [] ) ] spids: [563 564 569 -1] ) (case_arm pat_list: [{<x>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_fail='> name:opt_fail) op: assign_op.Equal rhs: {<1>} spids: [575] ) ] redirects: [] ) ] spids: [572 573 578 -1] ) (case_arm pat_list: [{<h>} {<Id.Lit_QMark '?'>}] action: [(C {<usage>})] spids: [581 584 588 -1] ) ] redirects: [] ) ] ) redirects: [] ) (C {<shift>} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName OPTIND)} right: {<Id.Lit_Digits 1>} ) ) } ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child:{($ Id.VSub_Pound '#')} redirects:[]) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt_file='> name:opt_file) op: assign_op.Equal rhs: {<1>} spids: [621] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'file='> name:file) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} spids: [625] ) ] redirects: [] ) (C {<shift>}) ] spids: [608 618] ) ] else_action: [] redirects: [] ) (command.AndOr ops: [Id.Op_DAmp] children: [(command.DParen child:{($ Id.VSub_Pound '#')} redirects:[]) (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: ($ Id.Lit_ArithVarLike opt_pid) right: ($ Id.Lit_ArithVarLike opt_name) ) right: ($ Id.Lit_ArithVarLike opt_tid) ) right: {<Id.Lit_Digits 1>} ) redirects: [] ) (C {<die>} {(DQ <'ERROR: use at most one of -p, -n, -L.'>)}) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child:($ Id.Lit_ArithVarLike opt_pid) redirects:[]) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ftext='> name:ftext) op: assign_op.Equal rhs: {(DQ <' issued by PID '> ($ Id.VSub_DollarName pid))} spids: [686] ) ] redirects: [] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child:($ Id.Lit_ArithVarLike opt_tid) redirects:[]) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ftext='> name:ftext) op: assign_op.Equal rhs: {(DQ <' issued by TID '> ($ Id.VSub_DollarName tid))} spids: [701] ) ] redirects: [] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child:($ Id.Lit_ArithVarLike opt_name) redirects:[]) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ftext='> name:ftext) op: assign_op.Equal rhs: { (DQ <' issued by process name '> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\"'> ch: '"' ) ($ Id.VSub_DollarName name) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') ) } spids: [716] ) ] redirects: [] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child:($ Id.Lit_ArithVarLike opt_file) redirects:[]) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ftext='> name:ftext) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName ftext) <' for filenames containing '> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\"'> ch: '"' ) ($ Id.VSub_DollarName file) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') ) } spids: [733] ) ] redirects: [] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child:($ Id.Lit_ArithVarLike opt_duration) redirects:[]) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} { (DQ <'Tracing open()s'> ($ Id.VSub_DollarName ftext) <' for '> ($ Id.VSub_DollarName duration) <' seconds (buffered)...'> ) } ) ] spids: [742 752] ) ] else_action: [ (C {<echo>} {(DQ <'Tracing open()s'> ($ Id.VSub_DollarName ftext) <'. Ctrl-C to end.'>)}) ] redirects: [] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (command.DParen child:($ Id.Lit_ArithVarLike opt_duration) redirects:[]) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'use='> name:use) op: assign_op.Equal rhs: {<mawk>} spids: [791] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'use='> name:use) op: assign_op.Equal rhs: {<gawk>} spids: [796] ) ] redirects: [] ) ] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_x child:{<'/usr/bin/'> ($ Id.VSub_DollarName use)}) redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'awk='> name:awk) op: assign_op.Equal rhs: {($ Id.VSub_DollarName use)} spids: [813] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'awk='> name:awk) op: assign_op.Equal rhs: {<awk>} spids: [818] ) ] redirects: [] ) ] ) (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.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_e child:{($ Id.VSub_DollarName flock)}) redirects: [] ) (C {<die>} { (DQ <'ERROR: ftrace may be in use by PID '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<cat>} {($ Id.VSub_DollarName flock)}) right: <Id.Eof_RParen _> ) <' '> ($ Id.VSub_DollarName flock) ) } ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{<echo>} {($ Id.VSub_Dollar '$')}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {($ Id.VSub_DollarName flock)} ) ] more_env: [] do_fork: T ) (C {<die>} {(DQ <'ERROR: unable to write '> ($ Id.VSub_DollarName flock) <.>)}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'wroteflock='> name:wroteflock) op: assign_op.Equal rhs: {<1>} spids: [883] ) ] redirects: [] ) (command.Simple words: [{<echo>} {<nop>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<current_tracer>})] more_env: [] do_fork: T ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ver='> name:ver) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<uname>} {<-r>}) right: <Id.Eof_RParen _> ) } spids: [898] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName ver))} right: {<2.> <Id.Lit_Other '*'>} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName ver))} right: {<3.> <Id.Lit_Other '['> <1-6> <Id.Lit_Other ']'> <.> <Id.Lit_Other '*'>} ) ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'kprobe='> name:kprobe) op: assign_op.Equal rhs: {(SQ <'r:getnameprobe getname +0($retval):string'>)} spids: [943] ) ] redirects: [] ) ] spids: [905 936] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'kprobe='> name:kprobe) op: assign_op.Equal rhs: {(SQ <'r:getnameprobe getname +0(+0($retval)):string'>)} spids: [955] ) ] redirects: [] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{<echo>} {($ Id.VSub_DollarName kprobe)}] redirects: [ (redir op: <Id.Redir_DGreat '>>'> loc: (redir_loc.Fd fd:1) arg: {<kprobe_events>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<edie>} {(DQ <'ERROR: adding a kprobe for getname(). Exiting.'>)})] spids: [962 975] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child:($ Id.Lit_ArithVarLike opt_pid) redirects:[]) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter='> name:filter) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [999] ) ] redirects: [] ) (command.ForEach iter_names: [tid] iterable: (for_iter.Words words: [{<'/proc/'> ($ Id.VSub_DollarName pid) <'/task/'> <Id.Lit_Star '*'>}] ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter='> name:filter) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName filter) <' || common_pid == '> (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name tid> var_name: tid suffix_op: (suffix_op.Unary op: <Id.VOp1_DPound '##'> arg_word: {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>} ) right: <Id.Right_DollarBrace '}'> ) ) } spids: [1017] ) ] redirects: [] ) ] ) redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter='> name:filter) op: assign_op.Equal rhs: { (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name filter> var_name: filter suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 3>}) right: <Id.Arith_RBrace _> ) } spids: [1033] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Pipeline children: [ (command.Simple words: [{<echo>} {($ Id.VSub_DollarName filter)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'events/kprobes/getnameprobe/filter'>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) (command.Pipeline children: [ (command.Simple words: [{<echo>} {($ Id.VSub_DollarName filter)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'events/syscalls/sys_exit_open/filter'>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) ] ) ] ) action: [ (C {<edie>} {(DQ <'ERROR: setting -p '> ($ Id.VSub_DollarName pid) <'. Exiting.'>)}) ] spids: [1044 1071] ) ] else_action: [] redirects: [] ) ] spids: [986 996] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child:($ Id.Lit_ArithVarLike opt_tid) redirects:[]) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Pipeline children: [ (command.Simple words: [{<echo>} {(DQ <'common_pid == '> ($ Id.VSub_DollarName tid))}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'events/kprobes/getnameprobe/filter'>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) (command.Pipeline children: [ (command.Simple words: [{<echo>} {(DQ <'common_pid == '> ($ Id.VSub_DollarName tid))}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'events/syscalls/sys_exit_open/filter'>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) ] ) ] ) action: [ (C {<edie>} {(DQ <'ERROR: setting -L '> ($ Id.VSub_DollarName tid) <'. Exiting.'>)}) ] spids: [1100 1133] ) ] else_action: [] redirects: [] ) ] spids: [1087 1097] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{<echo>} {<1>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'events/kprobes/getnameprobe/enable'>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<edie>} {(DQ <'ERROR: enabling kprobe for getname(). Exiting.'>)})] spids: [1149 1162] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{<echo>} {<1>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'events/syscalls/sys_exit_open/enable'>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<edie>} {(DQ <'ERROR: enabling open() exit tracepoint. Exiting.'>)})] spids: [1173 1186] ) ] else_action: [] redirects: [] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child:($ Id.Lit_ArithVarLike opt_time) redirects:[]) (C {<printf>} {(DQ <'%-16s '>)} {(DQ <TIMEs>)}) ] ) (C {<printf>} {(DQ <'%-16.16s %-6s %4s %s'> <Id.Lit_BadBackslash '\\'> <n>)} {(DQ <COMM>)} {(DQ <PID>)} {(DQ <FD>)} {(DQ <FILE>)} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'offset='> name:offset) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {($ Id.VSub_DollarName awk)} { (SQ <'BEGIN { o = 0; }\n'> <'\t$1 == "#" && $2 ~ /TASK/ && NF == 6 { o = 1; }\n'> <'\t$2 ~ /TASK/ { print o; exit }'> ) } {<trace>} ) right: <Id.Eof_RParen _> ) } spids: [1262] ) ] redirects: [] ) (C {<warn>} {(DQ <'echo > trace'>)}) (command.Pipeline children: [ (command.Subshell child: (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: ($ Id.Lit_ArithVarLike opt_duration) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<sleep>} {($ Id.VSub_DollarName duration)}) (C {<cat>} {<trace>})] spids: [1287 1297] ) ] else_action: [(C {<cat>} {<trace_pipe>})] redirects: [] ) redirects: [] ) (C {($ Id.VSub_DollarName awk)} {<-v>} {<Id.Lit_VarLike 'o='> ($ Id.VSub_DollarName offset)} {<-v>} {<Id.Lit_VarLike 'opt_name='> ($ Id.VSub_DollarName opt_name)} {<-v>} {<Id.Lit_VarLike 'name='> ($ Id.VSub_DollarName name)} {<-v>} {<Id.Lit_VarLike 'opt_duration='> ($ Id.VSub_DollarName opt_duration)} {<-v>} {<Id.Lit_VarLike 'opt_time='> ($ Id.VSub_DollarName opt_time)} {<-v>} {<Id.Lit_VarLike 'opt_fail='> ($ Id.VSub_DollarName opt_fail)} {<-v>} {<Id.Lit_VarLike 'opt_file='> ($ Id.VSub_DollarName opt_file)} {<-v>} {<Id.Lit_VarLike 'file='> ($ Id.VSub_DollarName file)} { (SQ <'\n'> <'\t# common fields\n'> <'\t$1 != "#" {\n'> <'\t\t# task name can contain dashes and space\n'> <'\t\tsplit($0, line, "-")\n'> <'\t\tsub(/^[ \\t\\r\\n]+/, "", line[1])\n'> <'\t\tcomm = line[1]\n'> <'\t\tif (opt_name && match(comm, name) == 0)\n'> <'\t\t\tnext\n'> <'\t\tsub(/ .*$/, "", line[2])\n'> <'\t\tpid = line[2]\n'> <'\t}\n'> <'\n'> <'\t# do_sys_open()\n'> <'\t$1 != "#" && $(5+o) ~ /do_sys_open/ {\n'> <'\t\t#\n'> <'\t\t# eg: ... (do_sys_open+0xc3/0x220 <- getname) arg1="file1"\n'> <'\t\t#\n'> <'\t\tfilename = $NF\n'> <'\t\tsub(/"$/, "", filename)\n'> <'\t\tsub(/.*"/, "", filename)\n'> <'\t\tlastfile[pid] = filename\n'> <'\t}\n'> <'\n'> <'\t# sys_open()\n'> <'\t$1 != "#" && $(4+o) == "sys_open" {\n'> <'\t\tfilename = lastfile[pid]\n'> <'\t\tdelete lastfile[pid]\n'> <'\t\tif (opt_file && filename !~ file)\n'> <'\t\t\tnext\n'> <'\t\trval = $NF\n'> <'\t\t# matched failed as beginning with 0xfffff\n'> <'\t\tif (opt_fail && rval !~ /0xfffff/)\n'> <'\t\t\tnext\n'> <'\t\tif (rval ~ /0xfffff/)\n'> <'\t\t\trval = -1\n'> <'\n'> <'\t\tif (opt_time) {\n'> <'\t\t\ttime = $(3+o); sub(":", "", time)\n'> <'\t\t\tprintf "%-16s ", time\n'> <'\t\t}\n'> <'\t\tprintf "%-16.16s %-6s %4s %s\\n", comm, pid, rval, filename\n'> <'\t}\n'> <'\n'> <'\t$0 ~ /LOST.*EVENTS/ { print "WARNING: " $0 > "/dev/stderr" }\n'> ) } ) ] negated: F stderr_indices: [] ) (C {<end>}) ] )