MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / testFlow4

Function testFlow4

test/test/nonjava/non_java_app.cpp:337–352  ·  view source on GitHub ↗

Here is the flow of the test: 1. Load the profiler 2. Load the JVM library 3. Start the JVM on a different thread 4. Start the profiler 5. Execute the JVM task 6. Stop the profiler 7. Stop the JVM Expected output: The profiler should be able to profile the JVM task. Explanation: The same as flow 1, except that profiler will have to attach the caller thread to the JVM. */

Source from the content-addressed store, hash-verified

335The same as flow 1, except that profiler will have to attach the caller thread to the JVM.
336*/
337void testFlow4(int argc, char** argv) {
338 struct timespec wait_time = {(time_t)(2), 0L};
339
340 loadProfiler();
341
342 pthread_t thread;
343 pthread_create(&thread, NULL, jvmThreadWrapper, NULL);
344
345 nanosleep(&wait_time, NULL);
346
347 startProfiler();
348
349 nanosleep(&wait_time, NULL);
350
351 stopProfiler(argv[2]);
352}
353
354int main(int argc, char** argv) {
355 validateArgsCount(argc, 3);

Callers 1

mainFunction · 0.85

Calls 4

loadProfilerFunction · 0.85
pthread_createFunction · 0.85
startProfilerFunction · 0.85
stopProfilerFunction · 0.85

Tested by

no test coverage detected