UbixOS V2  2.0
perf.h
Go to the documentation of this file.
1 #ifndef __ARCH_PERF_H__
2 #define __ARCH_PERF_H__
3 
4 #include <ubixos/times.h>
5 
6 #ifdef PERF
7 #define PERF_START { \
8  unsigned long __c1l, __c1h, __c2l, __c2h; \
9  __asm__(".byte 0x0f, 0x31" : "=a" (__c1l), "=d" (__c1h))
10 #define PERF_STOP(x) __asm__(".byte 0x0f, 0x31" : "=a" (__c2l), "=d" (__c2h)); \
11  perf_print(__c1l, __c1h, __c2l, __c2h, x);}
12 
13 /*#define PERF_START do { \
14  struct tms __perf_start, __perf_end; \
15  times(&__perf_start)
16 #define PERF_STOP(x) times(&__perf_end); \
17  perf_print_times(&__perf_start, &__perf_end, x);\
18  } while(0)*/
19 #else /* PERF */
20 #define PERF_START /* null definition */
21 #define PERF_STOP(x) /* null definition */
22 #endif /* PERF */
23 
24 void perf_print(unsigned long c1l, unsigned long c1h,
25  unsigned long c2l, unsigned long c2h,
26  char *key);
27 
28 void perf_print_times(struct tms *start, struct tms *end, char *key);
29 
30 void perf_init(char *fname);
31 
32 #endif
perf_print
void perf_print(unsigned long c1l, unsigned long c1h, unsigned long c2l, unsigned long c2h, char *key)
times.h
perf_init
void perf_init(char *fname)
perf_print_times
void perf_print_times(struct tms *start, struct tms *end, char *key)
tms
Definition: times.h:39