class_docstr: Core :py:class:`.PluginManager` class which manages registration
  of plugin objects and 1:N hook calling.
  
  You can register new hooks by calling :py:meth:`add_hookspecs(module_or_class)
  <.PluginManager.add_hookspecs>`.
  You can register plugin objects (which contain hooks) by calling
  :py:meth:`register(plugin) <.PluginManager.register>`.  The :py:class:`.PluginManager`
  is initialized with a prefix that is searched for in the names of the dict
  of registered plugin objects.
  
  For debugging purposes you can call :py:meth:`.PluginManager.enable_tracing`
  which will subsequently send debug information to the trace helper.
docstr: add before/after tracing functions for all hooks
  and return an undo function which, when called,
  will remove the added tracers.
  
  ``before(hook_name, hook_impls, kwargs)`` will be called ahead
  of all hook calls and receive a hookcaller instance, a list
  of HookImpl instances and the keyword arguments for the hook call.
  
  ``after(outcome, hook_name, hook_impls, kwargs)`` receives the
  same arguments as ``before`` but also a :py:class:`pluggy.callers._Result` object
  which represents the result of the overall hook call.
docstr_tok: ["add","before\/after","tracing","functions","for","all","hooks","and","return","an","undo","function","which",",","when","called",",","will","remove","the","added","tracers",".","``","before","(","hook_name",",","hook_impls",",","kwargs",")","``","will","be","called","ahead","of","all","hook","calls","and","receive","a","hookcaller","instance",",","a","list","of","HookImpl","instances","and","the","keyword","arguments","for","the","hook","call",".","``","after","(","outcome",",","hook_name",",","hook_impls",",","kwargs",")","``","receives","the","same","arguments","as","``","before","``","but","also","a",":","py",":","class",":","`","pluggy.callers._Result","`","object","which","represents","the","result","of","the","overall","hook","call","."]
code: def add_hookcall_monitoring(self, before, after):
      """add before/after tracing functions for all hooks
      and return an undo function which, when called,
      will remove the added tracers.
  
      ``before(hook_name, hook_impls, kwargs)`` will be called ahead
      of all hook calls and receive a hookcaller instance, a list
      of HookImpl instances and the keyword arguments for the hook call.
  
      ``after(outcome, hook_name, hook_impls, kwargs)`` receives the
      same arguments as ``before`` but also a :py:class:`pluggy.callers._Result` object
      which represents the result of the overall hook call.
      """
      oldcall = self._inner_hookexec
  
      def traced_hookexec(hook, hook_impls, kwargs):
          before(hook.name, hook_impls, kwargs)
          outcome = _Result.from_call(
              lambda: oldcall(hook, hook_impls, kwargs)
          )
          after(outcome, hook.name, hook_impls, kwargs)
          return outcome.get_result()
  
      self._inner_hookexec = traced_hookexec
  
      def undo():
          self._inner_hookexec = oldcall
  
      return undo
  
imports: import inspect
  import sys
  from .None import _tracing
  from .callers import _Result
  from .hooks import HookImpl, _HookRelay, _HookCaller, normalize_hookimpl_opts
  import warnings
label_desc: Use image node_id 22 for calling the PluginManager obj's underlying member method code with example usage: obj.add_hookcall_monitoring(before, after) and returns: undo, outcome