Open paranlee opened 1 year ago
Add options --debug-domain kernel:3
.
# ./uftrace -k --libmcount-path=. --debug-domain kernel:3 ./read
kernel: setting up kernel tracing
kernel: writing filter file failed, but ignoring...
kernel: writing filter file failed, but ignoring...
kernel: writing filter file failed, but ignoring...
kernel: writing filter file failed, but ignoring...
kernel: writing filter file failed, but ignoring...
kernel: kernel tracing started..
0-3
kernel: kernel tracing stopped.
WARN: record kernel data (cpu 4) failed: No such device
kernel: found kernel ftrace data for 128 cpus
# DURATION TID FUNCTION
0.829 us [ 2285] | __monstartup();
0.233 us [ 2285] | __cxa_atexit();
[ 2285] | main() {
60.538 us [ 2285] | fopen();
22.987 us [ 2285] | fgetc();
9.420 us [ 2285] | putchar();
0.145 us [ 2285] | fgetc();
0.166 us [ 2285] | putchar();
0.092 us [ 2285] | fgetc();
0.119 us [ 2285] | putchar();
0.095 us [ 2285] | fgetc();
[ 2285] | putchar() {
345.883 us [ 2285] | /* linux:schedule (pre-empted) */
167.730 us [ 2285] | /* linux:schedule (pre-empted) */
682.194 us [ 2285] | } /* putchar */
16.459 us [ 2285] | fclose();
796.131 us [ 2285] | } /* main */
uftrace stopped tracing with remaining functions
================================================
task: 2285
[0] find_vma
커널 트레이싱을 개선하고 싶은데
uftrace
코드의 어떤 루틴을 연구하고 비교 접근하면 좋을지 문의 드려도 괜찮을까요?트레이싱한 C 프로그램
read.c
의 코드는 다음과 같습니다. 하는 동작은# cat /sys/devices/system/cpu/online
할 때와 유사하게 동작하도록 작성했습니다.제가 직접 ftrace 를 활용한 hook 을 사용한 커널 모듈로 확인했을 때는 아래의 콜 스택을 확인했습니다.
해당 드라이버 함수는 다음과 같습니다.
dmesg 로그