환경변수 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,147
13년 전 조회 616
13년 전 조회 544
13년 전 조회 620
13년 전 조회 984
13년 전 조회 2,195
13년 전 조회 683
13년 전 조회 1,697
13년 전 조회 1,780
13년 전 조회 2,027
13년 전 조회 781
13년 전 조회 1,053
13년 전 조회 779
13년 전 조회 900
13년 전 조회 810
13년 전 조회 667
13년 전 조회 786
13년 전 조회 860
13년 전 조회 929
13년 전 조회 1,742
13년 전 조회 450
13년 전 조회 824
13년 전 조회 596
13년 전 조회 402
13년 전 조회 854
13년 전 조회 2,868
13년 전 조회 1,931
13년 전 조회 1,496
13년 전 조회 456
13년 전 조회 1,086
13년 전 조회 1,926
13년 전 조회 1,058
13년 전 조회 1,085
13년 전 조회 821
13년 전 조회 1,002
13년 전 조회 1,996
13년 전 조회 498
13년 전 조회 863
13년 전 조회 2,163
13년 전 조회 979
13년 전 조회 544
13년 전 조회 989
13년 전 조회 823
13년 전 조회 884
13년 전 조회 1,146
13년 전 조회 1,940
13년 전 조회 1,060
13년 전 조회 1,420
13년 전 조회 517
13년 전 조회 580
13년 전 조회 506
13년 전 조회 455
13년 전 조회 752
13년 전 조회 797
13년 전 조회 477
13년 전 조회 734
13년 전 조회 1,317
13년 전 조회 545
13년 전 조회 1,355
13년 전 조회 424
13년 전 조회 661
13년 전 조회 441
13년 전 조회 678
13년 전 조회 524
13년 전 조회 865
13년 전 조회 914
13년 전 조회 802
13년 전 조회 2,651
13년 전 조회 423
13년 전 조회 685
13년 전 조회 594
13년 전 조회 1,078
13년 전 조회 815
13년 전 조회 1,457
13년 전 조회 1,803
13년 전 조회 1,147
13년 전 조회 3,018
13년 전 조회 1,294
13년 전 조회 674
13년 전 조회 2,097
13년 전 조회 2,540
13년 전 조회 402
13년 전 조회 532
13년 전 조회 435
13년 전 조회 534
13년 전 조회 471
13년 전 조회 671
13년 전 조회 1,920
13년 전 조회 398
13년 전 조회 394
13년 전 조회 539
13년 전 조회 504
13년 전 조회 400
13년 전 조회 710
13년 전 조회 647
13년 전 조회 408
13년 전 조회 423
13년 전 조회 1,390
13년 전 조회 661
13년 전 조회 1,045
🐛 버그신고