/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ #ifndef __HWMON_PMU_H #define __HWMON_PMU_H
#include"pmu.h" #include <stdbool.h>
struct list_head; struct perf_thread_map;
/** * enum hwmon_type: * * As described in Documentation/hwmon/sysfs-interface.rst hwmon events are * defined over multiple files of the form <type><num>_<item>. This enum * captures potential <type> values. * * This enum is exposed for testing.
*/ enum hwmon_type {
HWMON_TYPE_NONE,
/** * enum hwmon_item: * * Similar to enum hwmon_type but describes the item part of a a sysfs filename. * * This enum is exposed for testing.
*/ enum hwmon_item {
HWMON_ITEM_NONE,
/** * union hwmon_pmu_event_key: Key for hwmon_pmu->events as such each key * represents an event. * union is exposed for testing to ensure problems are avoided on big * endian machines. * * Related hwmon files start <type><number> that this key represents.
*/ union hwmon_pmu_event_key { long type_and_num; struct { int num :16; enum hwmon_type type :8;
};
};
/** * parse_hwmon_filename() - Parse filename into constituent parts. * * @filename: To be parsed, of the form <type><number>_<item>. * @type: The type defined from the parsed file name. * @number: The number of the type, for example there may be more than 1 fan. * @item: A hwmon <type><number> may have multiple associated items. * @alarm: Is the filename for an alarm value? * * An example of a hwmon filename is "temp1_input". The type is temp for a * temperature value. The number is 1. The item within the file is an input * value - the temperature itself. This file doesn't contain an alarm value. * * Exposed for testing.
*/ bool parse_hwmon_filename(constchar *filename, enum hwmon_type *type, int *number, enum hwmon_item *item, bool *alarm);
/** * hwmon_pmu__new() - Allocate and construct a hwmon PMU. * * @pmus: The list of PMUs to be added to. * @hwmon_dir: The path to a hwmon directory. * @sysfs_name: Name of the hwmon sysfs directory like hwmon0. * @name: The contents of the "name" file in the hwmon directory. * * Exposed for testing. Regular construction should happen via * perf_pmus__read_hwmon_pmus.
*/ struct perf_pmu *hwmon_pmu__new(struct list_head *pmus, constchar *hwmon_dir, constchar *sysfs_name, constchar *name); void hwmon_pmu__exit(struct perf_pmu *pmu);
int perf_pmus__read_hwmon_pmus(struct list_head *pmus);
int evsel__hwmon_pmu_open(struct evsel *evsel, struct perf_thread_map *threads, int start_cpu_map_idx, int end_cpu_map_idx); int evsel__hwmon_pmu_read(struct evsel *evsel, int cpu_map_idx, int thread);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.