Skip to content

Commit a13e8bd

Browse files
Thomas RichterVasily Gorbik
authored andcommitted
s390/pai_crypto: use PERF_ATTACH_TASK define for per task detection
Use define PERF_ATTACH_TASK bit in event->attach_state to determine system wide invocation or per task invocation in event initialization. This bit is set in common code and before calling PMU device driver specific event initialization. It is set once and never changes. It is save to use and also in sync with other PMU specific code. No functional change. Acked-by: Sumanth Korikkar <[email protected]> Signed-off-by: Thomas Richter <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 1954da4 commit a13e8bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static int paicrypt_event_init(struct perf_event *event)
269269
a->config > PAI_CRYPTO_BASE + paicrypt_cnt)
270270
return -EINVAL;
271271
/* Allow only CPU wide operation, no process context for now. */
272-
if (event->hw.target || event->cpu == -1)
272+
if ((event->attach_state & PERF_ATTACH_TASK) || event->cpu == -1)
273273
return -ENOENT;
274274
/* Allow only CRYPTO_ALL for sampling. */
275275
if (a->sample_period && a->config != PAI_CRYPTO_BASE)

arch/s390/kernel/perf_pai_ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static int paiext_event_init(struct perf_event *event)
248248
if (rc)
249249
return rc;
250250
/* Allow only CPU wide operation, no process context for now. */
251-
if (event->hw.target || event->cpu == -1)
251+
if ((event->attach_state & PERF_ATTACH_TASK) || event->cpu == -1)
252252
return -ENOENT;
253253
/* Allow only event NNPA_ALL for sampling. */
254254
if (a->sample_period && a->config != PAI_NNPA_BASE)

0 commit comments

Comments
 (0)