OProfile.pdf
사용방법
$ uanme -r
3.10.0-693.11.1.el7.x86_64
# 1. vmlinux 커널 이미지가 필요함 (압축된 커널 이미지인 vmlinuz 는 안됨)
$ sudo opcontrol --vmlinux=/boot/vmlinux-3.10.0-693.11.1.el7.x86_64
# 커널레벨 프로파일을 하지 않으려면 --no-vmlinux 를 사용
$ sudo opcontrol --no-vmlinux
# 2. 프로파일 시작
$ sudo opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
# 프로파일링...
# 3. 프로파일 기록
$ sudo opcontrol --dump
# 4. 프로파일 초기화
$ sudo opcontrol --reset
Signalling daemon... done
# 5. 프로파일 중지
$ sudo opcontrol --stop
# 6. 프로파일데몬 종료
$ sudo opcontrol --shutdown
Stopping profiling.
Killing daemon.
# 7. 프로파일 확인
$ sudo opreport
Using /var/lib/oprofile/samples/ for samples directory.
CPU: CPU with timer interrupt, speed 1997.82 MHz (estimated)
Profiling through timer interrupt
TIMER:0|
samples| %|
------------------
66778 99.9491 no-vmlinux
16 0.0239 libc-2.17.so
6 0.0090 ld-2.17.so
5 0.0075 bash
2 0.0030 libNimmConnector.so
2 0.0030 oprofiled
2 0.0030 libsudo_util.so.0.0.0
1 0.0015 cp
$ sudo opreport -c
Using /var/lib/oprofile/samples/ for samples directory.
warning: /no-vmlinux could not be found.
CPU: CPU with timer interrupt, speed 1997.82 MHz (estimated)
Profiling through timer interrupt
samples % app name symbol name
-------------------------------------------------------------------------------
158920 99.9541 no-vmlinux /no-vmlinux
158920 100.000 no-vmlinux /no-vmlinux [self]
-------------------------------------------------------------------------------
15 0.0094 bash /usr/bin/bash
15 100.000 bash /usr/bin/bash [self]
-------------------------------------------------------------------------------
8 0.0050 oprofiled /usr/bin/oprofiled
8 100.000 oprofiled /usr/bin/oprofiled [self]
-------------------------------------------------------------------------------
4 0.0025 ld-2.17.so do_lookup_x
4 100.000 ld-2.17.so do_lookup_x [self]
-------------------------------------------------------------------------------
4 0.0025 libc-2.17.so _dl_addr
4 100.000 libc-2.17.so _dl_addr [self]
-------------------------------------------------------------------------------
4 0.0025 libc-2.17.so _int_free
4 100.000 libc-2.17.so _int_free [self]
-------------------------------------------------------------------------------
3 0.0019 libc-2.17.so _IO_vfscanf
3 100.000 libc-2.17.so _IO_vfscanf [self]
-------------------------------------------------------------------------------
2 0.0013 libc-2.17.so __memcpy_ssse3
2 100.000 libc-2.17.so __memcpy_ssse3 [self]
-------------------------------------------------------------------------------
2 0.0013 libc-2.17.so _int_malloc
2 100.000 libc-2.17.so _int_malloc [self]
-------------------------------------------------------------------------------
2 0.0013 libc-2.17.so mbrtoc32
2 100.000 libc-2.17.so mbrtoc32 [self]
-------------------------------------------------------------------------------
2 0.0013 libsudo_util.so.0.0.0 /usr/libexec/sudo/libsudo_util.so.0.0.0
2 100.000 libsudo_util.so.0.0.0 /usr/libexec/sudo/libsudo_util.so.0.0.0 [self]
-------------------------------------------------------------------------------
1 6.3e-04 cp /usr/bin/cp
1 100.000 cp /usr/bin/cp [self]
-------------------------------------------------------------------------------
1 6.3e-04 dbus-daemon /usr/bin/dbus-daemon
1 100.000 dbus-daemon /usr/bin/dbus-daemon [self]
-------------------------------------------------------------------------------
1 6.3e-04 ld-2.17.so _dl_map_object_from_fd
1 100.000 ld-2.17.so _dl_map_object_from_fd [self]
-------------------------------------------------------------------------------
1 6.3e-04 ld-2.17.so _dl_relocate_object
1 100.000 ld-2.17.so _dl_relocate_object [self]
-------------------------------------------------------------------------------
1 6.3e-04 ld-2.17.so check_match.9515
1 100.000 ld-2.17.so check_match.9515 [self]
-------------------------------------------------------------------------------
1 6.3e-04 ld-2.17.so strcmp
1 100.000 ld-2.17.so strcmp [self]
-------------------------------------------------------------------------------
1 6.3e-04 libNimmConnector.so _NANO_VERSION_1_6_4_h1_::InterlockedExchangeAdd(int volatile*, int)
1 100.000 libNimmConnector.so _NANO_VERSION_1_6_4_h1_::InterlockedExchangeAdd(int volatile*, int) [self]
-------------------------------------------------------------------------------
1 6.3e-04 libNimmConnector.so nimm::box::DefaultReactor::_onIdleCheck() const
1 100.000 libNimmConnector.so nimm::box::DefaultReactor::_onIdleCheck() const [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so _IO_file_init@@GLIBC_2.2.5
1 100.000 libc-2.17.so _IO_file_init@@GLIBC_2.2.5 [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so _IO_str_init_static_internal
1 100.000 libc-2.17.so _IO_str_init_static_internal [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so __GI_strlen
1 100.000 libc-2.17.so __GI_strlen [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so __gconv_transform_utf8_internal
1 100.000 libc-2.17.so __gconv_transform_utf8_internal [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so __memset_sse2
1 100.000 libc-2.17.so __memset_sse2 [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so __read_nocancel
1 100.000 libc-2.17.so __read_nocancel [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so _int_realloc
1 100.000 libc-2.17.so _int_realloc [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so build_trtable
1 100.000 libc-2.17.so build_trtable [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so fileno
1 100.000 libc-2.17.so fileno [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so fread
1 100.000 libc-2.17.so fread [self]
-------------------------------------------------------------------------------
1 6.3e-04 libc-2.17.so free
1 100.000 libc-2.17.so free [self]