如何使用 Eclipse TPTP 分析 JNI 应用程序?
我需要分析由 JNI 调用 API 从 C 应用程序启动的 java 应用程序,自然 TPTP 工具似乎是一个不错的起点。 但是,我可以启动该应用程序,但我不知道如何连接到它进行分析。 我意识到这属于“愚蠢的新手”范畴,但我真的有点迷失了。 请允许我解释一下:
我已将 JVM 选项“-XrunpiAgent:server=control
”添加到我的 java VM 启动选项中。
我已将 $ECLIPSE_HOME/plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200808290100/agent_controller/lib 添加到我的 LD_LIBRARY_PATH
正在针对 Sun Java 1.5.0_10 JVM 库运行
我 Eclipse,我有一个 Java 项目,其中包含我想要分析的代码。 我没有分析启动配置,也不知道需要做什么。
至此,我的知识就结束了; 当我启动基于 JNI 的应用程序时,它只是在 VM 启动期间停止并等待代理控制器连接。 我需要采取哪些步骤才能实现这一点并从中获取信息?
I need to profile a java application launched by the JNI invocation API from a C application, and naturally the TPTP tools seemed like a good place to start. However, I can start the application, but I have no idea how to connect to it for profiling. I realize this falls into the 'dumb newbie' bucket, but I really am kind of lost. Permit me to explain:
I have added the JVM option "-XrunpiAgent:server=controlled
" to my java VM startup options.
I have added $ECLIPSE_HOME/plugins/org.eclipse.tptp.platform.ac.linux_ia32_4.4.1.v200808290100/agent_controller/lib to my LD_LIBRARY_PATH
I am running against the Sun Java 1.5.0_10 JVM library
In Eclipse, I have a Java project that contains the code I wish to profile. I've got no profiling launch configurations, nor do I really know what needs to go into them.
It is at this point that my knowledge comes to an end; when I start my JNI-based application, it simply stops during VM startup and sits awaiting, presumably, an agent controller connection. What steps do I need to take to get this to happen, and to get information from it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我以前尝试过使用 TPTP,但始终无法正确设置。 我可以建议您尝试使用 netbeans 中包含的探查器来连接到您的应用程序。 我用它来分析带有 JNI 调用的应用程序,它对我很有帮助。 当然,所有本机代码对于探查器都是不透明的,它仅告诉您本机调用本身花费了多长时间。
我有一篇博客文章,解释了如何使用 netbeans 分析 Eclipse 应用程序(如果有帮助的话)。
I have tried to used TPTP before and I never could set it up right. I could recommend to you that you try the profiler included with netbeans to connect to your application. I've used it to profile an Application with JNI calls and it served me well. Of course, all native code is opaque to the profiler and it only tells you how long the native calls themselves took.
I have a blog entry that explains how to profile Eclipse applications using netbeans, if it helps.
您可以使用 C 分析器来分析您的 C 代码。 它需要编译到您想要分析的库中,但对于查看代码正在做什么很有用。
You can use a C profiler to profile your C code. It need to be compiled into the library you want to profile but can be useful to see what the code is doing.