Commit 3178bb11 authored by julien.delange's avatar julien.delange
Browse files

integrate gprof for LEON and native, testsuite runs fine



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@643 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent c695746d
...@@ -12,3 +12,5 @@ LD = arm-linux-elf-ld ...@@ -12,3 +12,5 @@ LD = arm-linux-elf-ld
TARGET_LDFLAGS = -Wl,-elf2flt -D__PIC__ -fpic -msingle-pic-base -mswp-byte-writes -lpthread -lrt TARGET_LDFLAGS = -Wl,-elf2flt -D__PIC__ -fpic -msingle-pic-base -mswp-byte-writes -lpthread -lrt
target-clean: target-clean:
target-objects:
...@@ -13,3 +13,5 @@ LD = arm-linux-ld ...@@ -13,3 +13,5 @@ LD = arm-linux-ld
TARGET_LDFLAGS = -lpthread -lrt TARGET_LDFLAGS = -lpthread -lrt
target-clean: target-clean:
target-objects:
...@@ -34,7 +34,7 @@ endif ...@@ -34,7 +34,7 @@ endif
GCC=$(CC) GCC=$(CC)
CFLAGS=-Wall $(USER_CFLAGS) $(TARGET_CFLAGS) -Werror CFLAGS=-Wall $(USER_CFLAGS) $(TARGET_CFLAGS)
CPPFLAGS=$(CFLAGS) $(USER_CPPFLAGS) CPPFLAGS=$(CFLAGS) $(USER_CPPFLAGS)
LDFLAGS=$(TARGET_LDFLAGS) $(USER_LDFLAGS) LDFLAGS=$(TARGET_LDFLAGS) $(USER_LDFLAGS)
...@@ -109,10 +109,6 @@ else ...@@ -109,10 +109,6 @@ else
main.o main.o
endif endif
ifeq ($(TARGET),leon.rtems)
PO_HI_OBJS+=po_hi_gprof_rtems_leon.o
endif
################################################################################ ################################################################################
# Simulink # Simulink
...@@ -171,11 +167,11 @@ endif ...@@ -171,11 +167,11 @@ endif
compile-node: $(BINARY) compile-node: $(BINARY)
ifeq ($(TARGET), leon.rtems) ifeq ($(TARGET), leon.rtems)
OBJS = $(USER_OBJS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(EXTERNAL_OBJECTS) OBJS = $(USER_OBJS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(EXTERNAL_OBJECTS)
$(BINARY): check-rtems compile-po-hi $(USER_OBJS) $(GENERATED_OBJS) $(BINARY): target-objects check-rtems compile-po-hi $(USER_OBJS) $(GENERATED_OBJS)
$(make-exe) $(make-exe)
else else
$(BINARY): compile-po-hi $(USER_OBJS) $(GENERATED_OBJS) $(BINARY): target-objects compile-po-hi $(USER_OBJS) $(GENERATED_OBJS) $(TARGET_OBJECTS)
$(CC) -o $(BINARY) $(EXTERNAL_OBJECTS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(USER_OBJS) $(LDFLAGS) $(CC) -o $(BINARY) $(EXTERNAL_OBJECTS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(USER_OBJS) $(LDFLAGS)
endif endif
......
...@@ -10,3 +10,5 @@ LD = ...@@ -10,3 +10,5 @@ LD =
TARGET_LDFLAGS = TARGET_LDFLAGS =
target-clean: target-clean:
target-objects:
...@@ -49,7 +49,15 @@ define bsp-link-cxx ...@@ -49,7 +49,15 @@ define bsp-link-cxx
endef endef
ifdef USE_GPROF ifdef USE_GPROF
TARGET_LDFLAGS+=-Wl,--wrap,Clock_isr TARGET_LDFLAGS+=-Wl,--wrap,Clock_isr -pg
TARGET_CFLAGS+=-D__PO_HI_USE_GPROF TARGET_CFLAGS+=-D__PO_HI_USE_GPROF -pg
EXTERNAL_OBJECTS+=po_hi_gprof_rtems_leon.o
target-objects:
$(CC) $(INCLUDE) $(TARGET_INCLUDE) -D__PO_HI_USE_GPROF -Wall -c -o po_hi_gprof_rtems_leon.o $(RUNTIME_PATH)/src/po_hi_gprof_rtems_leon.c
else
target-objects:
endif endif
...@@ -66,6 +66,7 @@ static char sccsid[] = "@(#)gmon.c 1.0 (E.S.A) 10/05/2010"; ...@@ -66,6 +66,7 @@ static char sccsid[] = "@(#)gmon.c 1.0 (E.S.A) 10/05/2010";
#include <bsp.h> #include <bsp.h>
#define CONFIG_OS_PROFILE_OVER_SERIAL 1 #define CONFIG_OS_PROFILE_OVER_SERIAL 1
#define SERIAL_VERBOSE_MODE 1
/* /*
* Histogram counters are unsigned shorts (according to the kernel). * Histogram counters are unsigned shorts (according to the kernel).
...@@ -611,6 +612,10 @@ int initialize_serial() ...@@ -611,6 +612,10 @@ int initialize_serial()
tcflush(serialFD , TCIFLUSH); tcflush(serialFD , TCIFLUSH);
tcsetattr(serialFD , TCSANOW , &newtio); tcsetattr(serialFD , TCSANOW , &newtio);
#if(SERIAL_VERBOSE_MODE == 1)
printk("Serial init done = %d" , serialFD);
#endif
return 0; return 0;
} }
......
...@@ -106,6 +106,7 @@ int __po_hi_wait_initialization () ...@@ -106,6 +106,7 @@ int __po_hi_wait_initialization ()
void __po_hi_wait_end_of_instrumentation () void __po_hi_wait_end_of_instrumentation ()
{ {
#include <po_hi_time.h> #include <po_hi_time.h>
#include <unistd.h>
__po_hi_time_t now; __po_hi_time_t now;
__po_hi_get_time (&now); __po_hi_get_time (&now);
......
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