eclipse-openj9 / openj9-utils

Other
16 stars 29 forks source link

Fix MethodEnter support for Perf Agent #49

Closed mpirvu closed 3 years ago

mpirvu commented 3 years ago

In order to enable method tracing we need to set the can_generate_method_entry_events capability. For some reason this capability can be enabled only during the OnLoad phase. Therefore, the agent must be loaded from the very beginning, and late attach will not do.

This commit also adds the ability to print the stack trace up to the specified depth.

Examples of commands:

  {
    "functionality": "methodEntryEvents",
    "command": "start",
    "delay": 1,
    "stackTraceDepth": 5
  },
  {
    "functionality": "methodEntryEvents",
    "command": "stop",
    "delay": 5
  }

Signed-off-by: Marius Pirvu mpirvu@ca.ibm.com

mpirvu commented 3 years ago

@dsouzai Could you please review this PR? Thanks

dsouzai commented 3 years ago

@mpirvu just waiting for the declaration of setMethodEntrySampleRate to be removed from methodEntry.hpp before I merge.

mpirvu commented 3 years ago

@dsouzai I deleted the stale declaration of setMethodEntrySampleRate and corrected a couple of places where sendToServer is called to add a second parameter (event type), which is needed after #37 was merged.