Linux Audio

Check our new training course

Loading...
Note: File does not exist in v3.5.6.
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __TOOL_PMU_H
 3#define __TOOL_PMU_H
 4
 5#include "pmu.h"
 6
 7struct evsel;
 8struct perf_thread_map;
 9struct print_callbacks;
10
11enum tool_pmu_event {
12	TOOL_PMU__EVENT_NONE = 0,
13	TOOL_PMU__EVENT_DURATION_TIME,
14	TOOL_PMU__EVENT_USER_TIME,
15	TOOL_PMU__EVENT_SYSTEM_TIME,
16	TOOL_PMU__EVENT_HAS_PMEM,
17	TOOL_PMU__EVENT_NUM_CORES,
18	TOOL_PMU__EVENT_NUM_CPUS,
19	TOOL_PMU__EVENT_NUM_CPUS_ONLINE,
20	TOOL_PMU__EVENT_NUM_DIES,
21	TOOL_PMU__EVENT_NUM_PACKAGES,
22	TOOL_PMU__EVENT_SLOTS,
23	TOOL_PMU__EVENT_SMT_ON,
24	TOOL_PMU__EVENT_SYSTEM_TSC_FREQ,
25
26	TOOL_PMU__EVENT_MAX,
27};
28
29#define tool_pmu__for_each_event(ev)					\
30	for ((ev) = TOOL_PMU__EVENT_DURATION_TIME; (ev) < TOOL_PMU__EVENT_MAX; ev++)
31
32const char *tool_pmu__event_to_str(enum tool_pmu_event ev);
33enum tool_pmu_event tool_pmu__str_to_event(const char *str);
34bool tool_pmu__skip_event(const char *name);
35int tool_pmu__num_skip_events(void);
36
37bool tool_pmu__read_event(enum tool_pmu_event ev, u64 *result);
38
39u64 tool_pmu__cpu_slots_per_cycle(void);
40
41bool perf_pmu__is_tool(const struct perf_pmu *pmu);
42
43bool evsel__is_tool(const struct evsel *evsel);
44enum tool_pmu_event evsel__tool_event(const struct evsel *evsel);
45const char *evsel__tool_pmu_event_name(const struct evsel *evsel);
46int evsel__tool_pmu_prepare_open(struct evsel *evsel,
47				 struct perf_cpu_map *cpus,
48				 int nthreads);
49int evsel__tool_pmu_open(struct evsel *evsel,
50			 struct perf_thread_map *threads,
51			 int start_cpu_map_idx, int end_cpu_map_idx);
52int evsel__tool_pmu_read(struct evsel *evsel, int cpu_map_idx, int thread);
53
54struct perf_pmu *perf_pmus__tool_pmu(void);
55
56#endif /* __TOOL_PMU_H */