aboutsummaryrefslogtreecommitdiff
path: root/instrument.c
diff options
context:
space:
mode:
Diffstat (limited to 'instrument.c')
-rw-r--r--instrument.c45
1 files changed, 18 insertions, 27 deletions
diff --git a/instrument.c b/instrument.c
index 4c9dfa0..99630fa 100644
--- a/instrument.c
+++ b/instrument.c
@@ -13,43 +13,34 @@
#include <stdlib.h>
/* Function prototypes with attributes */
-void main_constructor( void )
- __attribute__ ((no_instrument_function, constructor));
-
-void main_destructor( void )
- __attribute__ ((no_instrument_function, destructor));
-
-void __cyg_profile_func_enter( void *, void * )
- __attribute__ ((no_instrument_function));
-
-void __cyg_profile_func_exit( void *, void * )
- __attribute__ ((no_instrument_function));
-
-
+void main_constructor(void) __attribute__((no_instrument_function, constructor));
+void main_destructor(void) __attribute__((no_instrument_function, destructor));
+void __cyg_profile_func_enter(void *, void *) __attribute__((no_instrument_function));
+void __cyg_profile_func_exit(void *, void *) __attribute__((no_instrument_function));
static FILE *fp;
-
-void main_constructor( void )
+void
+main_constructor(void)
{
- fp = fopen( "trace.txt", "w" );
- if (fp == NULL) exit(-1);
+ fp = fopen("trace.txt", "w");
+ if (fp == NULL)
+ exit(-1);
}
-
-void main_deconstructor( void )
+void
+main_deconstructor(void)
{
- fclose( fp );
+ fclose(fp);
}
-
-void __cyg_profile_func_enter( void *this, void *callsite )
+void
+__cyg_profile_func_enter(void *this, void *callsite)
{
- fprintf(fp, "E%p\n", (int *)this);
+ fprintf(fp, "E%p\n", (int *) this);
}
-
-void __cyg_profile_func_exit( void *this, void *callsite )
+void
+__cyg_profile_func_exit(void *this, void *callsite)
{
- fprintf(fp, "X%p\n", (int *)this);
+ fprintf(fp, "X%p\n", (int *) this);
}
-