Blame pqos/monitor.h

Packit bcb633
/*
Packit bcb633
 * BSD LICENSE
Packit bcb633
 *
Packit bcb633
 * Copyright(c) 2014-2017 Intel Corporation. All rights reserved.
Packit bcb633
 * All rights reserved.
Packit bcb633
 *
Packit bcb633
 * Redistribution and use in source and binary forms, with or without
Packit bcb633
 * modification, are permitted provided that the following conditions
Packit bcb633
 * are met:
Packit bcb633
 *
Packit bcb633
 *   * Redistributions of source code must retain the above copyright
Packit bcb633
 *     notice, this list of conditions and the following disclaimer.
Packit bcb633
 *   * Redistributions in binary form must reproduce the above copyright
Packit bcb633
 *     notice, this list of conditions and the following disclaimer in
Packit bcb633
 *     the documentation and/or other materials provided with the
Packit bcb633
 *     distribution.
Packit bcb633
 *   * Neither the name of Intel Corporation nor the names of its
Packit bcb633
 *     contributors may be used to endorse or promote products derived
Packit bcb633
 *     from this software without specific prior written permission.
Packit bcb633
 *
Packit bcb633
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit bcb633
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit bcb633
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Packit bcb633
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Packit bcb633
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Packit bcb633
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Packit bcb633
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Packit bcb633
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Packit bcb633
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit bcb633
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit bcb633
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit bcb633
 */
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * Monitoring module
Packit bcb633
 */
Packit bcb633
Packit bcb633
#include <stdint.h>
Packit bcb633
#include <stdio.h>
Packit bcb633
#include "pqos.h"
Packit bcb633
Packit bcb633
#ifndef __MONITOR_H__
Packit bcb633
#define __MONITOR_H__
Packit bcb633
Packit bcb633
#ifdef __cplusplus
Packit bcb633
extern "C" {
Packit bcb633
#endif
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Verifies and translates multiple monitoring config strings into
Packit bcb633
 *        internal PID monitoring configuration
Packit bcb633
 *
Packit bcb633
 * @param arg argument passed to -p command line option
Packit bcb633
 */
Packit bcb633
void selfn_monitor_pids(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Looks for processes with highest CPU usage on the system and
Packit bcb633
 *        starts monitoring for them. Processes are displayed and sorted
Packit bcb633
 *        afterwards by LLC occupancy
Packit bcb633
 */
Packit bcb633
void selfn_monitor_top_pids(void);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Selects top-like monitoring format
Packit bcb633
 *
Packit bcb633
 * @param arg not used
Packit bcb633
 */
Packit bcb633
void selfn_monitor_top_like(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Selects monitoring interval
Packit bcb633
 *
Packit bcb633
 * @param arg string passed to -i command line option
Packit bcb633
 */
Packit bcb633
void selfn_monitor_interval(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Selects monitoring time
Packit bcb633
 *
Packit bcb633
 * @param arg string passed to -t command line option
Packit bcb633
 */
Packit bcb633
void selfn_monitor_time(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Selects type of monitoring output file
Packit bcb633
 *
Packit bcb633
 * @param arg string passed to -u command line option
Packit bcb633
 */
Packit bcb633
void selfn_monitor_file_type(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Selects monitoring output file
Packit bcb633
 *
Packit bcb633
 * @param arg string passed to -o command line option
Packit bcb633
 */
Packit bcb633
void selfn_monitor_file(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Translates multiple monitoring request strings into
Packit bcb633
 *        internal monitoring request structures
Packit bcb633
 *
Packit bcb633
 * @param str string passed to -m command line option
Packit bcb633
 */
Packit bcb633
void selfn_monitor_cores(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Stops monitoring on selected core(s)/pid(s)
Packit bcb633
 *
Packit bcb633
 */
Packit bcb633
void monitor_stop(void);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Starts monitoring on selected core(s)/pid(s)
Packit bcb633
 *
Packit bcb633
 * @param [in] cpu_info cpu information structure
Packit bcb633
 * @param [in] cap_mon monitoring capability
Packit bcb633
 *
Packit bcb633
 * @return Operation status
Packit bcb633
 * @retval 0 OK
Packit bcb633
 * @retval -1 error
Packit bcb633
 */
Packit bcb633
int monitor_setup(const struct pqos_cpuinfo *cpu_info,
Packit bcb633
                  const struct pqos_capability * const cap_mon);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Frees any allocated memory during parameter selection and
Packit bcb633
 *        monitoring setup.
Packit bcb633
 */
Packit bcb633
void monitor_cleanup(void);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Monitors resources and writes data into selected stream.
Packit bcb633
 */
Packit bcb633
void monitor_loop(void);
Packit bcb633
Packit bcb633
#ifdef __cplusplus
Packit bcb633
}
Packit bcb633
#endif
Packit bcb633
Packit bcb633
#endif /* __MONITOR_H__ */