Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported event type for jvm method check_class_file_load_hook #887

Closed
qsLI opened this issue Feb 2, 2024 · 2 comments
Closed

Unsupported event type for jvm method check_class_file_load_hook #887

qsLI opened this issue Feb 2, 2024 · 2 comments

Comments

@qsLI
Copy link

qsLI commented Feb 2, 2024

async profiler version

$ ./bin/asprof -v
Async-profiler 3.0 built on Jan 20 2024

trace check_class_file_load_hook

$ ./bin/asprof -e check_class_file_load_hook -d 60 8657
[ERROR] Unsupported event type

gdb says it has this func:

(gdb) i functions check_class_file_load_hook
All functions matching regular expression "check_class_file_load_hook":

File /openjdk/src/hotspot/share/classfile/klassFactory.cpp:
static ClassFileStream *check_class_file_load_hook(ClassFileStream*, Symbol*, ClassLoaderData*, Handle, JvmtiCachedClassFileData**, JavaThread*);

nm output

$ nm /openjdk/build/linux-x86_64-server-slowdebug/jdk/lib/server/libjvm.so | grep check_class_file_load_hook
0000000000d94166 t _ZL26check_class_file_load_hookP15ClassFileStreamP6SymbolP15ClassLoaderData6HandlePP24JvmtiCachedClassFileDataP10JavaThread

jvm source code:

static ClassFileStream* check_class_file_load_hook(ClassFileStream* stream,
                                                   Symbol* name,
                                                   ClassLoaderData* loader_data,
                                                   Handle protection_domain,
                                                   JvmtiCachedClassFileData** cached_class_file,
                                                   TRAPS) {
@apangin
Copy link
Collaborator

apangin commented Feb 2, 2024

As you've found with nm, the full (unmangled) symbol name is

_ZL26check_class_file_load_hookP15ClassFileStreamP6SymbolP15ClassLoaderData6HandlePP24JvmtiCachedClassFileDataP10JavaThread

If you use this one with -e, it should work.

You don't need to specify the full name though: a prefix with a star should do the trick:

-e '_ZL26check_class_file_load_hook*'

Async-profiler does not mangle C++ function names automatically, except for simple cases like G1CollectedHeap::humongous_obj_allocate

@qsLI
Copy link
Author

qsLI commented Feb 4, 2024

As you've found with nm, the full (unmangled) symbol name is

_ZL26check_class_file_load_hookP15ClassFileStreamP6SymbolP15ClassLoaderData6HandlePP24JvmtiCachedClassFileDataP10JavaThread

If you use this one with -e, it should work.

You don't need to specify the full name though: a prefix with a star should do the trick:

-e '_ZL26check_class_file_load_hook*'

Async-profiler does not mangle C++ function names automatically, except for simple cases like G1CollectedHeap::humongous_obj_allocate

It works! Appreciate.

@qsLI qsLI closed this as completed Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants