(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: [148]
        )
      ]
    )
    (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: [151]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:153)
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:wroteflock)
              op: assign_op.Equal
              rhs: {(0)}
              spids: [155]
            )
          ]
        )
      ]
    )
    (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: [158]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:160)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:duration)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [162]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:163)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_pid)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [165]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:167)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:pid)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [169]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:170)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_tid)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [172]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:174)
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:tid)
              op: assign_op.Equal
              rhs: (word.Empty)
              spids: [176]
            )
          ]
        )
      ]
    )
    (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: [178]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:180)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:filter)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [182]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:183)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_view)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [185]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:187)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_headers)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [189]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:191)
        )
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_stack)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [193]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:195)
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:dmesg)
              op: assign_op.Equal
              rhs: {(2)}
              spids: [197]
            )
          ]
        )
      ]
    )
    (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: [200]
                )
              ]
            )
          terminator: (Token id:Id.Op_Semi val:';' span_id:202)
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:opt_force)
              op: assign_op.Equal
              rhs: {(0)}
              spids: [204]
            )
          ]
        )
      ]
    )
    (C {(trap)} {(SQ (Token id:Id.Lit_Chars val:':' span_id:210))} {(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:236)
                  fd: -1
                  here_begin: {(END)}
                  here_end_span_id: 286
                  stdin_parts: [
                    (
'USAGE: kprobe [-FhHsv] [-d secs] [-p PID] [-L TID] kprobe_definition [filter]\n'
                    )
                    ('                 -F              # force. trace despite warnings.\n')
                    ('                 -d seconds      # trace duration, and use buffers\n')
                    ('                 -p PID          # PID to match on events\n')
                    ('                 -L TID          # thread id to match on events\n')
                    ("                 -v              # view format file (don't trace)\n")
                    ('                 -H              # include column headers\n')
                    ('                 -s              # show kernel stack traces\n')
                    ('                 -h              # this usage message\n')
                    ('\n')
                    ('Note that these examples may need modification to match your kernel\n')
                    ("version's function names and platform's register usage.\n")
                    ('   eg,\n')
                    ('       kprobe p:do_sys_open\n')
                    ('                                 # trace open() entry\n')
                    ('       kprobe r:do_sys_open\n')
                    ('                                 # trace open() return\n')
                    ("       kprobe 'r:do_sys_open ")
                    (word_part.EscapedLiteral
                      token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:260)
                    )
                    ("retval'\n")
                    ('                                 # trace open() return value\n')
                    ("       kprobe 'r:myopen do_sys_open ")
                    (word_part.EscapedLiteral
                      token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:264)
                    )
                    ("retval'\n")
                    ('                                 # use a custom probe name\n')
                    ("       kprobe 'p:myopen do_sys_open mode=%cx:u16'\n")
                    ('                                 # trace open() file mode\n')
                    ("       kprobe 'p:myopen do_sys_open filename=+0(%si):string'\n")
                    ('                                 # trace open() with filename\n')
                    ("       kprobe -s 'p:myprobe tcp_retransmit_skb'\n")
                    ('                                 # show kernel stacks\n')
                    ("       kprobe 'p:do_sys_open file=+0(%si):string' 'file ~ ")
                    (Id.Right_DoubleQuote '"')
                    ('*stat')
                    (Id.Right_DoubleQuote '"')
                    ("'\n")
                    ('                                 # opened files ending in ')
                    (Id.Right_DoubleQuote '"')
                    (stat)
                    (Id.Right_DoubleQuote '"')
                    ('\n')
                    ('\n')
                    ('See the man page and example file for more info.\n')
                  ]
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:239)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:288)
            )
          ]
        )
    )
    (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:309)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(echo)}
                        {
                          (DQ ('WARNING: command failed ') 
                            (word_part.EscapedLiteral
                              token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:321)
                            ) ($ Id.VSub_At '$@') 
                            (word_part.EscapedLiteral
                              token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:323)
                            )
                          )
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:316)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                  ]
                  spids: [300 311]
                )
              ]
            )
          ]
        )
    )
    (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:345)
                  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:355)
                  fd: 2
                  arg_word: {(/dev/null)}
                )
              ]
            )
            (C {(cd)} {($ Id.VSub_DollarName '$tracing')})
            (C {(warn)} {(DQ ('echo 0 > events/kprobes/') ($ Id.VSub_DollarName '$kname') (/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:377)
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:381)
                    )
                  ]
                  action: [
                    (C {(warn)} 
                      {(DQ ('echo 0 > events/kprobes/') ($ Id.VSub_DollarName '$kname') (/filter))}
                    )
                  ]
                  spids: [373 383]
                )
              ]
            )
            (C {(warn)} {(DQ ('echo -:') ($ Id.VSub_DollarName '$kname') (' >> kprobe_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:409)
                    )
                )
                (C {(warn)} {(DQ ('echo 0 > options/stacktrace'))})
              ]
            )
            (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:432)
                    )
                )
                (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:458)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:466)
              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:486)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.Simple
              words: [{(exec)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:496)
                  fd: -1
                  arg_word: {(/dev/null)}
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:499)
                  fd: 2
                  arg_word: {(1)}
                )
              ]
            )
            (C {(end)})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:506)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.WhileUntil
      keyword: (Token id:Id.KW_While val:while span_id:516)
      cond: [
        (C {(getopts)} {(Fd) (Id.Lit_Other ':') (hHp) (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: [543]
                        )
                      ]
                    )
                  ]
                  spids: [540 541 546 -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: [552]
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:554)
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:duration)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [556]
                        )
                      ]
                    )
                  ]
                  spids: [549 550 559 -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: [565]
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:567)
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:pid)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [569]
                        )
                      ]
                    )
                  ]
                  spids: [562 563 572 -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: [578]
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:580)
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:tid)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [582]
                        )
                      ]
                    )
                  ]
                  spids: [575 576 585 -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: [591]
                        )
                      ]
                    )
                  ]
                  spids: [588 589 594 -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: [600]
                        )
                      ]
                    )
                  ]
                  spids: [597 598 603 -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: [609]
                        )
                      ]
                    )
                  ]
                  spids: [606 607 612 -1]
                )
                (case_arm
                  pat_list: [{(h)} {(Id.Lit_QMark '?')}]
                  action: [(C {(usage)})]
                  spids: [615 618 622 -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.AndOr
      ops: [Id.Op_DPipe]
      children: [(command.DParen child:(arith_expr.ArithWord w:{($ Id.VSub_Pound '$#')})) (C {(usage)})]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:kprobe)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$1')}
          spids: [653]
        )
      ]
    )
    (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:666)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_filter)
                  op: assign_op.Equal
                  rhs: {(1)}
                  spids: [671]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:filter)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [675]
                )
              ]
            )
          ]
          spids: [658 668]
        )
      ]
    )
    (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:686)
                        )
                      right: 
                        (arith_expr.VarRef
                          token: (Token id:Id.Lit_ArithVarLike val:opt_filter span_id:690)
                        )
                    )
                  right: 
                    (arith_expr.VarRef
                      token: (Token id:Id.Lit_ArithVarLike val:opt_tid span_id:694)
                    )
                )
              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:715)
                )
              right: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:opt_view span_id:719))
            )
        )
        (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:736)
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:740)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_filter)
                  op: assign_op.Equal
                  rhs: {(1)}
                  spids: [749]
                )
              ]
            )
            (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:777)
                                  suffix_op: 
                                    (suffix_op.Unary
                                      op_id: Id.VOp1_DPound
                                      arg_word: {('*') (Id.Lit_Slash /)}
                                    )
                                )
                              )
                            }
                          spids: [772]
                        )
                      ]
                    )
                  ]
                )
            )
            (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:790)
                        suffix_op: (suffix_op.Slice begin:(arith_expr.ArithWord w:{(Id.Lit_Digits 3)}))
                      )
                    }
                  spids: [788]
                )
              ]
            )
          ]
          spids: [732 742]
        )
      ]
    )
    (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:804)
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:808)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:opt_filter)
                  op: assign_op.Equal
                  rhs: {(1)}
                  spids: [813]
                )
              ]
            )
            (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: [817]
                )
              ]
            )
          ]
          spids: [800 810]
        )
      ]
    )
    (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 '$kprobe'))}
                          right: {(p) (Id.Lit_Other ':') (Id.Lit_Other '*')}
                        )
                      right: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobNEqual
                          left: {(DQ ($ Id.VSub_DollarName '$kprobe'))}
                          right: {(r) (Id.Lit_Other ':') (Id.Lit_Other '*')}
                        )
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:852)
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ('ERROR: invalid kprobe definition (should start with p: or r:)'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:859)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (C {(usage)})
          ]
          spids: [825 854]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:krest)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: (Token id:Id.VSub_Name val:kprobe span_id:909)
                suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{('*:')})
              )
            }
          spids: [907]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:kname)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: (Token id:Id.VSub_Name val:krest span_id:916)
                suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPercent arg_word:{(' *')})
              )
            }
          spids: [914]
        )
      ]
    )
    (C {(Id.KW_Set set)} {(--)} {($ Id.VSub_DollarName '$krest')})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.LogicalOr
                      left: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: {($ Id.VSub_Number '$2')}
                          right: {(DQ )}
                        )
                      right: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: {($ Id.VSub_Number '$2')}
                          right: 
                            {(Id.Lit_Other '*') (Id.Lit_Other '[') (Id.BoolBinary_GlobEqual '=') 
                              (Id.Lit_Other '%') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:948)) 
                              (Id.Lit_Other ']') (Id.Lit_Other '*')
                            }
                        )
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:953)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ktype)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: (Token id:Id.VSub_Name val:kprobe span_id:964)
                        suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPercent arg_word:{(':*')})
                      )
                    }
                  spids: [962]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:kprobe)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$ktype') (':') ($ Id.VSub_DollarName '$kname') (' ') 
                        ($ Id.VSub_DollarName '$krest')
                      )
                    }
                  spids: [970]
                )
              ]
            )
          ]
          spids: [927 955]
        )
      ]
    )
    (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:985)
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:989)
            )
          ]
          action: [
            (C {(echo)} 
              {
                (DQ ('kname: ') ($ Id.VSub_DollarName '$kname') (', kprobe: ') 
                  ($ Id.VSub_DollarName '$kprobe')
                )
              }
            )
          ]
          spids: [981 991]
        )
      ]
    )
    (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)')
            )
          }
        )
      ]
    )
    (C {(Id.KW_Set set)} {(--)} {($ Id.VSub_DollarName '$kprobe')})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:fname)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$2')}
          spids: [1032]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DParen
                  child: 
                    (arith_expr.Unary
                      op_id: Id.Arith_Bang
                      child: 
                        (arith_expr.VarRef
                          token: (Token id:Id.Lit_ArithVarLike val:opt_force span_id:1040)
                        )
                    )
                )
                (command.Pipeline
                  children: [
                    (command.Simple
                      words: [
                        {(grep)}
                        {(-w)}
                        {($ Id.VSub_DollarName '$fname')}
                        {(available_filter_functions)}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:1057)
                          fd: -1
                          arg_word: {(/dev/null)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1062)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  negated: T
                )
              ]
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('ERROR: func ') ($ Id.VSub_DollarName '$fname') (' not in ') 
                    ($ Id.VSub_DollarName '$PWD') (/available_filter_functions.)
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1070)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.Simple
              words: [{(printf)} {(DQ ("Either it doesn't exist, or, it might be unsafe to kprobe. "))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1084)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.Simple
              words: [{(echo)} {(DQ ('Exiting. Use -F to override.'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1094)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:1102)
              arg_word: {(1)}
            )
          ]
          spids: [1035 1065]
        )
      ]
    )
    (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:1114)
                        )
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:1118)
            )
          ]
          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:1127)
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1131)
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ('Tracing kprobe ') ($ Id.VSub_DollarName '$kname') (' for ') 
                          ($ Id.VSub_DollarName '$duration') (' seconds (buffered)...')
                        )
                      }
                    )
                  ]
                  spids: [1123 1133]
                )
              ]
              else_action: [
                (C {(echo)} 
                  {(DQ ('Tracing kprobe ') ($ Id.VSub_DollarName '$kname') ('. Ctrl-C to end.'))}
                )
              ]
            )
          ]
          spids: [1109 1120]
        )
      ]
    )
    (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:1181)
                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:1194)
              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: [1208]
        )
      ]
    )
    (command.Simple
      words: [{(echo)} {(nop)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:1219)
          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 '$kprobe'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_DGreat val:'>>' span_id:1233)
                          fd: -1
                          arg_word: {(kprobe_events)}
                        )
                      ]
                    )
                  ]
                  negated: T
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:1236)
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('ERROR: adding kprobe ') 
                    (word_part.EscapedLiteral
                      token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:1248)
                    ) ($ Id.VSub_DollarName '$kprobe') 
                    (word_part.EscapedLiteral
                      token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:1250)
                    ) (.)
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1243)
                  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:1259)
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1263)
                    )
                  ]
                  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:1270)
                          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:1294))})
                      ]
                      negated: F
                    )
                  ]
                  spids: [1255 1265]
                )
              ]
            )
            (C {(edie)} {(DQ (Exiting.))})
          ]
          spids: [1223 1238]
        )
      ]
    )
    (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:1313)
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:1317)
            )
          ]
          action: [
            (C {(cat)} {(events/kprobes/) ($ Id.VSub_DollarName '$kname') (/format)})
            (C {(edie)} {(DQ )})
          ]
          spids: [1309 1319]
        )
      ]
    )
    (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:1340)
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:1344)
            )
          ]
          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:1359)
                                  fd: -1
                                  arg_word: 
                                    {(events/kprobes/) ($ Id.VSub_DollarName '$kname') (/filter)}
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1364)
                    )
                  ]
                  action: [(C {(edie)} {(DQ ('ERROR: setting filter or -p. Exiting.'))})]
                  spids: [1349 1366]
                )
              ]
            )
          ]
          spids: [1336 1346]
        )
      ]
    )
    (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:1384)
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:1388)
            )
          ]
          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:1401)
                                  fd: -1
                                  arg_word: {(options/stacktrace)}
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1404)
                    )
                  ]
                  action: [(C {(edie)} {(DQ ('ERROR: enabling stack traces (-s). Exiting'))})]
                  spids: [1393 1406]
                )
              ]
            )
          ]
          spids: [1380 1390]
        )
      ]
    )
    (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:1428)
                          fd: -1
                          arg_word: {(events/kprobes/) ($ Id.VSub_DollarName '$kname') (/enable)}
                        )
                      ]
                    )
                  ]
                  negated: T
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:1433)
            )
          ]
          action: [
            (C {(edie)} 
              {(DQ ('ERROR: enabling kprobe ') ($ Id.VSub_DollarName '$kname') ('. Exiting.'))}
            )
          ]
          spids: [1420 1435]
        )
      ]
    )
    (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:1462)
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:1466)
            )
          ]
          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:1480)
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1484)
                    )
                  ]
                  action: [(C {(cat)} {(trace)})]
                  spids: [1476 1486]
                )
              ]
              else_action: [
                (C {(grep)} {(-v)} {(SQ (Token id:Id.Lit_Chars val:'^#' span_id:1502))} {(trace)})
              ]
            )
          ]
          spids: [1458 1468]
        )
      ]
      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:1519)
                )
            )
            (C {(cat)} {(trace)})
          ]
        )
        (C {(cat)} {(trace_pipe)})
      ]
    )
    (C {(end)})
  ]
)