Commit 3b49dc62 authored by julien.delange's avatar julien.delange
Browse files

* add profiling mode with gprof




git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@607 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent b7660538
......@@ -34,4 +34,12 @@ int __po_hi_wait_initialization ();
* if there is an error.
*/
#ifdef __PO_HI_USE_GPROF
void __po_hi_wait_end_of_instrumentation ();
/*
* Wait a certain amount of time to finish the
* execution of the system.
*/
#endif
#endif /* __PO_HI_MAIN__ */
......@@ -32,6 +32,7 @@ ifneq ($(USER_LD),)
LD=$(USER_LD)
endif
GCC=$(CC)
CFLAGS=-Wall $(USER_CFLAGS) $(TARGET_CFLAGS) -Werror
CPPFLAGS=$(CFLAGS) $(USER_CPPFLAGS)
......@@ -42,7 +43,10 @@ ifeq ($(ENABLE_DYNAMIC_CONFIGURATION),1)
CFLAGS+=-D__PO_HI_USE_DYNAMIC_CONFIGURATION
endif
ifdef USE_GPROF
CFLAGS+=-pg -D__PO_HI_USE_GPROF
LDFLAGS+=-pg
endif
ifdef TARGET_INCLUDE
INCLUDE=-I. -I$(RUNTIME_PATH)/include/ $(TARGET_INCLUDE)
......@@ -186,3 +190,9 @@ clean: target-clean
if test ! "$(CLEANDIRS)" = ""; then \
rm -rf $(CLEANDIRS); \
fi
ifdef USE_GPROF
gprof:
./$(BINARY)
gprof ./$(BINARY) > gprof.out
endif
......@@ -101,3 +101,14 @@ int __po_hi_wait_initialization ()
pthread_mutex_unlock (&mutex_init);
return (__PO_HI_SUCCESS);
}
#ifdef __PO_HI_USE_GPROF
void __po_hi_wait_end_of_instrumentation ()
{
#include <po_hi_time.h>
__po_hi_time_t now;
__po_hi_get_time (&now);
__po_hi_delay_until (__po_hi_add_times (now, __po_hi_seconds (10)));
}
#endif
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