4b1a631b8a
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>
39 lines
487 B
C
39 lines
487 B
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright(c) 2010-2014 Intel Corporation
|
|
*/
|
|
|
|
#include "oob_monitor.h"
|
|
|
|
void branch_monitor_exit(void)
|
|
{
|
|
}
|
|
|
|
__attribute__((unused)) static float
|
|
apply_policy(__attribute__((unused)) int core)
|
|
{
|
|
return 0.0;
|
|
}
|
|
|
|
int
|
|
add_core_to_monitor(__attribute__((unused)) int core)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
remove_core_from_monitor(__attribute__((unused)) int core)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
branch_monitor_init(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
void
|
|
run_branch_monitor(void)
|
|
{
|
|
}
|