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

· 13년 전 · 1573
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,240
13년 전 조회 1,690
13년 전 조회 1,634
13년 전 조회 1,674
13년 전 조회 2,055
13년 전 조회 3,262
13년 전 조회 1,739
13년 전 조회 2,786
13년 전 조회 2,817
13년 전 조회 3,136
13년 전 조회 1,849
13년 전 조회 2,163
13년 전 조회 1,860
13년 전 조회 1,945
13년 전 조회 1,853
13년 전 조회 1,726
13년 전 조회 1,847
13년 전 조회 1,923
13년 전 조회 2,023
13년 전 조회 2,823
13년 전 조회 1,506
13년 전 조회 1,883
13년 전 조회 1,658
13년 전 조회 1,426
13년 전 조회 1,884
13년 전 조회 3,869
13년 전 조회 2,965
13년 전 조회 2,545
13년 전 조회 1,520
13년 전 조회 2,133
13년 전 조회 2,995
13년 전 조회 2,090
13년 전 조회 2,145
13년 전 조회 1,865
13년 전 조회 2,029
13년 전 조회 3,028
13년 전 조회 1,538
13년 전 조회 1,892
13년 전 조회 3,181
13년 전 조회 1,985
13년 전 조회 1,568
13년 전 조회 2,043
13년 전 조회 1,874
13년 전 조회 1,918
13년 전 조회 2,190
13년 전 조회 2,981
13년 전 조회 2,005
13년 전 조회 2,471
13년 전 조회 1,559
13년 전 조회 1,574
13년 전 조회 1,557
13년 전 조회 1,457
13년 전 조회 1,758
13년 전 조회 1,811
13년 전 조회 1,491
13년 전 조회 1,775
13년 전 조회 2,333
13년 전 조회 1,581
13년 전 조회 2,351
13년 전 조회 1,445
13년 전 조회 1,631
13년 전 조회 1,462
13년 전 조회 1,653
13년 전 조회 1,509
13년 전 조회 1,833
13년 전 조회 1,884
13년 전 조회 1,785
13년 전 조회 3,612
13년 전 조회 1,427
13년 전 조회 1,659
13년 전 조회 1,531
13년 전 조회 2,009
13년 전 조회 1,767
13년 전 조회 2,428
13년 전 조회 2,771
13년 전 조회 2,105
13년 전 조회 4,010
13년 전 조회 2,261
13년 전 조회 1,602
13년 전 조회 3,065
13년 전 조회 3,477
13년 전 조회 1,326
13년 전 조회 1,462
13년 전 조회 1,392
13년 전 조회 1,488
13년 전 조회 1,384
13년 전 조회 1,654
13년 전 조회 2,884
13년 전 조회 1,350
13년 전 조회 1,326
13년 전 조회 1,454
13년 전 조회 1,437
13년 전 조회 1,354
13년 전 조회 1,648
13년 전 조회 1,599
13년 전 조회 1,341
13년 전 조회 1,368
13년 전 조회 2,373
13년 전 조회 1,559
13년 전 조회 1,930