환경변수 path 를 확인하여 스크립트 속도향상하기

strace -o output -fp <실행할려고하는 스크립트 pid>
 
grep "No such file" output > output1
 
 
예시)
 
아래 예시는 ls -al 실행하고 10초 쉬고 다시 ls -al 실행하는 쉡스크립트입니다.
 
 
[root@oracle ~]# cat test.sh 
#!/bin/sh
 
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
 
[root@oracle ~]# ps -ef | grep test.sh | grep -v grep
root      3567 16338  0 15:09 pts/4    00:00:00 /bin/sh ./test.sh
 
[root@oracle ~]# strace -o output -fp 3567
 
ctrl + c 를 눌러 중지.
 
grep "No such file" output > output1
 
[root@oracle ~]# cat output1
3618  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US.UTF-8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US.utf8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en.UTF-8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en.utf8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3618  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3618  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3618  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3619  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
3620  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US.UTF-8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US.utf8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en.UTF-8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en.utf8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3620  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3620  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3620  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3621  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
 
 
|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
13년 전 조회 1,126
13년 전 조회 598
13년 전 조회 523
13년 전 조회 599
13년 전 조회 965
13년 전 조회 2,174
13년 전 조회 661
13년 전 조회 1,678
13년 전 조회 1,759
13년 전 조회 2,006
13년 전 조회 764
13년 전 조회 1,031
13년 전 조회 759
13년 전 조회 878
13년 전 조회 787
13년 전 조회 649
13년 전 조회 764
13년 전 조회 838
13년 전 조회 909
13년 전 조회 1,722
13년 전 조회 431
13년 전 조회 806
13년 전 조회 580
13년 전 조회 383
13년 전 조회 841
13년 전 조회 2,854
13년 전 조회 1,919
13년 전 조회 1,479
13년 전 조회 441
13년 전 조회 1,067
13년 전 조회 1,908
13년 전 조회 1,043
13년 전 조회 1,067
13년 전 조회 806
13년 전 조회 983
13년 전 조회 1,981
13년 전 조회 483
13년 전 조회 845
13년 전 조회 2,142
13년 전 조회 960
13년 전 조회 523
13년 전 조회 967
13년 전 조회 809
13년 전 조회 866
13년 전 조회 1,130
13년 전 조회 1,917
13년 전 조회 1,043
13년 전 조회 1,399
13년 전 조회 497
13년 전 조회 559
13년 전 조회 486
13년 전 조회 434
13년 전 조회 732
13년 전 조회 776
13년 전 조회 457
13년 전 조회 713
13년 전 조회 1,300
13년 전 조회 525
13년 전 조회 1,333
13년 전 조회 402
13년 전 조회 646
13년 전 조회 419
13년 전 조회 657
13년 전 조회 504
13년 전 조회 848
13년 전 조회 899
13년 전 조회 784
13년 전 조회 2,628
13년 전 조회 405
13년 전 조회 668
13년 전 조회 574
13년 전 조회 1,068
13년 전 조회 797
13년 전 조회 1,438
13년 전 조회 1,784
13년 전 조회 1,126
13년 전 조회 2,998
13년 전 조회 1,279
13년 전 조회 660
13년 전 조회 2,079
13년 전 조회 2,519
13년 전 조회 380
13년 전 조회 516
13년 전 조회 412
13년 전 조회 513
13년 전 조회 455
13년 전 조회 651
13년 전 조회 1,899
13년 전 조회 374
13년 전 조회 374
13년 전 조회 518
13년 전 조회 484
13년 전 조회 377
13년 전 조회 691
13년 전 조회 634
13년 전 조회 388
13년 전 조회 403
13년 전 조회 1,369
13년 전 조회 644
13년 전 조회 1,027
🐛 버그신고