code: def test_add_tracefuncs(he_pm: PluginManager) -> None:
      out: List[Any] = []
  
      class api1:
          @hookimpl
          def he_method1(self):
              out.append("he_method1-api1")
  
      class api2:
          @hookimpl
          def he_method1(self):
              out.append("he_method1-api2")
  
      he_pm.register(api1())
      he_pm.register(api2())
  
      def before(hook_name, hook_impls, kwargs):
          out.append((hook_name, list(hook_impls), kwargs))
  
      def after(outcome, hook_name, hook_impls, kwargs):
          out.append((outcome, hook_name, list(hook_impls), kwargs))
  
      undo = he_pm.add_hookcall_monitoring(before, after)
  
      he_pm.hook.he_method1(arg=1)
      assert len(out) == 4
      assert out[0][0] == "he_method1"
      assert len(out[0][1]) == 2
      assert isinstance(out[0][2], dict)
      assert out[1] == "he_method1-api2"
      assert out[2] == "he_method1-api1"
      assert len(out[3]) == 4
      assert out[3][1] == out[0][0]
  
      undo()
      he_pm.hook.he_method1(arg=1)
      assert len(out) == 4 + 2
  
imports: import sys
  from typing import Any
  from typing import List
  import pytest
  from pluggy import HookCallError
  from pluggy import HookimplMarker
  from pluggy import HookspecMarker
  from pluggy import PluginManager
  from pluggy import PluginValidationError
label_desc: Use image node_id 26 for calling a global function with example usage: test_add_tracefuncs(he_pm) without return types