15,6 → 15,24 |
* http://shark.sssup.it |
*/ |
|
/* |
* Copyright (C) 2000 Paolo Gai |
* |
* This program is free software; you can redistribute it and/or modify |
* it under the terms of the GNU General Public License as published by |
* the Free Software Foundation; either version 2 of the License, or |
* (at your option) any later version. |
* |
* This program is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with this program; if not, write to the Free Software |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
|
#include <kernel/kern.h> |
#include <tracer.h> |
|
22,31 → 40,27 |
{ |
|
long long i; |
int err; |
|
int a,b,c; |
struct timespec start,end,diff; |
|
FTrace_init(); |
//Initialize Tracer |
tracer_initialize(1000000); |
|
a = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC); |
b = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_JTN); |
c = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC); |
//Set UDP output |
err = tracer_init_udp(1,"192.168.82.46","192.168.82.20"); |
|
FTrace_chunk_link(a,b); |
FTrace_chunk_link(b,c); |
if (err != 0) { |
cprintf("Network Open Fail !\n"); |
sys_end(); |
} |
|
FTrace_actual_chunk_select(a); |
|
kern_gettime(&start); |
FTrace_enable(); |
tracer_enable(); |
|
for (i=0;i<1000000000;i++); |
|
TRACER_LOGEVENT(FTrace_EVT_next_chunk,0,0); |
|
for (i=0;i<1000000000;i++); |
|
FTrace_disable(); |
tracer_disable(); |
kern_gettime(&end); |
|
SUBTIMESPEC(&end,&start,&diff); |
53,10 → 67,15 |
|
cprintf("Logged Time %d s %d us\n",(int)diff.tv_sec,(int)diff.tv_nsec/1000); |
|
FTrace_chunk_dump(a); |
FTrace_chunk_dump(b); |
FTrace_chunk_dump(c); |
tracer_print_statistics(); |
|
//Send the events |
tracer_send_logged_events(-1); |
tracer_flush_sent_events(); |
|
// Ctrl-C to exit |
while(1); |
|
return 0; |
|
} |