Makefile: adding profiling option in Makefile

This patch added a option to control profiling on/off, by default,
profiling is on, so that VTune can be used to capture perf data from
SOS.
When running: make PROFILING=0, it will disable profiling and pmu will
be pass-thru and perf tools can be run directly inside UOS.

Signed-off-by: Min He <min.he@intel.com>
This commit is contained in:
Min He 2019-02-14 08:57:21 +00:00 committed by wenlingz
parent 328c276152
commit fd61d626b3

View File

@ -32,6 +32,8 @@ ARCH_ASFLAGS :=
ARCH_ARFLAGS :=
ARCH_LDFLAGS :=
PROFILING ?= 1
.PHONY: default
default: all
@ -239,7 +241,10 @@ endif
C_OBJS := $(patsubst %.c,$(HV_OBJDIR)/%.o,$(C_SRCS))
ifneq ($(CONFIG_RELEASE),y)
CFLAGS += -DHV_DEBUG -DPROFILING_ON -fno-omit-frame-pointer
CFLAGS += -DHV_DEBUG -fno-omit-frame-pointer
ifeq ($(PROFILING), 1)
CFLAGS += -DPROFILING_ON
endif
endif
S_OBJS := $(patsubst %.S,$(HV_OBJDIR)/%.o,$(S_SRCS))