Skip to content

Commit ac03223

Browse files
Thomas Richterhcahca
authored andcommitted
s390/pai_crypto: Add common pai_stop() function
To support one common PAI PMU device driver which handles both PMUs pai_crypto and pai_ext, use a common naming scheme for structures and variables suitable for both device drivers. Add a common usable function pai_stop() for the event on a CPU. Call this common pai_stop() from paicrypt_del(). Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Reviewed-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent a65a4d7 commit ac03223

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,14 @@ static int paicrypt_add(struct perf_event *event, int flags)
435435
}
436436

437437
static void pai_have_sample(struct perf_event *, struct pai_map *);
438-
static void paicrypt_stop(struct perf_event *event, int flags)
438+
static void pai_stop(struct perf_event *event, int flags)
439439
{
440440
struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);
441441
struct pai_map *cpump = mp->mapptr;
442+
int idx = PAI_PMU_IDX(event);
442443

443444
if (!event->attr.sample_period) { /* Counting */
444-
paicrypt_read(event);
445+
pai_pmu[idx].pmu->read(event);
445446
} else { /* Sampling */
446447
if (!(event->attach_state & PERF_ATTACH_TASK)) {
447448
perf_sched_cb_dec(event->pmu);
@@ -454,6 +455,11 @@ static void paicrypt_stop(struct perf_event *event, int flags)
454455
event->hw.state = PERF_HES_STOPPED;
455456
}
456457

458+
static void paicrypt_stop(struct perf_event *event, int flags)
459+
{
460+
pai_stop(event, flags);
461+
}
462+
457463
static void paicrypt_del(struct perf_event *event, int flags)
458464
{
459465
struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);

0 commit comments

Comments
 (0)