Revert "instrument X using gcc's -finstrument-functions"

This reverts commit 4911b107da.

The idea was to keep the stuff in the git history.
This commit is contained in:
Cedric Roux
2016-05-01 14:13:15 +02:00
parent 4911b107da
commit bd50539fda
2 changed files with 0 additions and 19 deletions
-16
View File
@@ -5,31 +5,15 @@
#include <stdlib.h>
#include <pthread.h>
static volatile int locked = 0;
void __cyg_profile_func_enter (void *func, void *caller)
{
if (locked == 0) abort();
printf("E %p %p %lu\n", func, caller, time(NULL));
}
void __cyg_profile_func_exit (void *func, void *caller)
{
if (locked == 0) abort();
printf("X %p %p %lu\n", func, caller, time(NULL));
}
void glock(gui *_gui)
{
struct gui *g = _gui;
if (pthread_mutex_lock(g->lock)) ERR("mutex error\n");
locked = 1;
}
void gunlock(gui *_gui)
{
struct gui *g = _gui;
locked = 0;
if (pthread_mutex_unlock(g->lock)) ERR("mutex error\n");
}