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

· 13년 전 · 1640
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,298
13년 전 조회 1,735
13년 전 조회 1,691
13년 전 조회 1,728
13년 전 조회 2,122
13년 전 조회 3,317
13년 전 조회 1,794
13년 전 조회 2,835
13년 전 조회 2,873
13년 전 조회 3,197
13년 전 조회 1,888
13년 전 조회 2,216
13년 전 조회 1,907
13년 전 조회 2,001
13년 전 조회 1,911
13년 전 조회 1,789
13년 전 조회 1,900
13년 전 조회 1,967
13년 전 조회 2,071
13년 전 조회 2,876
13년 전 조회 1,564
13년 전 조회 1,932
13년 전 조회 1,719
13년 전 조회 1,489
13년 전 조회 1,933
13년 전 조회 3,931
13년 전 조회 3,017
13년 전 조회 2,603
13년 전 조회 1,564
13년 전 조회 2,190
13년 전 조회 3,054
13년 전 조회 2,151
13년 전 조회 2,211
13년 전 조회 1,930
13년 전 조회 2,088
13년 전 조회 3,085
13년 전 조회 1,599
13년 전 조회 1,944
13년 전 조회 3,245
13년 전 조회 2,048
13년 전 조회 1,632
13년 전 조회 2,107
13년 전 조회 1,941
13년 전 조회 1,963
13년 전 조회 2,260
13년 전 조회 3,053
13년 전 조회 2,025
13년 전 조회 2,527
13년 전 조회 1,628
13년 전 조회 1,641
13년 전 조회 1,604
13년 전 조회 1,519
13년 전 조회 1,829
13년 전 조회 1,879
13년 전 조회 1,573
13년 전 조회 1,844
13년 전 조회 2,394
13년 전 조회 1,637
13년 전 조회 2,417
13년 전 조회 1,513
13년 전 조회 1,691
13년 전 조회 1,523
13년 전 조회 1,719
13년 전 조회 1,569
13년 전 조회 1,898
13년 전 조회 1,945
13년 전 조회 1,849
13년 전 조회 3,682
13년 전 조회 1,483
13년 전 조회 1,721
13년 전 조회 1,591
13년 전 조회 2,072
13년 전 조회 1,838
13년 전 조회 2,474
13년 전 조회 2,835
13년 전 조회 2,158
13년 전 조회 4,076
13년 전 조회 2,330
13년 전 조회 1,661
13년 전 조회 3,125
13년 전 조회 3,531
13년 전 조회 1,393
13년 전 조회 1,526
13년 전 조회 1,455
13년 전 조회 1,558
13년 전 조회 1,447
13년 전 조회 1,719
13년 전 조회 2,938
13년 전 조회 1,407
13년 전 조회 1,386
13년 전 조회 1,517
13년 전 조회 1,505
13년 전 조회 1,413
13년 전 조회 1,709
13년 전 조회 1,658
13년 전 조회 1,394
13년 전 조회 1,426
13년 전 조회 2,422
13년 전 조회 1,610
13년 전 조회 1,995