환경변수 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,162
13년 전 조회 628
13년 전 조회 563
13년 전 조회 636
13년 전 조회 1,001
13년 전 조회 2,212
13년 전 조회 698
13년 전 조회 1,712
13년 전 조회 1,796
13년 전 조회 2,040
13년 전 조회 799
13년 전 조회 1,067
13년 전 조회 798
13년 전 조회 913
13년 전 조회 824
13년 전 조회 678
13년 전 조회 800
13년 전 조회 878
13년 전 조회 947
13년 전 조회 1,761
13년 전 조회 466
13년 전 조회 841
13년 전 조회 609
13년 전 조회 413
13년 전 조회 865
13년 전 조회 2,878
13년 전 조회 1,941
13년 전 조회 1,510
13년 전 조회 470
13년 전 조회 1,097
13년 전 조회 1,938
13년 전 조회 1,074
13년 전 조회 1,097
13년 전 조회 828
13년 전 조회 1,018
13년 전 조회 2,012
13년 전 조회 513
13년 전 조회 883
13년 전 조회 2,177
13년 전 조회 992
13년 전 조회 562
13년 전 조회 1,008
13년 전 조회 831
13년 전 조회 894
13년 전 조회 1,158
13년 전 조회 1,955
13년 전 조회 1,077
13년 전 조회 1,433
13년 전 조회 535
13년 전 조회 590
13년 전 조회 516
13년 전 조회 469
13년 전 조회 765
13년 전 조회 811
13년 전 조회 492
13년 전 조회 748
13년 전 조회 1,332
13년 전 조회 562
13년 전 조회 1,375
13년 전 조회 436
13년 전 조회 680
13년 전 조회 448
13년 전 조회 689
13년 전 조회 539
13년 전 조회 880
13년 전 조회 926
13년 전 조회 816
13년 전 조회 2,663
13년 전 조회 441
13년 전 조회 696
13년 전 조회 605
13년 전 조회 1,087
13년 전 조회 830
13년 전 조회 1,467
13년 전 조회 1,818
13년 전 조회 1,159
13년 전 조회 3,032
13년 전 조회 1,306
13년 전 조회 685
13년 전 조회 2,110
13년 전 조회 2,559
13년 전 조회 413
13년 전 조회 541
13년 전 조회 444
13년 전 조회 546
13년 전 조회 478
13년 전 조회 685
13년 전 조회 1,933
13년 전 조회 410
13년 전 조회 413
13년 전 조회 553
13년 전 조회 512
13년 전 조회 407
13년 전 조회 723
13년 전 조회 663
13년 전 조회 419
13년 전 조회 437
13년 전 조회 1,404
13년 전 조회 666
13년 전 조회 1,056
🐛 버그신고