Commit bd50539f authored by Cedric Roux's avatar Cedric Roux

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

This reverts commit 4911b107.

The idea was to keep the stuff in the git history.
parent 4911b107
...@@ -10,9 +10,6 @@ gui.a: $(OBJS) ...@@ -10,9 +10,6 @@ gui.a: $(OBJS)
test: test.o gui.a test: test.o gui.a
$(CC) -o test $(OBJS) test.o -lX11 -pthread -lm $(CC) -o test $(OBJS) test.o -lX11 -pthread -lm
x.o:x.c
$(CC) $(CFLAGS) -o $@ -c $< -finstrument-functions
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -o $@ -c $< $(CC) $(CFLAGS) -o $@ -c $<
......
...@@ -5,31 +5,15 @@ ...@@ -5,31 +5,15 @@
#include <stdlib.h> #include <stdlib.h>
#include <pthread.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) void glock(gui *_gui)
{ {
struct gui *g = _gui; struct gui *g = _gui;
if (pthread_mutex_lock(g->lock)) ERR("mutex error\n"); if (pthread_mutex_lock(g->lock)) ERR("mutex error\n");
locked = 1;
} }
void gunlock(gui *_gui) void gunlock(gui *_gui)
{ {
struct gui *g = _gui; struct gui *g = _gui;
locked = 0;
if (pthread_mutex_unlock(g->lock)) ERR("mutex error\n"); if (pthread_mutex_unlock(g->lock)) ERR("mutex error\n");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment