#222 JIT profiling with oprofile fails when PID is > 32768

None
closed-fixed
None
5
2013-07-29
2012-09-24
Maynard Johnson
No

When using the libjvmti_oprofile.so java agent library to profile a Java app, a <pid>.dump file is created that stores information about the JITed code. The opjitconv program is supposed to use that <pid>.dump file to create an ELF-like file named <pid>.jo, which is the binary file against which samples are attributed by opreport. But if the process ID is greater than the Linux default of 32768, opjitconv fails to create the <pid>.jo, so all samples are attributed to the java anon memory mappings, and there is no visibility to the java methods (symbols) that were JITed.

The find_anon_dir_match() function in opjitconv/opjitconv.c should create a larger char array for holding the match filter. The array should be large enough to hold the largest possible process ID, plus the rest of the match filter.

Discussion

  • I was able to use opjitconv w/ PIDs greater than 5 digits w/ this fix.
    It works.
    Thanks.

     
    • status: open --> open-fixed
     
  • Thanks for testing the fix. I pushed the patch upstream.

     
    • status: open-fixed --> closed-fixed
    • Group: -->