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

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,245
13년 전 조회 704
13년 전 조회 647
13년 전 조회 711
13년 전 조회 1,085
13년 전 조회 2,270
13년 전 조회 771
13년 전 조회 1,783
13년 전 조회 1,873
13년 전 조회 2,120
13년 전 조회 870
13년 전 조회 1,150
13년 전 조회 875
13년 전 조회 998
13년 전 조회 905
13년 전 조회 759
13년 전 조회 880
13년 전 조회 945
13년 전 조회 1,023
13년 전 조회 1,848
13년 전 조회 545
13년 전 조회 925
13년 전 조회 685
13년 전 조회 493
13년 전 조회 947
13년 전 조회 2,958
13년 전 조회 2,021
13년 전 조회 1,594
13년 전 조회 546
13년 전 조회 1,180
13년 전 조회 2,025
13년 전 조회 1,160
13년 전 조회 1,173
13년 전 조회 922
13년 전 조회 1,095
13년 전 조회 2,088
13년 전 조회 583
13년 전 조회 947
13년 전 조회 2,246
13년 전 조회 1,073
13년 전 조회 631
13년 전 조회 1,077
13년 전 조회 913
13년 전 조회 971
13년 전 조회 1,233
13년 전 조회 2,034
13년 전 조회 1,147
13년 전 조회 1,513
13년 전 조회 620
13년 전 조회 666
13년 전 조회 597
13년 전 조회 548
13년 전 조회 844
13년 전 조회 892
13년 전 조회 584
13년 전 조회 826
13년 전 조회 1,403
13년 전 조회 635
13년 전 조회 1,446
13년 전 조회 513
13년 전 조회 760
13년 전 조회 537
13년 전 조회 759
13년 전 조회 608
13년 전 조회 957
13년 전 조회 995
13년 전 조회 891
13년 전 조회 2,742
13년 전 조회 516
13년 전 조회 776
13년 전 조회 682
13년 전 조회 1,156
13년 전 조회 906
13년 전 조회 1,542
13년 전 조회 1,893
13년 전 조회 1,232
13년 전 조회 3,102
13년 전 조회 1,379
13년 전 조회 752
13년 전 조회 2,198
13년 전 조회 2,637
13년 전 조회 490
13년 전 조회 606
13년 전 조회 519
13년 전 조회 629
13년 전 조회 541
13년 전 조회 755
13년 전 조회 2,005
13년 전 조회 481
13년 전 조회 486
13년 전 조회 636
13년 전 조회 589
13년 전 조회 487
13년 전 조회 799
13년 전 조회 729
13년 전 조회 491
13년 전 조회 499
13년 전 조회 1,483
13년 전 조회 726
13년 전 조회 1,128
🐛 버그신고