Skip to content

Commit 0a64815

Browse files
hbruecknerMartin Schwidefsky
authored andcommitted
s390/cpum_sf: add diagnostic sampling event only if it is authorized
The SF_CYCLES_BASIC_DIAG is always registered even if it is turned of in the current hardware configuration. Because diagnostic-sampling is typically not turned on in the hardware configuration, do not register this perf event by default. Enable it only if the diagnostic-sampling function is authorized. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent c202baf commit 0a64815

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/s390/kernel/perf_cpum_sf.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC_DIAG, PERF_EVENT_CPUM_SF_DIAG);
14151415

14161416
static struct attribute *cpumsf_pmu_events_attr[] = {
14171417
CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC),
1418-
CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC_DIAG),
1418+
NULL,
14191419
NULL,
14201420
};
14211421

@@ -1606,8 +1606,11 @@ static int __init init_cpum_sampling_pmu(void)
16061606
return -EINVAL;
16071607
}
16081608

1609-
if (si.ad)
1609+
if (si.ad) {
16101610
sfb_set_limits(CPUM_SF_MIN_SDB, CPUM_SF_MAX_SDB);
1611+
cpumsf_pmu_events_attr[1] =
1612+
CPUMF_EVENT_PTR(SF, SF_CYCLES_BASIC_DIAG);
1613+
}
16111614

16121615
sfdbg = debug_register(KMSG_COMPONENT, 2, 1, 80);
16131616
if (!sfdbg)

0 commit comments

Comments
 (0)