환경변수 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,288
13년 전 조회 752
13년 전 조회 697
13년 전 조회 754
13년 전 조회 1,136
13년 전 조회 2,326
13년 전 조회 823
13년 전 조회 1,840
13년 전 조회 1,920
13년 전 조회 2,174
13년 전 조회 910
13년 전 조회 1,195
13년 전 조회 923
13년 전 조회 1,043
13년 전 조회 957
13년 전 조회 798
13년 전 조회 930
13년 전 조회 999
13년 전 조회 1,068
13년 전 조회 1,900
13년 전 조회 601
13년 전 조회 970
13년 전 조회 739
13년 전 조회 544
13년 전 조회 1,005
13년 전 조회 3,004
13년 전 조회 2,074
13년 전 조회 1,655
13년 전 조회 600
13년 전 조회 1,226
13년 전 조회 2,072
13년 전 조회 1,197
13년 전 조회 1,214
13년 전 조회 962
13년 전 조회 1,143
13년 전 조회 2,135
13년 전 조회 630
13년 전 조회 995
13년 전 조회 2,297
13년 전 조회 1,110
13년 전 조회 683
13년 전 조회 1,138
13년 전 조회 960
13년 전 조회 1,019
13년 전 조회 1,284
13년 전 조회 2,080
13년 전 조회 1,205
13년 전 조회 1,552
13년 전 조회 669
13년 전 조회 722
13년 전 조회 654
13년 전 조회 595
13년 전 조회 895
13년 전 조회 936
13년 전 조회 634
13년 전 조회 875
13년 전 조회 1,450
13년 전 조회 691
13년 전 조회 1,502
13년 전 조회 562
13년 전 조회 803
13년 전 조회 580
13년 전 조회 807
13년 전 조회 658
13년 전 조회 1,000
13년 전 조회 1,049
13년 전 조회 948
13년 전 조회 2,788
13년 전 조회 572
13년 전 조회 828
13년 전 조회 727
13년 전 조회 1,199
13년 전 조회 947
13년 전 조회 1,592
13년 전 조회 1,934
13년 전 조회 1,289
13년 전 조회 3,150
13년 전 조회 1,440
13년 전 조회 810
13년 전 조회 2,240
13년 전 조회 2,676
13년 전 조회 539
13년 전 조회 656
13년 전 조회 571
13년 전 조회 666
13년 전 조회 588
13년 전 조회 805
13년 전 조회 2,057
13년 전 조회 545
13년 전 조회 530
13년 전 조회 675
13년 전 조회 638
13년 전 조회 527
13년 전 조회 855
13년 전 조회 786
13년 전 조회 545
13년 전 조회 546
13년 전 조회 1,535
13년 전 조회 782
13년 전 조회 1,180