aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/cpu_mf.h
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2013-12-12 10:32:47 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-12-16 08:37:51 -0500
commit8c069ff4bd6063a3f15e606c882e03f75c7e7711 (patch)
tree39fc5d8b13aee5c4c9a8ca2e21e4fefd9a308f1a /arch/s390/include/asm/cpu_mf.h
parentc716832513f30430179b60ac5ffd203c53f7eb40 (diff)
s390/perf: add support for the CPU-Measurement Sampling Facility
Introduce a perf PMU, "cpum_sf", to support the CPU-Measurement Sampling Facility. You can control the sampling facility through this perf PMU interfaces. Perf sampling events are created for hardware samples. For details about the CPU-Measurement Sampling Facility, see "The Load-Program-Parameter and the CPU-Measurement Facilities" (SA23-2260). Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/cpu_mf.h')
-rw-r--r--arch/s390/include/asm/cpu_mf.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h
index f6dddeaad965..d707abc26157 100644
--- a/arch/s390/include/asm/cpu_mf.h
+++ b/arch/s390/include/asm/cpu_mf.h
@@ -210,6 +210,20 @@ static inline int lsctl(struct hws_lsctl_request_block *req)
210 210
211/* Sampling control helper functions */ 211/* Sampling control helper functions */
212 212
213#include <linux/time.h>
214
215static inline unsigned long freq_to_sample_rate(struct hws_qsi_info_block *qsi,
216 unsigned long freq)
217{
218 return (USEC_PER_SEC / freq) * qsi->cpu_speed;
219}
220
221static inline unsigned long sample_rate_to_freq(struct hws_qsi_info_block *qsi,
222 unsigned long rate)
223{
224 return USEC_PER_SEC * qsi->cpu_speed / rate;
225}
226
213#define SDB_TE_ALERT_REQ_MASK 0x4000000000000000UL 227#define SDB_TE_ALERT_REQ_MASK 0x4000000000000000UL
214#define SDB_TE_BUFFER_FULL_MASK 0x8000000000000000UL 228#define SDB_TE_BUFFER_FULL_MASK 0x8000000000000000UL
215 229