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

· 13년 전 · 1739
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,385
13년 전 조회 1,831
13년 전 조회 1,792
13년 전 조회 1,820
13년 전 조회 2,208
13년 전 조회 3,414
13년 전 조회 1,892
13년 전 조회 2,920
13년 전 조회 2,964
13년 전 조회 3,282
13년 전 조회 1,981
13년 전 조회 2,298
13년 전 조회 1,994
13년 전 조회 2,101
13년 전 조회 2,004
13년 전 조회 1,881
13년 전 조회 1,983
13년 전 조회 2,059
13년 전 조회 2,143
13년 전 조회 2,955
13년 전 조회 1,648
13년 전 조회 2,015
13년 전 조회 1,805
13년 전 조회 1,579
13년 전 조회 2,019
13년 전 조회 4,026
13년 전 조회 3,101
13년 전 조회 2,685
13년 전 조회 1,656
13년 전 조회 2,273
13년 전 조회 3,137
13년 전 조회 2,234
13년 전 조회 2,287
13년 전 조회 2,008
13년 전 조회 2,166
13년 전 조회 3,187
13년 전 조회 1,689
13년 전 조회 2,028
13년 전 조회 3,346
13년 전 조회 2,135
13년 전 조회 1,722
13년 전 조회 2,212
13년 전 조회 2,028
13년 전 조회 2,046
13년 전 조회 2,340
13년 전 조회 3,142
13년 전 조회 2,065
13년 전 조회 2,618
13년 전 조회 1,722
13년 전 조회 1,740
13년 전 조회 1,676
13년 전 조회 1,638
13년 전 조회 1,928
13년 전 조회 1,990
13년 전 조회 1,676
13년 전 조회 1,938
13년 전 조회 2,489
13년 전 조회 1,742
13년 전 조회 2,522
13년 전 조회 1,603
13년 전 조회 1,803
13년 전 조회 1,613
13년 전 조회 1,833
13년 전 조회 1,672
13년 전 조회 2,000
13년 전 조회 2,047
13년 전 조회 1,953
13년 전 조회 3,770
13년 전 조회 1,569
13년 전 조회 1,811
13년 전 조회 1,682
13년 전 조회 2,179
13년 전 조회 1,921
13년 전 조회 2,577
13년 전 조회 2,920
13년 전 조회 2,245
13년 전 조회 4,165
13년 전 조회 2,424
13년 전 조회 1,766
13년 전 조회 3,233
13년 전 조회 3,634
13년 전 조회 1,487
13년 전 조회 1,619
13년 전 조회 1,540
13년 전 조회 1,641
13년 전 조회 1,540
13년 전 조회 1,814
13년 전 조회 3,042
13년 전 조회 1,481
13년 전 조회 1,473
13년 전 조회 1,620
13년 전 조회 1,601
13년 전 조회 1,507
13년 전 조회 1,795
13년 전 조회 1,731
13년 전 조회 1,485
13년 전 조회 1,514
13년 전 조회 2,529
13년 전 조회 1,689
13년 전 조회 2,086