Blame pqos/alloc.h

Packit Service 5befb9
/*
Packit Service 5befb9
 * BSD LICENSE
Packit Service 5befb9
 *
Packit Service 8a4b7a
 * Copyright(c) 2014-2020 Intel Corporation. All rights reserved.
Packit Service 5befb9
 * All rights reserved.
Packit Service 5befb9
 *
Packit Service 5befb9
 * Redistribution and use in source and binary forms, with or without
Packit Service 5befb9
 * modification, are permitted provided that the following conditions
Packit Service 5befb9
 * are met:
Packit Service 5befb9
 *
Packit Service 5befb9
 *   * Redistributions of source code must retain the above copyright
Packit Service 5befb9
 *     notice, this list of conditions and the following disclaimer.
Packit Service 5befb9
 *   * Redistributions in binary form must reproduce the above copyright
Packit Service 5befb9
 *     notice, this list of conditions and the following disclaimer in
Packit Service 5befb9
 *     the documentation and/or other materials provided with the
Packit Service 5befb9
 *     distribution.
Packit Service 5befb9
 *   * Neither the name of Intel Corporation nor the names of its
Packit Service 5befb9
 *     contributors may be used to endorse or promote products derived
Packit Service 5befb9
 *     from this software without specific prior written permission.
Packit Service 5befb9
 *
Packit Service 5befb9
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit Service 5befb9
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit Service 5befb9
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Packit Service 5befb9
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Packit Service 5befb9
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Packit Service 5befb9
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Packit Service 5befb9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Packit Service 5befb9
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Packit Service 5befb9
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit Service 5befb9
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit Service 5befb9
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit Service 5befb9
 */
Packit Service 5befb9
Packit Service 5befb9
/**
Packit Service 5befb9
 * Allocation module
Packit Service 5befb9
 */
Packit Service 5befb9
Packit Service 5befb9
#include <stdint.h>
Packit Service 5befb9
#include <stdio.h>
Packit Service 5befb9
#include "pqos.h"
Packit Service 5befb9
Packit Service 5befb9
#ifndef __ALLOCATION_H__
Packit Service 5befb9
#define __ALLOCATION_H__
Packit Service 5befb9
Packit Service 5befb9
#ifdef __cplusplus
Packit Service 5befb9
extern "C" {
Packit Service 5befb9
#endif
Packit Service 5befb9
Packit Service 5befb9
/**
Packit Service 5befb9
 * @brief Defines allocation class of service
Packit Service 5befb9
 *
Packit Service 5befb9
 * @param [in] arg string passed to -e command line option
Packit Service 5befb9
 */
Packit Service 5befb9
void selfn_allocation_class(const char *arg);
Packit Service 5befb9
Packit Service 5befb9
/**
Packit Service 5befb9
 * @brief Associates cores with selected class of service
Packit Service 5befb9
 *
Packit Service 5befb9
 * @param [in] arg string passed to -a command line option
Packit Service 5befb9
 */
Packit Service 5befb9
void selfn_allocation_assoc(const char *arg);
Packit Service 5befb9
Packit Service 5befb9
/**
Packit Service 5befb9
 * @brief Prints information about cache allocation settings in the system
Packit Service 5befb9
 *
Packit Service 5befb9
 * @param [in] cap_mon monitoring capability structure
Packit Service 5befb9
 * @param [in] cap_l3ca L3 CAT capability structures
Packit Service 5befb9
 * @param [in] cap_l2ca L2 CAT capability structures
Packit Service 5befb9
 * @param [in] cap_mba MBA capability structures
Packit Service 5befb9
 * @param [in] cpu_info cpu information structure
Packit Service 5befb9
 * @param [in] verbose verbose mode flag
Packit Service 5befb9
 */
Packit Service 5befb9
void alloc_print_config(const struct pqos_capability *cap_mon,
Packit Service 5befb9
                        const struct pqos_capability *cap_l3ca,
Packit Service 5befb9
                        const struct pqos_capability *cap_l2ca,
Packit Service 5befb9
                        const struct pqos_capability *cap_mba,
Packit Service 5befb9
                        const struct pqos_cpuinfo *cpu_info,
Packit Service 5befb9
                        const int verbose);
Packit Service 5befb9
Packit Service 5befb9
/**
Packit Service 5befb9
 * @brief Applies allocation settings previously selected via
Packit Service 5befb9
 *        selfn_xxxx() functions
Packit Service 5befb9
 *
Packit Service 5befb9
 * @param [in] cap_l3ca CAT capability structures
Packit Service 5befb9
 * @param [in] cap_l2ca CAT capability structures
Packit Service 5befb9
 * @param [in] cap_mba MBA capability structures
Packit Service 5befb9
 * @param [in] cpu cpu information structure
Packit Service 5befb9
 *
Packit Service 5befb9
 * @return Operation status
Packit Service 5befb9
 * @retval 0 there was no new config to apply
Packit Service 5befb9
 * @retavl 1 there was new config to apply and it went smoothly
Packit Service 5befb9
 * @retval -1 an error occurred when applying new config
Packit Service 5befb9
 */
Packit Service 5befb9
int alloc_apply(const struct pqos_capability *cap_l3ca,
Packit Service 5befb9
                const struct pqos_capability *cap_l2ca,
Packit Service 5befb9
                const struct pqos_capability *cap_mba,
Packit Service 5befb9
                const struct pqos_cpuinfo *cpu);
Packit Service 5befb9
Packit Service 5befb9
Packit Service 5befb9
#ifdef __cplusplus
Packit Service 5befb9
}
Packit Service 5befb9
#endif
Packit Service 5befb9
Packit Service 5befb9
#endif /* __ALLOCATION_H__ */