Linux_system

strace : 어떠한 system call 이 호출되었는가?

AI Coder 2022. 8. 19. 20:35

//hello.c

 

#include <stdio.h>

 

int main(void)

{

   puts("hello world");

   return 0;

}

 

>gcc -o hello ./hello.c

>strace -o hello.log ./hello

>cat hello.log

 

printf("hello world %s\n","Man");

 

각종 system call 처리에 걸린 시간을 microsecond 단위로 정밀하가 측정하여 보여 준다. 

>strace -T -o hello.log ./hello 

"hello world\n" 문자 처리에 32 microsecond 가 걸렸음을 알 수 있다. 

 

 

출처 : 실습과 그림으로 배우는 리눅스 구조 , 다케우치 사토루저

'Linux_system' 카테고리의 다른 글

Linux Memory 관리  (0) 2022.08.19
sar : 프로세스(CPU core) 가 어떤 mode 로 작업 중인가?  (0) 2022.08.19
이 분야의 필독서 / 필독 사이트  (0) 2022.08.19
c++ Linux compile  (0) 2022.08.19
size_t 와 string::size_type  (0) 2022.08.19