summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/cpu_mf.h
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2017-10-27 16:45:19 +0300
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-11-16 17:06:16 +0300
commitd4c7e649d7bf17792629dbeaf25945e26a32894f (patch)
treef0f9e08bef9a900ad00e1b6c607d29f87017d42c /arch/s390/include/asm/cpu_mf.h
parentde9954b75e992d26a67d83990e6219dcb6edc3bf (diff)
downloadlinux-d4c7e649d7bf17792629dbeaf25945e26a32894f.tar.xz
s390/cpum_sf: load program parameter at sampler enablement
The lpp instruction is used to place the PID of the current task in the program-parameter (PP) register. The register contents is then included in the sampling data entries. The lpp instruction loads the PP register only when at least one sampling function is enabled. Otherwise it is executed as a no-op. Linux calls lpp at context switch. If the context switch happens before the sampler is enabled, the PP register is empty. That means, the PID of the task that is sampled is not stored in sampling data until the next context switch. Hence, always call lpp when enabling the sampler. 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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h
index 7364130a29c8..792cda339af1 100644
--- a/arch/s390/include/asm/cpu_mf.h
+++ b/arch/s390/include/asm/cpu_mf.h
@@ -144,6 +144,12 @@ struct hws_trailer_entry {
unsigned long long progusage2; /* */
} __packed;
+/* Load program parameter */
+static inline void lpp(void *pp)
+{
+ asm volatile(".insn s,0xb2800000,0(%0)\n":: "a" (pp) : "memory");
+}
+
/* Query counter information */
static inline int qctri(struct cpumf_ctr_info *info)
{