Subversion Repositories shark

Rev

Rev 1354 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1295 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Giacomo Guidi       <giacomo@gandalf.sssup.it>
10
 *
11
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
12
 *
13
 * http://www.sssup.it
14
 * http://retis.sssup.it
15
 * http://shark.sssup.it
16
 */
17
 
18
#include <kernel/kern.h>
19
#include <tracer.h>
20
 
21
int main(int argc, char **argv)
22
{
23
 
24
  long long i;
25
 
1353 giacomo 26
  int a,b,c;
1295 giacomo 27
  struct timespec start,end,diff;
28
 
1353 giacomo 29
  a = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
30
  b = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_JTN);
31
  c = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
32
 
33
  FTrace_chunk_link(a,b);
34
  FTrace_chunk_link(b,c);
35
 
36
  FTrace_actual_chunk_select(a);
37
 
1295 giacomo 38
  kern_gettime(&start);
1341 giacomo 39
  FTrace_enable();
1295 giacomo 40
 
41
  for (i=0;i<1000000000;i++);
1341 giacomo 42
 
43
  TRACER_LOGEVENT(FTrace_EVT_next_chunk,0,0);
1295 giacomo 44
 
1341 giacomo 45
  for (i=0;i<1000000000;i++);
46
 
47
  FTrace_disable();
1295 giacomo 48
  kern_gettime(&end);
49
 
50
  SUBTIMESPEC(&end,&start,&diff);
51
 
52
  cprintf("Logged Time %d s %d us\n",(int)diff.tv_sec,(int)diff.tv_nsec/1000);
53
 
1353 giacomo 54
  FTrace_chunk_dump(a);
1295 giacomo 55
 
56
  return 0;
57
 
58
}