aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf
diff options
context:
space:
mode:
authorCody P Schafer <cody@linux.vnet.ibm.com>2014-03-14 01:00:37 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-03-23 18:48:29 -0400
commita67f144739c42f99e2a4cf43e8cf4e1cc75719fd (patch)
tree80f169c3589101c4fd4fd24b3b4c218f7f71b66d /arch/powerpc/perf
parent827f798ac13c27c4a122175c60a3a684b59e9103 (diff)
powerpc/perf: Add hv_gpci interface header
"H_GetPerformanceCounterInfo" (refered to as hv_gpci or just gpci from here on) is an interface to retrieve specific performance counters and other data from the hypervisor. All outputs have a fixed format. This header only describes the portions of the interface that we plan on using in linux at this time. Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/perf')
-rw-r--r--arch/powerpc/perf/hv-gpci.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/arch/powerpc/perf/hv-gpci.h b/arch/powerpc/perf/hv-gpci.h
new file mode 100644
index 000000000000..b25f460c9cce
--- /dev/null
+++ b/arch/powerpc/perf/hv-gpci.h
@@ -0,0 +1,73 @@
1#ifndef LINUX_POWERPC_PERF_HV_GPCI_H_
2#define LINUX_POWERPC_PERF_HV_GPCI_H_
3
4#include <linux/types.h>
5
6/* From the document "H_GetPerformanceCounterInfo Interface" v1.07 */
7
8/* H_GET_PERF_COUNTER_INFO argument */
9struct hv_get_perf_counter_info_params {
10 __be32 counter_request; /* I */
11 __be32 starting_index; /* IO */
12 __be16 secondary_index; /* IO */
13 __be16 returned_values; /* O */
14 __be32 detail_rc; /* O, only needed when called via *_norets() */
15
16 /*
17 * O, size each of counter_value element in bytes, only set for version
18 * >= 0x3
19 */
20 __be16 cv_element_size;
21
22 /* I, 0 (zero) for versions < 0x3 */
23 __u8 counter_info_version_in;
24
25 /* O, 0 (zero) if version < 0x3. Must be set to 0 when making hcall */
26 __u8 counter_info_version_out;
27 __u8 reserved[0xC];
28 __u8 counter_value[];
29} __packed;
30
31/*
32 * counter info version => fw version/reference (spec version)
33 *
34 * 8 => power8 (1.07)
35 * [7 is skipped by spec 1.07]
36 * 6 => TLBIE (1.07)
37 * 5 => v7r7m0.phyp (1.05)
38 * [4 skipped]
39 * 3 => v7r6m0.phyp (?)
40 * [1,2 skipped]
41 * 0 => v7r{2,3,4}m0.phyp (?)
42 */
43#define COUNTER_INFO_VERSION_CURRENT 0x8
44
45/*
46 * These determine the counter_value[] layout and the meaning of starting_index
47 * and secondary_index.
48 *
49 * Unless otherwise noted, @secondary_index is unused and ignored.
50 */
51enum counter_info_requests {
52
53 /* GENERAL */
54
55 /* @starting_index: must be -1 (to refer to the current partition)
56 */
57 CIR_SYSTEM_PERFORMANCE_CAPABILITIES = 0X40,
58};
59
60struct cv_system_performance_capabilities {
61 /* If != 0, allowed to collect data from other partitions */
62 __u8 perf_collect_privileged;
63
64 /* These following are only valid if counter_info_version >= 0x3 */
65#define CV_CM_GA (1 << 7)
66#define CV_CM_EXPANDED (1 << 6)
67#define CV_CM_LAB (1 << 5)
68 /* remaining bits are reserved */
69 __u8 capability_mask;
70 __u8 reserved[0xE];
71} __packed;
72
73#endif