2017-12-19 15:49:02 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2010-2014 Intel Corporation
|
2014-11-25 16:18:05 +00:00
|
|
|
|
2016-04-11 08:50:31 +00:00
|
|
|
ifneq ($(shell pkg-config --atleast-version=0.9.3 libvirt; echo $$?), 0)
|
|
|
|
$(error vm_power_manager requires libvirt >= 0.9.3)
|
|
|
|
else
|
|
|
|
|
2014-11-25 16:18:05 +00:00
|
|
|
ifeq ($(RTE_SDK),)
|
|
|
|
$(error "Please define RTE_SDK environment variable")
|
|
|
|
endif
|
|
|
|
|
2019-03-27 13:58:05 +00:00
|
|
|
# Default target, detect a build directory, by looking for a path with a .config
|
|
|
|
RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))
|
2014-11-25 16:18:05 +00:00
|
|
|
|
|
|
|
include $(RTE_SDK)/mk/rte.vars.mk
|
|
|
|
|
2017-10-09 13:13:16 +00:00
|
|
|
# binary name
|
|
|
|
APP = vm_power_mgr
|
|
|
|
|
|
|
|
# all source are stored in SRCS-y
|
|
|
|
SRCS-y := main.c vm_power_cli.c power_manager.c channel_manager.c
|
examples/vm_power: add core list parameter
Add in the '-l' command line parameter (also --core-list)
So the user can now pass --corelist=4,6,8-10 and it will
expand out to 4,6,8,9,10 using the parse function provided
in parse.c (parse_set).
This list of cores is then used to enable out-of-band monitoring
to scale up and down these cores based on the ratio of branch
hits versus branch misses. The ratio will be low when a poll
loop is spinning with no packets being received, so the frequency
will be scaled down.
Also , as part of this change, we introduce a core_info struct
which keeps information on each core in the system, and whether
we're doing out of band monitoring on them.
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-07-13 14:22:55 +00:00
|
|
|
SRCS-y += channel_monitor.c parse.c
|
examples/vm_power: add oob monitoring functions
This patch introduces the out-of-band (oob) core monitoring
functions.
The functions are similar to the channel manager functions.
There are function to add and remove cores from the
list of cores being monitored. There is a function to initialise
the monitor setup, run the monitor thread, and exit the monitor.
The monitor thread runs in it's own lcore, and is separate
functionality to the channel monitor which is epoll based.
THis thread is timer based. It loops through all monitored cores,
calculates the branch ratio, scales up or down the core, then
sleeps for an interval (~250 uS).
The method it uses to read the branch counters is a pread on the
/dev/cpu/x/msr file, so the 'msr' kernel module needs to be loaded.
Also, since the msr.h file has been made unavailable in recent
kernels, we have #defines for the relevant MSRs included in the
code.
The makefile has a switch for x86 and non-x86 platforms,
and compiles stub function for non-x86 platforms.
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-07-13 14:22:56 +00:00
|
|
|
ifeq ($(CONFIG_RTE_ARCH_X86_64),y)
|
|
|
|
SRCS-y += oob_monitor_x86.c
|
|
|
|
else
|
|
|
|
SRCS-y += oob_monitor_nop.c
|
|
|
|
endif
|
2017-10-09 13:13:16 +00:00
|
|
|
|
2014-12-17 12:55:24 +00:00
|
|
|
CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
|
2014-11-25 16:18:05 +00:00
|
|
|
CFLAGS += $(WERROR_FLAGS)
|
|
|
|
|
2014-12-17 12:55:24 +00:00
|
|
|
LDLIBS += -lvirt
|
|
|
|
|
2018-10-17 13:05:31 +00:00
|
|
|
JANSSON := $(shell pkg-config --exists jansson; echo $$?)
|
|
|
|
ifeq ($(JANSSON), 0)
|
|
|
|
LDLIBS += $(shell pkg-config --libs jansson)
|
|
|
|
CFLAGS += -DUSE_JANSSON
|
|
|
|
endif
|
|
|
|
|
2017-10-11 16:18:51 +00:00
|
|
|
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
|
|
|
|
LDLIBS += -lrte_pmd_ixgbe
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y)
|
|
|
|
LDLIBS += -lrte_pmd_i40e
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD),y)
|
|
|
|
LDLIBS += -lrte_pmd_bnxt
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2014-11-25 16:18:05 +00:00
|
|
|
# workaround for a gcc bug with noreturn attribute
|
|
|
|
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
|
|
|
|
ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
|
|
|
|
CFLAGS_main.o += -Wno-return-type
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(RTE_SDK)/mk/rte.extapp.mk
|
2016-04-11 08:50:31 +00:00
|
|
|
|
|
|
|
endif # libvirt check
|