Contiki 2.5
profiling.h
1 #ifndef __PROFILING_H__
2 #define __PROFILING_H__
3 
4 #include <stdint.h>
5 
6 #define PROFILING_STARTED 1
7 #define PROFILING_INTERNAL 2
8 
9 struct profile_callstack_t {
10  void *func;
11  void *caller;
12  unsigned long time_start;
13 };
14 
15 /* The structure that holds the callsites */
16 struct profile_site_t {
17  void *from;
18  void *addr;
19  uint32_t calls;
20  uint16_t time_min;
21  uint16_t time_max;
22  unsigned long time_accum;
23 };
24 
25 struct profile_t {
26  int status;
27  uint16_t max_sites;
28  uint16_t num_sites;
29  unsigned long time_run;
30  unsigned long time_start;
31  struct profile_site_t *sites;
32 };
33 
34 
35 
36 void profiling_init(void) __attribute__ ((no_instrument_function));
37 void profiling_start(void) __attribute__ ((no_instrument_function));
38 void profiling_stop(void) __attribute__ ((no_instrument_function));
39 void profiling_report(const char *name, uint8_t pretty) __attribute__ ((no_instrument_function));
40 struct profile_t *profiling_get(void) __attribute__ ((no_instrument_function));
41 void profiling_stack_trace(void) __attribute__ ((no_instrument_function));
42 
43 #endif /* __PROFILING_H__ */