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

· 13년 전 · 1707
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,348
13년 전 조회 1,791
13년 전 조회 1,745
13년 전 조회 1,783
13년 전 조회 2,171
13년 전 조회 3,374
13년 전 조회 1,846
13년 전 조회 2,880
13년 전 조회 2,921
13년 전 조회 3,246
13년 전 조회 1,938
13년 전 조회 2,251
13년 전 조회 1,951
13년 전 조회 2,061
13년 전 조회 1,959
13년 전 조회 1,833
13년 전 조회 1,947
13년 전 조회 2,015
13년 전 조회 2,112
13년 전 조회 2,918
13년 전 조회 1,615
13년 전 조회 1,970
13년 전 조회 1,771
13년 전 조회 1,544
13년 전 조회 1,979
13년 전 조회 3,983
13년 전 조회 3,060
13년 전 조회 2,645
13년 전 조회 1,609
13년 전 조회 2,239
13년 전 조회 3,105
13년 전 조회 2,192
13년 전 조회 2,256
13년 전 조회 1,971
13년 전 조회 2,136
13년 전 조회 3,139
13년 전 조회 1,655
13년 전 조회 1,994
13년 전 조회 3,312
13년 전 조회 2,094
13년 전 조회 1,685
13년 전 조회 2,166
13년 전 조회 1,989
13년 전 조회 2,013
13년 전 조회 2,310
13년 전 조회 3,107
13년 전 조회 2,054
13년 전 조회 2,583
13년 전 조회 1,676
13년 전 조회 1,708
13년 전 조회 1,649
13년 전 조회 1,590
13년 전 조회 1,890
13년 전 조회 1,947
13년 전 조회 1,633
13년 전 조회 1,902
13년 전 조회 2,445
13년 전 조회 1,699
13년 전 조회 2,484
13년 전 조회 1,574
13년 전 조회 1,757
13년 전 조회 1,578
13년 전 조회 1,796
13년 전 조회 1,624
13년 전 조회 1,960
13년 전 조회 2,010
13년 전 조회 1,909
13년 전 조회 3,732
13년 전 조회 1,528
13년 전 조회 1,776
13년 전 조회 1,642
13년 전 조회 2,139
13년 전 조회 1,879
13년 전 조회 2,537
13년 전 조회 2,882
13년 전 조회 2,205
13년 전 조회 4,123
13년 전 조회 2,376
13년 전 조회 1,718
13년 전 조회 3,183
13년 전 조회 3,589
13년 전 조회 1,444
13년 전 조회 1,582
13년 전 조회 1,509
13년 전 조회 1,603
13년 전 조회 1,503
13년 전 조회 1,771
13년 전 조회 2,991
13년 전 조회 1,451
13년 전 조회 1,443
13년 전 조회 1,583
13년 전 조회 1,562
13년 전 조회 1,471
13년 전 조회 1,759
13년 전 조회 1,708
13년 전 조회 1,442
13년 전 조회 1,481
13년 전 조회 2,485
13년 전 조회 1,659
13년 전 조회 2,051