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