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

· 13년 전 · 1165
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,802
13년 전 조회 1,246
13년 전 조회 1,198
13년 전 조회 1,255
13년 전 조회 1,651
13년 전 조회 2,814
13년 전 조회 1,340
13년 전 조회 2,348
13년 전 조회 2,441
13년 전 조회 2,792
13년 전 조회 1,435
13년 전 조회 1,730
13년 전 조회 1,450
13년 전 조회 1,531
13년 전 조회 1,449
13년 전 조회 1,311
13년 전 조회 1,460
13년 전 조회 1,478
13년 전 조회 1,573
13년 전 조회 2,400
13년 전 조회 1,079
13년 전 조회 1,456
13년 전 조회 1,218
13년 전 조회 993
13년 전 조회 1,478
13년 전 조회 3,453
13년 전 조회 2,561
13년 전 조회 2,119
13년 전 조회 1,071
13년 전 조회 1,713
13년 전 조회 2,531
13년 전 조회 1,658
13년 전 조회 1,712
13년 전 조회 1,457
13년 전 조회 1,622
13년 전 조회 2,612
13년 전 조회 1,081
13년 전 조회 1,443
13년 전 조회 2,796
13년 전 조회 1,594
13년 전 조회 1,156
13년 전 조회 1,640
13년 전 조회 1,441
13년 전 조회 1,513
13년 전 조회 1,766
13년 전 조회 2,584
13년 전 조회 1,634
13년 전 조회 2,115
13년 전 조회 1,115
13년 전 조회 1,166
13년 전 조회 1,086
13년 전 조회 1,035
13년 전 조회 1,355
13년 전 조회 1,372
13년 전 조회 1,080
13년 전 조회 1,320
13년 전 조회 1,894
13년 전 조회 1,128
13년 전 조회 1,945
13년 전 조회 1,024
13년 전 조회 1,237
13년 전 조회 1,013
13년 전 조회 1,242
13년 전 조회 1,085
13년 전 조회 1,421
13년 전 조회 1,486
13년 전 조회 1,347
13년 전 조회 3,200
13년 전 조회 992
13년 전 조회 1,236
13년 전 조회 1,105
13년 전 조회 1,598
13년 전 조회 1,343
13년 전 조회 2,043
13년 전 조회 2,372
13년 전 조회 1,710
13년 전 조회 3,672
13년 전 조회 1,864
13년 전 조회 1,210
13년 전 조회 2,672
13년 전 조회 3,114
13년 전 조회 944
13년 전 조회 1,043
13년 전 조회 976
13년 전 조회 1,060
13년 전 조회 972
13년 전 조회 1,203
13년 전 조회 2,448
13년 전 조회 924
13년 전 조회 925
13년 전 조회 1,054
13년 전 조회 1,017
13년 전 조회 921
13년 전 조회 1,225
13년 전 조회 1,171
13년 전 조회 927
13년 전 조회 929
13년 전 조회 1,964
13년 전 조회 1,157
13년 전 조회 1,543