next up previous contents index
Next: 20.5 Files Up: 20 Profiling Support: liboskit_gprof.a Previous: 20.3.3 monstartup: Start profiling

20.4 Using gprof

 

  1. Configure your sources with -enable-profiling
  2. When you link your program, link against:
    1. the _p versions of all libraries you would normally use
    2. the .po versions of all .o files you would use except crtn.o and multiboot.o (if you use them)
    3. Insert ``-loskit_gprof -loskit_kern_p -loskit_c_p'' immediately after the existing ``-loskit_kern_p -loskit_c_p.'' That's right, another instance of the kern and C libs. If you use the FreeBSD C library, do the analogous thing. If the above doesn't work, try including the libs more times (yes, this is bogus).
    4. Be sure to include the following libraries:
      • oskit_dev_p
      • oskit_lmm_p
  3. Run mkbsdimage multiboot_kernel multiboot_kernel:a.out
    or
    mkmbimage multiboot_kernel multiboot_kernel:a.out

    This step is necessary so gprof can access the kernel's symbol table via the bmodfs.

  4. Run the kernel (if created as above, it would be named Image).
  5. Profiling output will be spit out at its exit.



University of Utah Flux Research Group