# File lib/new_relic/agent/instrumentation/controller_instrumentation.rb, line 341
        def perform_action_with_newrelic_trace(*args, &block) #THREAD_LOCAL_ACCESS
          state = NewRelic::Agent::TransactionState.tl_get
          state.request = newrelic_request(args)

          skip_tracing = do_not_trace? || !state.is_execution_traced?

          if skip_tracing
            state.current_transaction.ignore! if state.current_transaction
            NewRelic::Agent.disable_all_tracing { return yield }
          end

          # This method has traditionally taken a variable number of arguments, but the
          # only one that is expected / used is a single options hash.  We are preserving
          # the *args method signature to ensure backwards compatibility.

          trace_options = args.last.is_a?(Hash) ? args.last : NR_DEFAULT_OPTIONS
          category      = trace_options[:category] || :controller
          txn_options   = create_transaction_options(trace_options, category, state)

          begin
            txn = Transaction.start(state, category, txn_options)

            begin
              yield
            rescue => e
              NewRelic::Agent.notice_error(e)
              raise
            end

          ensure
            if txn
              txn.ignore_apdex!   if ignore_apdex?
              txn.ignore_enduser! if ignore_enduser?
            end
            Transaction.stop(state)
          end
        end