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

· 13년 전 · 1551
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,205
13년 전 조회 1,669
13년 전 조회 1,611
13년 전 조회 1,652
13년 전 조회 2,024
13년 전 조회 3,237
13년 전 조회 1,723
13년 전 조회 2,771
13년 전 조회 2,798
13년 전 조회 3,106
13년 전 조회 1,828
13년 전 조회 2,136
13년 전 조회 1,834
13년 전 조회 1,924
13년 전 조회 1,830
13년 전 조회 1,705
13년 전 조회 1,816
13년 전 조회 1,897
13년 전 조회 2,005
13년 전 조회 2,805
13년 전 조회 1,474
13년 전 조회 1,865
13년 전 조회 1,633
13년 전 조회 1,399
13년 전 조회 1,866
13년 전 조회 3,846
13년 전 조회 2,938
13년 전 조회 2,522
13년 전 조회 1,488
13년 전 조회 2,115
13년 전 조회 2,973
13년 전 조회 2,062
13년 전 조회 2,129
13년 전 조회 1,838
13년 전 조회 2,016
13년 전 조회 3,011
13년 전 조회 1,518
13년 전 조회 1,854
13년 전 조회 3,164
13년 전 조회 1,965
13년 전 조회 1,540
13년 전 조회 2,013
13년 전 조회 1,848
13년 전 조회 1,895
13년 전 조회 2,153
13년 전 조회 2,961
13년 전 조회 1,999
13년 전 조회 2,448
13년 전 조회 1,529
13년 전 조회 1,552
13년 전 조회 1,519
13년 전 조회 1,440
13년 전 조회 1,719
13년 전 조회 1,768
13년 전 조회 1,471
13년 전 조회 1,751
13년 전 조회 2,299
13년 전 조회 1,557
13년 전 조회 2,331
13년 전 조회 1,423
13년 전 조회 1,611
13년 전 조회 1,437
13년 전 조회 1,632
13년 전 조회 1,486
13년 전 조회 1,806
13년 전 조회 1,859
13년 전 조회 1,757
13년 전 조회 3,590
13년 전 조회 1,398
13년 전 조회 1,640
13년 전 조회 1,504
13년 전 조회 1,995
13년 전 조회 1,744
13년 전 조회 2,410
13년 전 조회 2,743
13년 전 조회 2,083
13년 전 조회 3,979
13년 전 조회 2,242
13년 전 조회 1,578
13년 전 조회 3,040
13년 전 조회 3,457
13년 전 조회 1,299
13년 전 조회 1,442
13년 전 조회 1,364
13년 전 조회 1,461
13년 전 조회 1,358
13년 전 조회 1,633
13년 전 조회 2,867
13년 전 조회 1,326
13년 전 조회 1,304
13년 전 조회 1,441
13년 전 조회 1,416
13년 전 조회 1,334
13년 전 조회 1,620
13년 전 조회 1,577
13년 전 조회 1,320
13년 전 조회 1,342
13년 전 조회 2,352
13년 전 조회 1,544
13년 전 조회 1,915