honggyukim / uftrace

Function graph tracer for C/C++/Rust/Python
https://uftrace.github.io/slide/
GNU General Public License v2.0
1 stars 0 forks source link

uftrace for uftrace #12

Open honggyukim opened 5 years ago

honggyukim commented 5 years ago
$ uftrace -P. -t 30ms ./uftrace record t-abc
# DURATION     TID     FUNCTION
            [189150] | main() {
            [189150] |   command_record() {
            [189150] |     create_directory() {
            [189150] |       can_remove_directory() {
            [189150] |         read() {
  81.503 ms [189150] |           /* linux:schedule */
  81.532 ms [189150] |         } /* read */
  81.555 ms [189150] |       } /* can_remove_directory */
            [189150] |       remove_directory() {
            [189150] |         readdir() {
  96.656 ms [189150] |           /* linux:schedule */
  96.746 ms [189150] |         } /* readdir */
 123.680 ms [189150] |       } /* remove_directory */
 205.425 ms [189150] |     } /* create_directory */
            [189150] |     do_main_loop() {
            [189164] | } /* fork */
            [189164] | do_child_exec() {
            [189164] |   execv() {
            [189150] |       finish_writers() {
  85.261 ms [189150] |         scandir();
  88.278 ms [189150] |       } /* finish_writers */
            [189150] |       load_module_symtabs() {
  56.185 ms [189150] |         load_module_symtab();
  97.776 ms [189150] |       } /* load_module_symtabs */
 216.023 ms [189150] |     } /* do_main_loop */
 422.099 ms [189150] |   } /* command_record */
 422.242 ms [189150] | } /* main */
honggyukim commented 5 years ago
$ uftrace -P. -t 25ms -a ./uftrace record t-abc ;
# DURATION     TID     FUNCTION
            [190030] | main(3, 0x7ffdb5bbb7b8) {
            [190030] |   command_record(1, 0x7ffdb5bbb7c8, 0x7ffdb5bbb570) {
            [190030] |     do_main_loop(4, 0x7ffdb5bbb570, 0x2e659) {
            [190041] | } = 0; /* fork */
            [190041] | do_child_exec(4, 0x7ffdb5bbb570, 1, 0x7ffdb5bbb7c8) {
            [190042] | writer_thread(0x2520790) {
            [190042] |   /* linux:task-name (name=WriterThread) */
            [190042] |   handle_pollfd(0x7f8d48116900, 0x2520790, 1, 1, 0, 1000) {
            [190042] |     poll(0x7f8d48116900, 5, 1000) {
            [190042] |       /* linux:sched-out */
            [190043] | writer_thread(0x2520ad0) {
            [190043] |   /* linux:task-name (name=WriterThread) */
            [190041] |   execv("t-abc") {
  25.152 ms [190042] |       /* linux:sched-in */
  25.283 ms [190042] |     } = 4; /* poll */
  25.290 ms [190042] |   } = 0; /* handle_pollfd */
            [190030] |       finish_writers(0x7ffdb5bbb190, 0x7ffdb5bbb570) {
  25.162 ms [190043] | } = 0; /* writer_thread */
  25.504 ms [190042] | } = 0; /* writer_thread */
 101.071 ms [190030] |         scandir();
 104.237 ms [190030] |       } /* finish_writers */
            [190030] |       load_module_symtabs(0x7ffdb5bbb150) {
  79.944 ms [190030] |         load_module_symtab(0x7ffdb5bbb150, "/lib/x86_64-linux-gnu/libc-2.23.so") = 0x25519f0;
 137.825 ms [190030] |       } /* load_module_symtabs */
 279.637 ms [190030] |     } = 0; /* do_main_loop */
 282.197 ms [190030] |   } = 0; /* command_record */
 282.716 ms [190030] | } = 0; /* main */