File: tool_pmu.h

package info (click to toggle)
linux 6.19.6-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,760,712 kB
  • sloc: ansic: 27,010,185; asm: 273,400; sh: 151,347; python: 81,280; makefile: 58,564; perl: 34,311; xml: 21,064; cpp: 5,986; yacc: 4,841; lex: 2,901; awk: 1,707; sed: 30; ruby: 25
file content (64 lines) | stat: -rw-r--r-- 1,854 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOL_PMU_H
#define __TOOL_PMU_H

#include "pmu.h"

struct evsel;
struct perf_thread_map;
struct print_callbacks;

enum tool_pmu_event {
	TOOL_PMU__EVENT_NONE = 0,
	TOOL_PMU__EVENT_DURATION_TIME,
	TOOL_PMU__EVENT_USER_TIME,
	TOOL_PMU__EVENT_SYSTEM_TIME,
	TOOL_PMU__EVENT_HAS_PMEM,
	TOOL_PMU__EVENT_NUM_CORES,
	TOOL_PMU__EVENT_NUM_CPUS,
	TOOL_PMU__EVENT_NUM_CPUS_ONLINE,
	TOOL_PMU__EVENT_NUM_DIES,
	TOOL_PMU__EVENT_NUM_PACKAGES,
	TOOL_PMU__EVENT_SLOTS,
	TOOL_PMU__EVENT_SMT_ON,
	TOOL_PMU__EVENT_SYSTEM_TSC_FREQ,
	TOOL_PMU__EVENT_CORE_WIDE,
	TOOL_PMU__EVENT_TARGET_CPU,

	TOOL_PMU__EVENT_MAX,
};

#define tool_pmu__for_each_event(ev)					\
	for ((ev) = TOOL_PMU__EVENT_DURATION_TIME; (ev) < TOOL_PMU__EVENT_MAX; ev++)

const char *tool_pmu__event_to_str(enum tool_pmu_event ev);
enum tool_pmu_event tool_pmu__str_to_event(const char *str);
bool tool_pmu__skip_event(const char *name);
int tool_pmu__num_skip_events(void);

bool tool_pmu__read_event(enum tool_pmu_event ev,
			  struct evsel *evsel,
			  bool system_wide,
			  const char *user_requested_cpu_list,
			  u64 *result);


u64 tool_pmu__cpu_slots_per_cycle(void);

bool perf_pmu__is_tool(const struct perf_pmu *pmu);
struct perf_cpu_map *tool_pmu__cpus(struct perf_event_attr *attr);

bool evsel__is_tool(const struct evsel *evsel);
enum tool_pmu_event evsel__tool_event(const struct evsel *evsel);
const char *evsel__tool_pmu_event_name(const struct evsel *evsel);
int evsel__tool_pmu_prepare_open(struct evsel *evsel,
				 struct perf_cpu_map *cpus,
				 int nthreads);
int evsel__tool_pmu_open(struct evsel *evsel,
			 struct perf_thread_map *threads,
			 int start_cpu_map_idx, int end_cpu_map_idx);
int evsel__tool_pmu_read(struct evsel *evsel, int cpu_map_idx, int thread);

struct perf_pmu *tool_pmu__new(void);

#endif /* __TOOL_PMU_H */