Download presentation
Presentation is loading. Please wait.
Published byTrevor Randall Modified over 9 years ago
1
OOPSLA [ JAVA] Object Oriented Programming, Systems,Languages, Applications http://Java.sch.ac.kr Dlite 를 이용한 Debugging & Simprofile 을 이용한 Perl 벤치마크 & 자율 벤치 마크 강투무르, 이수호 레포트 1,2
2
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 2/16 page 2/16 순 서 및 개 요 간단한 C 프로그래밍 Linked-list 프로그램 코드 Sim-safe 를 이용한 실행 결과 지정된 벤치마크 벤치마크를 위한 Perl 프로그램 Perl 테스트 구문 sim-profile 벤치마크 결과 분석 자율 벤치마크 벤치마크를 위한 UDP Socket 프로그램 UDP Socket 테스트 구문 sim-profile 벤치마크 결과 분 석
3
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 3/16 page 3/16 Linked-listLinked-list 구조체 (node) 노드 값 : value 연결 구조 : link 함수 search() 노드 탐색, “2->0->0->4” 출력 main() 메모리할당, 구조체 초기화, 4 개의 노드 연결 명령어 bash-2.04# /edu/bin/sslittle-na-sstrix-gcc -o./linked.ss./linked.c bash-2.04# /edu/bin/sslittle-na-sstrix-gcc -s./linked.c bash-2.04#../sim-safe./linked.ss Dlite Debug 첨부파일 : dlite_linked.txt 1. 간단한 C 프로그래밍
4
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 4/16 page 4/16 프로그램 코드 #include typedef struct _snode{ int value; struct _snode *link; }node; node* linked; void search(){ node* temp; temp=linked->link; printf("linked list = "); while(temp->link != NULL){ printf("%d->",temp->value); temp=temp->link; } printf("%d\n",temp->value); } void main(){ node *a1,*a2,*a3,*a4; linked=(node *)malloc(sizeof(node)); a1=(node *)malloc(sizeof(node)); a2=(node *)malloc(sizeof(node)); a3=(node *)malloc(sizeof(node)); a4=(node *)malloc(sizeof(node)); a1->value=2; a2->value=0; a3->value=0; a4->value=4; linked->link=a1; a1->link=a2; a2->link=a3; a3->link=a4; a4->link=NULL; search(); } 1. 간단한 C 프로그래밍
5
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 5/16 page 5/16 sim-safe 를 이용한 실행 결과 실행 > bash-2.04#./sim-safe./simp/linked.ss 실행 결과 > 명령어 실행 수 18628 Load 와 Store 명령어 실행 수 8540 Text size 70656 Stack size 16384 page 할당 총 수 27 할당 page 메모리 크기 108k 페이지 테이블 miss 수 27 페이지 테이블 접근 수 529766 페이지 테이블 miss 비율 0.0001 1. 간단한 C 프로그래밍
6
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 6/16 page 6/16 벤치마크를 위한 Perl 프로그램 Test Program Perl 언어를 위한 Prel Interpreter 프로그램 Scrabbl.in 의 문자열 각각을 조합해 Dictionary list 에 저장 되 어 있는 문자열과 같은 문자열을 찾고 사전에 맞게 이를 수정 해서 출력 File List Dictionary : 사전 Perl.ss : interpreter 파일 Scrabbl.pl : Perl script 파일 Scrabbl.in : 프로그램 실행을 위한 외부 입력 Test Guide 실행방법 : bash-2.04#../sim-profile./perl.ss./scrabbl.pl./scrabbl.in 1. 간단한 C 프로그래밍
7
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 7/16 page 7/16 Perl 테스트 구문 1/2 # Scrabbl.pl-- Find all words from a collection of letters #- basically a simple application utilizing associative arrays # Logic(?) &readdict; &makewords; exit 0; # Subroutines # sub readdict { # Read all the words in our dictionary input open(DICT,'dictionary') || die "Can't open dictionary 'dictionary'\n"; while( ) { chop; next if /[^a-z]/;# only want words w/o special chars $dict{$_} = $_; } close(DICT); } sub makewords { while(<>) { ($input) = /([a-z]+)/;# get only the letters $len = length($input); @set = ('X') x $len; %found = (); &permute($input, @set); foreach $word (sort keys(%found)) { print "$found{$word} --> $word\n"; } 2. 지정된 벤치마크
8
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 8/16 page 8/16 Perl 테스트 구문 2/2 sub permute { local( $letters, @set ) = @_; local( $char, $i ); if( $letters eq '' ) { $word = join('', @set); if( defined($dict{$word}) ) { $found{$word} = $input; } return; } $char = substr($letters, 0, 1); $letters = substr($letters, 1); for( $i=0; $i<$len; $i++ ) { next if $set[$i] ne 'X'; $set[$i] = $char; &permute($letters, @set); $set[$i] = 'X'; } 2. 지정된 벤치마크
9
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 9/16 page 9/16 sim-profile 벤치마크 결과 1/2 sim: ** starting functional simulation ** veil --> live dakga --> kadag sim: ** simulation statistics ** sim_num_insn 45672039 # total number of instructions executed sim_num_refs 20921446 # total number of loads and stores executed sim_elapsed_time 15 # total simulation time in seconds sim_inst_rate 3044802.6000 # simulation speed (in insts/sec) sim_inst_class_prof # instruction class profile sim_inst_class_prof.array_size = 7 sim_inst_class_prof.bucket_size = 1 sim_inst_class_prof.count = 7 sim_inst_class_prof.total = 45672038 sim_inst_class_prof.imin = 0 sim_inst_class_prof.imax = 7 sim_inst_class_prof.average = 6524576.8571 sim_inst_class_prof.std_dev = 6165444.5219 sim_inst_class_prof.overflows = 0 # pdf == prob dist fn, cdf == cumulative dist fn # index count pdf sim_inst_class_prof.start_dist 2. 지정된 벤치마크
10
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 10/16 page 10/16 sim-profile 벤치마크 결과 2/2 load 12734992 27.88 store 8186454 17.92 uncond branch 2772018 6.07 cond branch 5984432 13.10 int computation 15917460 34.85 fp computation 76588 0.17 trap 94 0.00 sim_inst_class_prof.end_dist ld_text_base 0x00400000 # program text (code) segment base ld_text_size 535584 # program text (code) size in bytes ld_data_base 0x10000000 # program initialized data segment base ld_data_size 77204 # program init'ed `.data' and uninit'ed `.bss' size in bytes ld_stack_base 0x7fffc000 # program stack segment base (highest address in st ack) ld_stack_size 16384 # program initial stack size ld_prog_entry 0x00400140 # program entry point (initial PC) ld_environ_base 0x7fff8000 # program environment base address address ld_target_big_endian 0 # target executable endian-ness, non-zero if big en dian mem.page_count 217 # total number of pages allocated mem.page_mem 868k # total size of memory pages allocated mem.ptab_misses 219 # total first level page table misses mem.ptab_accesses 229130096 # total page table accesses mem.ptab_miss_rate 0.0000 # first level page table miss rate13 2. 지정된 벤치마크
11
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 11/16 page 11/16 프로그램 크기 명령어 분포 분 석 1/2 명령어 분포 도표 instructioncountrate load12,734,99227.88 store8,186,45417.92 uncond branch2,772,0186.07 cond branch5,984,43213.10 int computation15,917,46034.85 fp computation76,5880.17 trap940.00 total 45,672,03899.99 프로그램 크기 도표 항목크기 text 535,584 data 77,204 stack 16,384 page 217 page memory 868k 2. 지정된 벤치마크
12
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 12/16 page 12/16 분 석 2/2 명령어 분포 그래프 2. 지정된 벤치마크
13
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 13/16 page 13/16 벤치마크를 위한 UDP Socket 프로그램 Test Program Server 와 Client 간의 Socket 을 이용한 UDP 전송 프로그램 Client 가 Port 없이 URI( 또는 IP Address) 를 통해 Server 에 메시지전송. Server 는 전송 받은 메시지를 출력한 후 Client 에게 자신의 IP Address 를 통보 File List Client 프로그램 : UDP Socket Client program Server 프로그램 : UDP Socket Server Program Test Guide bash-2.04#../sim-profile -iclass./udp_client.ss bash-2.04#../sim-profile -iclass./udp_server.ss 3. 자율 벤치마크
14
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 14/16 page 14/16 UDP Socket 테스트 구문 (Server) #include #define MYPORT 50000 #define MAXBUFLEN 100 main() { int sockfd; struct sockaddr_in my_addr; struct sockaddr_in their_addr; int addr_len, numbytes; char buf[MAXBUFLEN] ; if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1){ perror("socket"); exit(1); } my_addr.sin_family = AF_INET; my_addr.sin_port = htons(MYPORT); my_addr.sin_addr.s_addr = INADDR_ANY; bzero(&(my_addr.sin_zero), 8); if(bind(sockfd,(struct sockaddr *)&my_addr,sizeof(struct sockaddr)) == -1){ perror("bind"); exit(1); } addr_len = sizeof(struct sockaddr); memset(buf,'\0',MAXBUFLEN); if((numbytes = recvfrom(sockfd, buf, MAXBUFLEN, 0, (struct sockaddr *)&their_addr,&addr_len)) == -1){ perror("recvfroem"); exit(1); } printf("get packet from %s\n", inet_ntoa(their_addr.sin_addr)); printf("packet is %d bytes long\n", numbytes); printf("packet contains: %s\n", buf); close(sockfd); } 3. 자율 벤치마크
15
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 15/16 page 15/16 UDP Socket 테스트 구문 (Client) #include #define MYPORT 50000 #define MAXLEN 100 int main(int argc, char *argv[]) { int sockfd; struct sockaddr_in their_addr; struct hostent *he; int numbytes; char buf[MAXLEN]; if(argc != 2){ fprintf(stderr, "usage:%s IP\n", argv[0]); exit(1); } if((he = gethostbyname(argv[1])) == NULL){ herror("gethostbyname"); exit(1); } if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1){ perror("socket"); exit(1); } their_addr.sin_family = AF_INET; their_addr.sin_port = htons(MYPORT); their_addr.sin_addr = *((struct in_addr *)he- >h_addr); bzero(&(their_addr.sin_zero), 8); memset(buf,'\0', MAXLEN); printf("Input Message:"); fflush(stdin); fgets(buf,MAXLEN, stdin); if((numbytes = sendto(sockfd, buf, strlen(buf), 0, (struct sockaddr *)&their_addr,sizeof(struct sockaddr))) == -1){ perror("sendto"); exit(1); } printf("sent %d bytes to %s\n", numbytes,inet_ntoa(their_addr.sin_addr)); close(sockfd); return 0; } 3. 자율 벤치마크
16
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 16/16 page 16/16 sim-profile 벤치마크 결과 (Server) sim_num_insn 251 # total number of instructions executed sim_num_refs 54 # total number of loads and stores executed sim_elapsed_time 1 # total simulation time in seconds sim_inst_rate 251.0000 # simulation speed (in insts/sec) sim_inst_class_prof # instruction class profile sim_inst_class_prof.array_size = 7 sim_inst_class_prof.bucket_size = 1 sim_inst_class_prof.count = 7 sim_inst_class_prof.total = 250 sim_inst_class_prof.imin = 0 sim_inst_class_prof.imax = 7 sim_inst_class_prof.average = 35.7143 sim_inst_class_prof.std_dev = 45.3972 sim_inst_class_prof.overflows = 0 # pdf == prob dist fn, cdf == cumulative dist fn # index count pdf sim_inst_class_prof.start_dist load 32 12.80 store 22 8.80 uncond branch 24 9.60 cond branch 39 15.60 int computation 133 53.20 fp computation 0 0.00 trap 0 0.00 sim_inst_class_prof.end_dist ld_text_base 0x00400000 # program text (code) segment base ld_text_size 72496 # program text (code) size in bytes ld_data_base 0x10000000 # program initialized data segment base ld_data_size 8212 # program init'ed `.data' and uninit'ed `.bss' size in bytes ld_stack_base 0x7fffc000 # program stack segment base (highest address in st ack) ld_stack_size 16384 # program initial stack size ld_prog_entry 0x00400140 # program entry point (initial PC) ld_environ_base 0x7fff8000 # program environment base address address ld_target_big_endian 0 # target executable endian-ness, non-zero if big en dian mem.page_count 22 # total number of pages allocated mem.page_mem 88k # total size of memory pages allocated mem.ptab_misses 22 # total first level page table misses mem.ptab_accesses 450472 # total page table accesses mem.ptab_miss_rate 0.0000 # first level page table miss rat 3. 자율 벤치마크
17
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 17/16 page 17/16 sim-profile 벤치마크 결과 (Client) sim: ** simulation statistics ** sim_num_insn 14301 # total number of instructions executed sim_num_refs 5581 # total number of loads and stores executed sim_elapsed_time 1 # total simulation time in seconds sim_inst_rate 14301.0000 # simulation speed (in insts/sec) sim_inst_class_prof # instruction class profile sim_inst_class_prof.array_size = 7 sim_inst_class_prof.bucket_size = 1 sim_inst_class_prof.count = 7 sim_inst_class_prof.total = 14300 sim_inst_class_prof.imin = 0 sim_inst_class_prof.imax = 7 sim_inst_class_prof.average = 2042.8571 sim_inst_class_prof.std_dev = 2198.9727 sim_inst_class_prof.overflows = 0 # pdf == prob dist fn, cdf == cumulative dist fn # index count pdf sim_inst_class_prof.start_dist load 1480 10.35 store 4101 28.68 uncond branch 607 4.24 cond branch 2315 16.19 int computation 5787 40.47 fp computation 0 0.00 trap 10 0.07 sim_inst_class_prof.end_dist ld_text_base 0x00400000 # program text (code) segment base ld_text_size 159216 # program text (code) size in bytes ld_data_base 0x10000000 # program initialized data segment base ld_data_size 24372 # program init'ed `.data' and uninit'ed `.bss' size in bytes ld_stack_base 0x7fffc000 # program stack segment base (highest address in st ack) ld_stack_size 16384 # program initial stack size ld_prog_entry 0x00400140 # program entry point (initial PC) ld_environ_base 0x7fff8000 # program environment base address address ld_target_big_endian 0 # target executable endian-ness, non-zero if big en dian mem.page_count 51 # total number of pages allocated mem.page_mem 204k # total size of memory pages allocated mem.ptab_misses 53 # total first level page table misses mem.ptab_accesses 1049724 # total page table accesses mem.ptab_miss_rate 0.0001 # first level page table miss rate 3. 자율 벤치마크
18
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 18/16 page 18/16 분 석 1/2 instructioncountrate load 148010.35 store 410128.68 uncond branch 6074.24 cond branch 231516.19 int computation 578740.47 fp computation 00.00 trap 100.07 sum14300100.00 instructioncountrate load 3212.80 store 228.80 uncond branch 249.60 cond branch 3915.60 int computation 13353.20 fp computation 00.00 trap 00.00 sum250100.00 항목크기 text159216 data24372 stack16384 page51 page memory204k 항목크기 text72496 data8212 stack16384 page22 page memory88k Server 명령어 분포Server 프로그램 크기 Client Client 명령어 분포 3. 자율 벤치마크
19
OOPSLA [JAVA) Laboratory Object Oriented Programmings, System, Languages, Applications http://Java.sch.ac.kr 19/16 page 19/16 분 석 2/2 명령어 분포 그래프 3. 자율 벤치마크
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.