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

· 13년 전 · 1243
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년 전 조회 1,902
13년 전 조회 1,346
13년 전 조회 1,294
13년 전 조회 1,349
13년 전 조회 1,737
13년 전 조회 2,911
13년 전 조회 1,440
13년 전 조회 2,454
13년 전 조회 2,524
13년 전 조회 2,879
13년 전 조회 1,534
13년 전 조회 1,839
13년 전 조회 1,541
13년 전 조회 1,621
13년 전 조회 1,539
13년 전 조회 1,398
13년 전 조회 1,535
13년 전 조회 1,573
13년 전 조회 1,682
13년 전 조회 2,505
13년 전 조회 1,179
13년 전 조회 1,544
13년 전 조회 1,301
13년 전 조회 1,082
13년 전 조회 1,567
13년 전 조회 3,534
13년 전 조회 2,639
13년 전 조회 2,213
13년 전 조회 1,169
13년 전 조회 1,811
13년 전 조회 2,627
13년 전 조회 1,747
13년 전 조회 1,810
13년 전 조회 1,549
13년 전 조회 1,714
13년 전 조회 2,701
13년 전 조회 1,187
13년 전 조회 1,534
13년 전 조회 2,895
13년 전 조회 1,686
13년 전 조회 1,239
13년 전 조회 1,715
13년 전 조회 1,534
13년 전 조회 1,611
13년 전 조회 1,845
13년 전 조회 2,670
13년 전 조회 1,665
13년 전 조회 2,192
13년 전 조회 1,215
13년 전 조회 1,244
13년 전 조회 1,176
13년 전 조회 1,126
13년 전 조회 1,443
13년 전 조회 1,457
13년 전 조회 1,163
13년 전 조회 1,404
13년 전 조회 1,985
13년 전 조회 1,223
13년 전 조회 2,036
13년 전 조회 1,122
13년 전 조회 1,325
13년 전 조회 1,110
13년 전 조회 1,338
13년 전 조회 1,176
13년 전 조회 1,515
13년 전 조회 1,572
13년 전 조회 1,438
13년 전 조회 3,290
13년 전 조회 1,081
13년 전 조회 1,321
13년 전 조회 1,202
13년 전 조회 1,717
13년 전 조회 1,436
13년 전 조회 2,135
13년 전 조회 2,462
13년 전 조회 1,804
13년 전 조회 3,745
13년 전 조회 1,947
13년 전 조회 1,313
13년 전 조회 2,763
13년 전 조회 3,196
13년 전 조회 1,024
13년 전 조회 1,157
13년 전 조회 1,072
13년 전 조회 1,144
13년 전 조회 1,072
13년 전 조회 1,293
13년 전 조회 2,540
13년 전 조회 1,011
13년 전 조회 1,011
13년 전 조회 1,161
13년 전 조회 1,105
13년 전 조회 1,006
13년 전 조회 1,327
13년 전 조회 1,286
13년 전 조회 1,022
13년 전 조회 1,020
13년 전 조회 2,058
13년 전 조회 1,272
13년 전 조회 1,632