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

· 13년 전 · 1114
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,743
13년 전 조회 1,189
13년 전 조회 1,137
13년 전 조회 1,202
13년 전 조회 1,603
13년 전 조회 2,764
13년 전 조회 1,294
13년 전 조회 2,302
13년 전 조회 2,381
13년 전 조회 2,729
13년 전 조회 1,392
13년 전 조회 1,686
13년 전 조회 1,394
13년 전 조회 1,483
13년 전 조회 1,400
13년 전 조회 1,258
13년 전 조회 1,408
13년 전 조회 1,428
13년 전 조회 1,518
13년 전 조회 2,363
13년 전 조회 1,033
13년 전 조회 1,412
13년 전 조회 1,165
13년 전 조회 948
13년 전 조회 1,436
13년 전 조회 3,406
13년 전 조회 2,513
13년 전 조회 2,077
13년 전 조회 1,027
13년 전 조회 1,655
13년 전 조회 2,490
13년 전 조회 1,613
13년 전 조회 1,669
13년 전 조회 1,411
13년 전 조회 1,571
13년 전 조회 2,563
13년 전 조회 1,037
13년 전 조회 1,396
13년 전 조회 2,734
13년 전 조회 1,544
13년 전 조회 1,107
13년 전 조회 1,587
13년 전 조회 1,392
13년 전 조회 1,459
13년 전 조회 1,714
13년 전 조회 2,530
13년 전 조회 1,596
13년 전 조회 2,059
13년 전 조회 1,076
13년 전 조회 1,115
13년 전 조회 1,045
13년 전 조회 991
13년 전 조회 1,300
13년 전 조회 1,320
13년 전 조회 1,035
13년 전 조회 1,266
13년 전 조회 1,845
13년 전 조회 1,081
13년 전 조회 1,893
13년 전 조회 977
13년 전 조회 1,177
13년 전 조회 969
13년 전 조회 1,202
13년 전 조회 1,044
13년 전 조회 1,373
13년 전 조회 1,445
13년 전 조회 1,314
13년 전 조회 3,156
13년 전 조회 944
13년 전 조회 1,194
13년 전 조회 1,061
13년 전 조회 1,553
13년 전 조회 1,304
13년 전 조회 1,992
13년 전 조회 2,334
13년 전 조회 1,673
13년 전 조회 3,618
13년 전 조회 1,815
13년 전 조회 1,156
13년 전 조회 2,623
13년 전 조회 3,059
13년 전 조회 894
13년 전 조회 1,005
13년 전 조회 936
13년 전 조회 1,013
13년 전 조회 931
13년 전 조회 1,164
13년 전 조회 2,413
13년 전 조회 881
13년 전 조회 865
13년 전 조회 1,013
13년 전 조회 974
13년 전 조회 871
13년 전 조회 1,190
13년 전 조회 1,128
13년 전 조회 887
13년 전 조회 888
13년 전 조회 1,909
13년 전 조회 1,113
13년 전 조회 1,507