This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 91642 [details] zip of a NB project containing the sample The attached NB project uses a single class for both the application's main class and also a Java agent's premain class. The profile can connect to the VM, and judging from the output emitted by the profiling logging in the app it does so before the agent starts. But the collected data shows none of the processing that occurs in the Java agent. Build the attached project. Get the extra VM args to use the 'direct' attach method. Then use java -agentpath:as-netbeans-says -javaagent:AgentProfileTest.jar=14000 -jar AgentProfileTest.jar Note that the VM stalls waiting for the profiler to connect before the agent starts, then the profile log messages appear, then the agent's greeting appears, then the main program runs. When the VM ends and the profiler in NB asks to gather final stats, say yes. The stats show only the activity from the main class invocation. No activity from the agent is reported.
By the way, here is the output from my run: java -agentpath:/var/folders/dN/dNVGJ-QqF1axQMnvTbGncE+++TI/-Tmp-/NBProfiler3168080359046112041.link/deployed/jdk16/mac/libprofilerinterface.jnilib=/var/folders/dN/dNVGJ-QqF1axQMnvTbGncE+++TI/-Tmp-/NBProfiler3168080359046112041.link,5140 -javaagent:"/Users/Tim/asgroup/NBProjects/AgentProfileTest/dist/AgentProfileTest.jar"=10000 -jar "/Users/Tim/asgroup/NBProjects/AgentProfileTest/dist/AgentProfileTest.jar" Profiler Agent: Initializing... Profiler Agent: Options: >/var/folders/dN/dNVGJ-QqF1axQMnvTbGncE+++TI/-Tmp-/NBProfiler3168080359046112041.link,5140< Profiler Agent: Initialized succesfully Profiler Agent: Waiting for connection on port 5140 (Protocol version: 9) Profiler Agent: Established local connection with the tool Profiler Agent: Redefining 100 classes at idx 0, out of total 757 Profiler Agent: Redefining 100 classes at idx 100, out of total 757 Profiler Agent: Redefining 100 classes at idx 200, out of total 757 Profiler Agent: Redefining 100 classes at idx 300, out of total 757 Profiler Agent: Redefining 100 classes at idx 400, out of total 757 Profiler Agent: Redefining 100 classes at idx 500, out of total 757 Profiler Agent: Redefining 100 classes at idx 600, out of total 757 Profiler Agent: Redefining 57 classes at idx 700, out of total 757 Agent starting 10000 iterations Main starting 10000 iterations Profiler Agent: Connection with agent closed Profiler Agent: Connection with agent closed
I am not able to reproduce it in latest dev. builds. I am able to obtain CPU profiling data from agent.