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

· 13년 전 · 1690
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년 전 조회 2,333
13년 전 조회 1,776
13년 전 조회 1,732
13년 전 조회 1,770
13년 전 조회 2,151
13년 전 조회 3,365
13년 전 조회 1,829
13년 전 조회 2,867
13년 전 조회 2,906
13년 전 조회 3,226
13년 전 조회 1,918
13년 전 조회 2,242
13년 전 조회 1,932
13년 전 조회 2,049
13년 전 조회 1,942
13년 전 조회 1,817
13년 전 조회 1,934
13년 전 조회 2,001
13년 전 조회 2,100
13년 전 조회 2,908
13년 전 조회 1,600
13년 전 조회 1,960
13년 전 조회 1,755
13년 전 조회 1,530
13년 전 조회 1,963
13년 전 조회 3,970
13년 전 조회 3,043
13년 전 조회 2,637
13년 전 조회 1,601
13년 전 조회 2,223
13년 전 조회 3,091
13년 전 조회 2,185
13년 전 조회 2,246
13년 전 조회 1,962
13년 전 조회 2,121
13년 전 조회 3,125
13년 전 조회 1,633
13년 전 조회 1,978
13년 전 조회 3,298
13년 전 조회 2,079
13년 전 조회 1,667
13년 전 조회 2,144
13년 전 조회 1,978
13년 전 조회 1,997
13년 전 조회 2,295
13년 전 조회 3,086
13년 전 조회 2,049
13년 전 조회 2,566
13년 전 조회 1,662
13년 전 조회 1,691
13년 전 조회 1,638
13년 전 조회 1,568
13년 전 조회 1,871
13년 전 조회 1,929
13년 전 조회 1,613
13년 전 조회 1,890
13년 전 조회 2,430
13년 전 조회 1,678
13년 전 조회 2,466
13년 전 조회 1,558
13년 전 조회 1,741
13년 전 조회 1,566
13년 전 조회 1,779
13년 전 조회 1,611
13년 전 조회 1,943
13년 전 조회 1,990
13년 전 조회 1,897
13년 전 조회 3,719
13년 전 조회 1,517
13년 전 조회 1,763
13년 전 조회 1,631
13년 전 조회 2,120
13년 전 조회 1,870
13년 전 조회 2,520
13년 전 조회 2,874
13년 전 조회 2,192
13년 전 조회 4,111
13년 전 조회 2,359
13년 전 조회 1,698
13년 전 조회 3,164
13년 전 조회 3,578
13년 전 조회 1,430
13년 전 조회 1,568
13년 전 조회 1,498
13년 전 조회 1,589
13년 전 조회 1,485
13년 전 조회 1,757
13년 전 조회 2,980
13년 전 조회 1,439
13년 전 조회 1,432
13년 전 조회 1,570
13년 전 조회 1,551
13년 전 조회 1,457
13년 전 조회 1,748
13년 전 조회 1,695
13년 전 조회 1,430
13년 전 조회 1,466
13년 전 조회 2,465
13년 전 조회 1,644
13년 전 조회 2,036