Commit d4c7e649 authored by Hendrik Brueckner's avatar Hendrik Brueckner Committed by Martin Schwidefsky

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: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent de9954b7
...@@ -144,6 +144,12 @@ struct hws_trailer_entry { ...@@ -144,6 +144,12 @@ struct hws_trailer_entry {
unsigned long long progusage2; /* */ unsigned long long progusage2; /* */
} __packed; } __packed;
/* Load program parameter */
static inline void lpp(void *pp)
{
asm volatile(".insn s,0xb2800000,0(%0)\n":: "a" (pp) : "memory");
}
/* Query counter information */ /* Query counter information */
static inline int qctri(struct cpumf_ctr_info *info) static inline int qctri(struct cpumf_ctr_info *info)
{ {
......
...@@ -848,6 +848,9 @@ static void cpumsf_pmu_enable(struct pmu *pmu) ...@@ -848,6 +848,9 @@ static void cpumsf_pmu_enable(struct pmu *pmu)
return; return;
} }
/* Load current program parameter */
lpp(&S390_lowcore.lpp);
debug_sprintf_event(sfdbg, 6, "pmu_enable: es=%i cs=%i ed=%i cd=%i " debug_sprintf_event(sfdbg, 6, "pmu_enable: es=%i cs=%i ed=%i cd=%i "
"tear=%p dear=%p\n", cpuhw->lsctl.es, cpuhw->lsctl.cs, "tear=%p dear=%p\n", cpuhw->lsctl.es, cpuhw->lsctl.cs,
cpuhw->lsctl.ed, cpuhw->lsctl.cd, cpuhw->lsctl.ed, cpuhw->lsctl.cd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment