Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / perf / util / tool_pmu.h
bloba60184859080f1d930250147c920a01b5cd6664c
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __TOOL_PMU_H
3 #define __TOOL_PMU_H
5 #include "pmu.h"
7 struct evsel;
8 struct perf_thread_map;
9 struct print_callbacks;
11 enum 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,
26 TOOL_PMU__EVENT_MAX,
29 #define tool_pmu__for_each_event(ev) \
30 for ((ev) = TOOL_PMU__EVENT_DURATION_TIME; (ev) < TOOL_PMU__EVENT_MAX; ev++)
32 const char *tool_pmu__event_to_str(enum tool_pmu_event ev);
33 enum tool_pmu_event tool_pmu__str_to_event(const char *str);
34 bool tool_pmu__skip_event(const char *name);
35 int tool_pmu__num_skip_events(void);
37 bool tool_pmu__read_event(enum tool_pmu_event ev, u64 *result);
39 u64 tool_pmu__cpu_slots_per_cycle(void);
41 bool perf_pmu__is_tool(const struct perf_pmu *pmu);
43 bool evsel__is_tool(const struct evsel *evsel);
44 enum tool_pmu_event evsel__tool_event(const struct evsel *evsel);
45 const char *evsel__tool_pmu_event_name(const struct evsel *evsel);
46 int evsel__tool_pmu_prepare_open(struct evsel *evsel,
47 struct perf_cpu_map *cpus,
48 int nthreads);
49 int evsel__tool_pmu_open(struct evsel *evsel,
50 struct perf_thread_map *threads,
51 int start_cpu_map_idx, int end_cpu_map_idx);
52 int evsel__tool_pmu_read(struct evsel *evsel, int cpu_map_idx, int thread);
54 struct perf_pmu *perf_pmus__tool_pmu(void);
56 #endif /* __TOOL_PMU_H */