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

· 13년 전 · 1331
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,990
13년 전 조회 1,434
13년 전 조회 1,384
13년 전 조회 1,425
13년 전 조회 1,815
13년 전 조회 2,991
13년 전 조회 1,517
13년 전 조회 2,549
13년 전 조회 2,588
13년 전 조회 2,917
13년 전 조회 1,614
13년 전 조회 1,938
13년 전 조회 1,627
13년 전 조회 1,709
13년 전 조회 1,623
13년 전 조회 1,492
13년 전 조회 1,621
13년 전 조회 1,657
13년 전 조회 1,771
13년 전 조회 2,579
13년 전 조회 1,265
13년 전 조회 1,644
13년 전 조회 1,404
13년 전 조회 1,175
13년 전 조회 1,649
13년 전 조회 3,625
13년 전 조회 2,734
13년 전 조회 2,296
13년 전 조회 1,253
13년 전 조회 1,886
13년 전 조회 2,730
13년 전 조회 1,841
13년 전 조회 1,906
13년 전 조회 1,629
13년 전 조회 1,803
13년 전 조회 2,787
13년 전 조회 1,278
13년 전 조회 1,619
13년 전 조회 2,968
13년 전 조회 1,775
13년 전 조회 1,334
13년 전 조회 1,798
13년 전 조회 1,628
13년 전 조회 1,687
13년 전 조회 1,937
13년 전 조회 2,748
13년 전 조회 1,704
13년 전 조회 2,232
13년 전 조회 1,293
13년 전 조회 1,332
13년 전 조회 1,281
13년 전 조회 1,210
13년 전 조회 1,532
13년 전 조회 1,538
13년 전 조회 1,248
13년 전 조회 1,506
13년 전 조회 2,070
13년 전 조회 1,319
13년 전 조회 2,111
13년 전 조회 1,181
13년 전 조회 1,400
13년 전 조회 1,196
13년 전 조회 1,422
13년 전 조회 1,267
13년 전 조회 1,596
13년 전 조회 1,658
13년 전 조회 1,530
13년 전 조회 3,368
13년 전 조회 1,159
13년 전 조회 1,413
13년 전 조회 1,279
13년 전 조회 1,814
13년 전 조회 1,527
13년 전 조회 2,229
13년 전 조회 2,560
13년 전 조회 1,896
13년 전 조회 3,789
13년 전 조회 2,035
13년 전 조회 1,394
13년 전 조회 2,851
13년 전 조회 3,281
13년 전 조회 1,101
13년 전 조회 1,241
13년 전 조회 1,155
13년 전 조회 1,235
13년 전 조회 1,163
13년 전 조회 1,383
13년 전 조회 2,630
13년 전 조회 1,101
13년 전 조회 1,090
13년 전 조회 1,233
13년 전 조회 1,184
13년 전 조회 1,099
13년 전 조회 1,418
13년 전 조회 1,357
13년 전 조회 1,112
13년 전 조회 1,106
13년 전 조회 2,152
13년 전 조회 1,350
13년 전 조회 1,717