/demos/trunk/newtrace/utils/udpdump.c |
---|
25,6 → 25,7 |
#include <unistd.h>/* close() */ |
#include <stdlib.h> |
#include <signal.h> |
#include <string.h> |
#define SERVER_PORT 20000 |
#define MAX_MSG 10000 |
105,6 → 106,8 |
cliLen = sizeof(cliAddr); |
n = recvfrom(sd, msg, MAX_MSG, 0,(struct sockaddr *)&cliAddr, &cliLen); |
if (strncmp(pkt_head->id,"TRACER",6)) continue; |
printf("Received %d, length %d(%d), %d tracer events.\n", |
pkt_head->pkt_number, n, pkt_head->size, pkt_head->events); |
113,15 → 116,14 |
miss = 1; |
} |
count++; |
if (n > 0) { |
if(n < 0) { |
printf("%s: cannot receive data \n",argv[0]); |
continue; |
count++; |
fwrite((void *)(msg+sizeof(struct tracer_udp_header)),n-sizeof(struct tracer_udp_header),1,output_file); |
} |
fwrite((void *)(msg+sizeof(struct tracer_udp_header)),n-sizeof(struct tracer_udp_header),1,output_file); |
} |
fclose(output_file); |
/demos/trunk/newtrace/utils/isolation.c |
---|
23,8 → 23,6 |
#define READ_BUFFER 2000 |
#define DELTA_BUFFER 100 |
#define CLKPERMSEC 699944 |
struct event_type { |
int type; |
unsigned long long tsc; |
233,16 → 231,16 |
fclose(input_file); |
printf("Total Time %d\n",(unsigned int)((stop-start) * 1000 / CLKPERMSEC)); |
printf("Total Time %d\n",(unsigned int)((stop-start) * 1000 / 699944)); |
printf("Total Ctx = %d\n",total_ctx); |
printf("Total Interrupt = %d\n",(unsigned int)(int_time.total_time * 1000 / CLKPERMSEC)); |
printf("Total Interrupt = %d\n",(unsigned int)(int_time.total_time * 1000 / 699944)); |
total_simulation = 0; |
for (i=0;i<total_ctx;i++) { |
printf("Total Time Ctx %d => %d\n",ctx_time[i].ctx,(unsigned int)(ctx_time[i].total_time * 1000 / CLKPERMSEC)); |
total_simulation += (unsigned int)(ctx_time[i].total_time * 1000 / CLKPERMSEC); |
printf("Total Time Ctx %d => %d\n",ctx_time[i].ctx,(unsigned int)(ctx_time[i].total_time * 1000 / 699944)); |
total_simulation += (unsigned int)(ctx_time[i].total_time * 1000 / 699944); |
} |
printf ("Total Simulation %d\n",total_simulation); |
/demos/trunk/newtrace/utils/list.c |
---|
70,7 → 70,7 |
size -= 10; |
i = 0; |
while (size > 0) { |
printf("Par%d = %d ",i,*(unsigned int *)(p+10+i*4)); |
printf(" Par%d = %d",i,*(unsigned int *)(p+10+i*4)); |
i++; |
size -= 4; |
} |