(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:tracing)
          op: Equal
          rhs: {(/sys/kernel/debug/tracing)}
          spids: [112]
        )
      ]
      spids: [112]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:flock)
          op: Equal
          rhs: {(/var/tmp/.ftrace-lock)}
          spids: [115]
        )
      ]
      spids: [115]
    )
    (Sentence
      child: 
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:opt_force) op:Equal rhs:{(0)} spids:[118])]
          spids: [118]
        )
      terminator: <Op_Semi ";">
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:opt_quiet) op:Equal rhs:{(0)} spids:[122])]
      spids: [122]
    )
    (FuncDef
      name: usage
      body: 
        (BraceGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (HereDoc
                  op_id: Redir_DLessDash
                  fd: -1
                  body: 
                    {
                      (DQ ("USAGE: reset-ftrace [-fhq]\n") 
                        ("                 -f              # force: delete ftrace lock file\n") ("                 -q              # quiet: reset, but say nothing\n") 
                        ("                 -h              # this usage message\n") ("  eg,\n") ("       reset-ftrace              # disable active ftrace session\n")
                      )
                    }
                  do_expansion: True
                  here_end: END
                  was_filled: True
                  spids: [135]
                )
                (Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[138])
              ]
            )
            (C {(exit)})
          ]
          spids: [130]
        )
      spids: [126 129]
    )
    (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:[176])]
                    )
                  ]
                  spids: [-1 171]
                )
              ]
              spids: [-1 187]
            )
          ]
          spids: [157]
        )
      spids: [153 156]
    )
    (FuncDef
      name: die
      body: 
        (BraceGroup
          children: [
            (SimpleCommand
              words: [{(echo)} {(DQ ($ VSub_At "$@"))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[201])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [196]
        )
      spids: [192 195]
    )
    (FuncDef
      name: vecho
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (DParen child:(ArithVarRef name:opt_quiet))
                (ControlFlow token:<ControlFlow_Return return>)
              ]
              op_id: Op_DAmp
            )
            (C {(echo)} {(DQ ($ VSub_At "$@"))})
          ]
          spids: [220]
        )
      spids: [216 219]
    )
    (FuncDef
      name: writefile
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:file)
                  op: Equal
                  rhs: {($ VSub_Number "$1")}
                  spids: [254]
                )
              ]
              spids: [254]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:string)
                  op: Equal
                  rhs: {($ VSub_Number "$2")}
                  spids: [258]
                )
              ]
              spids: [258]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalNot
                              child: (BoolUnary op_id:BoolUnary_w child:{($ VSub_Name "$file")})
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (SimpleCommand
                      words: [
                        {(echo)}
                        {
                          (DQ ("WARNING: file ") ($ VSub_Name "$file") 
                            (" not writable/exists. Skipping.")
                          )
                        }
                      ]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[283])]
                    )
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [-1 278]
                )
              ]
              spids: [-1 296]
            )
            (C {(vecho)} {(DQ ($ VSub_Name "$file") (", before:"))})
            (AndOr
              children: [
                (DParen
                  child: (ArithUnary op_id:Arith_Bang child:(ArithVarRef name:opt_quiet))
                )
                (C {(cat)} {(-n)} {($ VSub_Name "$file")})
              ]
              op_id: Op_DAmp
            )
            (C {(warn)} {(DQ ("echo ") ($ VSub_Name "$string") (" > ") ($ VSub_Name "$file"))})
            (C {(vecho)} {(DQ ($ VSub_Name "$file") (", after:"))})
            (AndOr
              children: [
                (DParen
                  child: (ArithUnary op_id:Arith_Bang child:(ArithVarRef name:opt_quiet))
                )
                (C {(cat)} {(-n)} {($ VSub_Name "$file")})
              ]
              op_id: Op_DAmp
            )
            (C {(vecho)})
          ]
          spids: [251]
        )
      spids: [247 250]
    )
    (While
      cond: [(C {(getopts)} {(fhq)} {(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: [390]
                        )
                      ]
                      spids: [390]
                    )
                  ]
                  spids: [387 388 393 -1]
                )
                (case_arm
                  pat_list: [{(q)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:opt_quiet)
                          op: Equal
                          rhs: {(1)}
                          spids: [399]
                        )
                      ]
                      spids: [399]
                    )
                  ]
                  spids: [396 397 402 -1]
                )
                (case_arm
                  pat_list: [{(h)} {(Lit_Other "?")}]
                  action: [(C {(usage)})]
                  spids: [405 408 412 -1]
                )
              ]
              spids: [380 384 415]
            )
          ]
          spids: [377 417]
        )
    )
    (C {(shift)} 
      {
        (ArithSubPart
          anode: 
            (ArithBinary
              op_id: Arith_Minus
              left: (ArithWord w:{($ VSub_Name "$OPTIND")})
              right: (ArithWord w:{(Lit_Digits 1)})
            )
          spids: [421 430]
        )
      }
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (DBracket expr:(BoolUnary op_id:BoolUnary_e child:{($ VSub_Name "$flock")}))
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (DParen child:(ArithVarRef name:opt_force))
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [(C {(warn)} {(rm)} {($ VSub_Name "$flock")})]
                  spids: [-1 460]
                )
              ]
              else_action: [
                (SimpleCommand
                  words: [
                    {(echo)}
                    {(-e)}
                    {(DQ ("ERROR: ftrace lock (") ($ VSub_Name "$flock") (") exists. It shows"))}
                    {
                      (DQ ("ftrace may be in use by PID ") 
                        (CommandSubPart
                          command_list: (CommandList children:[(C {(cat)} {($ VSub_Name "$flock")})])
                          left_token: <Left_CommandSub "$(">
                          spids: [490 494]
                        ) (.) (EscapedLiteralPart token:<Lit_EscapedChar "\\n">) ("Double check")
                      )
                    }
                    {(DQ ("to see if that PID is still active. If not, consider"))}
                    {(DQ ("using -f to force a reset. Exiting."))}
                  ]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[477])]
                )
                (C {(exit)} {(1)})
              ]
              spids: [470 518]
            )
          ]
          spids: [-1 447]
        )
      ]
      spids: [-1 520]
    )
    (C {(vecho)} {(DQ ("Reseting ftrace state..."))})
    (C {(vecho)})
    (AndOr
      children: [
        (C {(cd)} {($ VSub_Name "$tracing")})
        (C {(die)} {(DQ ("ERROR: accessing tracing. Root user? Kernel has FTRACE?"))})
      ]
      op_id: Op_DPipe
    )
    (C {(writefile)} {(current_tracer)} {(nop)})
    (C {(writefile)} {(set_ftrace_filter)})
    (C {(writefile)} {(set_graph_function)})
    (C {(writefile)} {(set_ftrace_pid)})
    (C {(writefile)} {(events/enable)} {(0)})
    (C {(writefile)} {(tracing_thresh)} {(0)})
    (C {(writefile)} {(kprobe_events)})
    (C {(writefile)} {(tracing_on)} {(1)})
    (C {(vecho)} {(DQ (Done.))})
  ]
)