-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstrument.c
More file actions
36 lines (27 loc) · 704 Bytes
/
Copy pathinstrument.c
File metadata and controls
36 lines (27 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <pl_instrumentfunctions.h>
#include <stdint.h>
// GCC options finstrument functions
//Funtion trace buffer and indexes
const int32_t FNC_TRACE_SIZE = 8192;
void * FNC_TRACE_BUFFER[FNC_TRACE_SIZE];
int32_t fnc_trace_index = 0;
//Entry funtion
void __cyg_prifile_func_enter(void *this_fn, void *call_site)
{
FNC_TRACE_BUFFER[fnc_trace_index++] = this_fn;
if(fnc_trace_index >= FNC_TRACE_SIZE)
{
fnc_trace_index = 0;
}
}
void __cyg_prifile_func_exit (void *this_fn, void *call_site) __attribute__((no_instrument_function))
{
; //Do nothing
}
void fnc_trace_init() __attribute__((no_instrument_function))
{
for(int32_t i =0;i<FNC_TRACE_INIT;i++)
{
FNC_TRACE_BUFFER[i]=NULL;
}
}