Profiling Drrun by Perf

28 views
Skip to first unread message

xiaoyu he

unread,
Mar 13, 2025, 11:05:52 AMMar 13
to DynamoRIO Users

According to the instructions on page_profiling, I tried profiling drrunusing perf. The documentation mentioned that modifications to perf are required, so I downloaded the Linux kernel source code, made the necessary changes to perf, and recompiled it.

微信图片_20250313203821.png

微信图片_20250313203827.png

However, both the original perf and my modified version produce reports like the following when I run:
perf record ~/app/dynamorio/build/bin64/drrun ./math

Overhead  Command  Shared Object      Symbol                                                                                                                        
   1.42%  math     [JIT] tid 33871    [.] 0x00007f281966e1fc
   1.09%  math     [JIT] tid 33871    [.] 0x00007f2819717c94
   0.86%  math     [kernel.kallsyms]  [k] native_write_msr
   0.59%  math     [JIT] tid 33871    [.] 0x00007f2819714ec4
   0.58%  math     [JIT] tid 33871    [.] 0x00007f2819767d68
   0.45%  math     [JIT] tid 33871    [.] 0x00007f2819690c4e
   0.44%  math     [JIT] tid 33871    [.] 0x00007f28196889e3
   0.41%  math     [JIT] tid 33871    [.] 0x00007f281968e66c
   0.39%  math     [JIT] tid 33871    [.] 0x00007f281968830d
   0.37%  math     [JIT] tid 33871    [.] 0x00007f281971d480
   0.36%  math     [JIT] tid 33871    [.] 0x00007f281971d7c5
   0.36%  math     [JIT] tid 33871    [.] 0x00007f2819735366
   0.35%  math     [JIT] tid 33871    [.] 0x00007f28196846f7
   0.35%  math     [JIT] tid 33871    [.] 0x00007f2819769412
   0.35%  math     [JIT] tid 33871    [.] 0x00007f2819686213
   0.34%  math     [JIT] tid 33871    [.] 0x00007f28197379ea
   0.33%  math     [JIT] tid 33871    [.] 0x00007f281976730f
   0.33%  math     [JIT] tid 33871    [.] 0x00007f2819739242
   0.33%  math     [JIT] tid 33871    [.] 0x00007f281968c599
   0.32%  math     [JIT] tid 33871    [.] 0x00007f281973679a
   0.32%  math     [JIT] tid 33871    [.] 0x00007f2819687c0d
   0.32%  math     [JIT] tid 33871    [.] 0x00007f281968e643
   0.32%  math     [JIT] tid 33871    [.] 0x00007f281968e61e
   0.32%  math     libdynamorio.so    [.] d_r_vsscanf
   0.32%  math     libdynamorio.so    [.] d_r_parse_int

The symbols appear as [JIT] tid, which suggests that DynamoRIO is not writing runtime-generated symbols to the /tmp/ directory. How can I make these [JIT] tid entries resolve into perf_NNN.map-style symbols? The /tmp/ directory does not contain any such files.

Derek Bruening

unread,
Mar 13, 2025, 11:17:06 AMMar 13
to xiaoyu he, DynamoRIO Users
I think you've mis-interpreted our profiling page: that is talking about getting symbols for libdynamorio.so for profiling DynamoRIO's own compiled code inside its library.  It does not say you will get application symbols corresponding to dynamically generated code cache code.  If you are indeed trying to optimize DR itself, most time in the code cache is what you want to see.  You generally would start with -prof_pcs or the itimer interface to see where time is spent in general buckets.  To see code cache contents you have to use the -tracedump_* options or something like that IIRC, if traces are enabled (may not be on aarchxx).  You would have to manually map fragment tags back to application symbols as there are no provided tools for that; that's generally not something core DR cares about and is more something the drmemtrace framework would want to do (it records all the application libraries and so has key info for that).

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dynamorio-users/4a3a5604-f80b-4b10-94c7-98c0daf699e8n%40googlegroups.com.

xiaoyu he

unread,
Mar 18, 2025, 10:41:53 AMMar 18
to DynamoRIO Users
I was trying optimize DR itself indeed. And Thanks for your advice on options, that's helpful.
THANKS again for your time.

Reply all
Reply to author
Forward
0 new messages