19 unsigned long long counter[pp_total_points];
22 extern struct pp_counters *pp_counters;
25 static __attribute__((always_inline)) inline unsigned int pprof_get_one(void)
27 unsigned long long ret;
28 __asm__ __volatile__ ("rdtsc" : "=A" (ret));
29 return (unsigned int)ret;
32 #elif defined(__GP2X__)
34 extern volatile unsigned long *gp2x_memregl;
35 #define pprof_get_one() (unsigned int)gp2x_memregl[0x0a00 >> 2]
41 #define pprof_start(point) { \
42 unsigned int pp_start_##point = pprof_get_one()
43 #define pprof_end(point) \
44 pp_counters->counter[pp_##point] += pprof_get_one() - pp_start_##point; \
46 // subtract for recursive stuff
47 #define pprof_end_sub(point) \
48 pp_counters->counter[pp_##point] -= pprof_get_one() - pp_start_##point; \
51 extern void pprof_init(void);
52 extern void pprof_finish(void);