-
Notifications
You must be signed in to change notification settings - Fork 453
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
[VL] Need Clarification on Java/Scala to Native C++ Handover and Profiling Native C++ Files #8419
Comments
https://github.com/apache/incubator-gluten/tree/main/cpp/core/jni is the place where java call c++ if your gluten is running, from perf you can see the hotspot of velox functions |
you may go through all the files in the jni folder. Any JNI call can trigger the native function. this folder is for Velox backend: |
The code used for C++ / Java communication is usually written in files that have "JniWrapper" as names or name suffixes.
Not sure, but perhaps something like this might happen when the debug symbols are missing from the profiler. Note Gluten deletes the used native library files from |
@FelixYBW Thanks. I will go through that folder to try finding the calls. |
@zhztheplayer Thanks for the response. Debug symbols were installed with this -
Is there any other command that you are aware of? I am trying to run tpch workload runs. spark.gluten.sql.debug.keepJniWorkspace=true I tried setting this flag in tpch_parquet.sh but getting an error java.util.NoSuchElementException: spark.gluten.sql.debug.keepJniWorkspaceDir Should this flag be added somewhere else? |
@ajeyabsfujitsu you should set |
Thanks Vaibhav. |
@zhztheplayer I tried setting the |
Based on your suggestions, I analyzed the file "Jniwrapper" to trace the Java calls that callback to C++. However, I noticed that most of the Gluten functions are pointing to Scala files rather than Java, which should ultimately lead to the Jniwrapper. I would like to understand the flow of Gluten functions that transition from Java to C++. Could you please guide me on which folders and files I should refer to for better clarity? |
Description
I am exploring the incubator-gluten repository and trying to understand how Java/Scala code interacts with the native C++ code. However, I am having difficulty identifying where and how this handover happens within the codebase.
An explanation on this process would be extremely helpful.
Java/Scala to C++ Handover - I want to know the specific parts of the codebase where Java/Scala calls are handed over to native C++ code. I’m unable to locate the key files or classes where this interaction is defined. If there are specific entry points or patterns used for this handover, please provide details.
Profiling C++ Code - I’m attempting to use perf to profile the execution and see which C++ functions or files are being called. However, the perf output only shows functions from jibjvm.so or libc.so, and no Gluten or Velox-specific C++ functions are visible. Are there additional configurations or profiling tools recommended for this?
The text was updated successfully, but these errors were encountered: