Commit 42cd0c82 authored by Thomas Richter's avatar Thomas Richter Committed by Heiko Carstens
Browse files

s390/pai_crypto: Rename paicrypt_getdata() to pai_getdata()



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.
Rename paicrypt_getdata() to pai_getdata(). Use the PAI PMU
characteristics in the pai_pmu table to determine the number
of counters to be extracted.

Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Reviewed-by: default avatarJan Polensky <japo@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 65b9831b
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -159,23 +159,25 @@ static u64 paicrypt_getctr(unsigned long *page, int nr, bool kernel)
	return page[nr];
}

/* Read the counter values. Return value from location in CMP. For event
 * CRYPTO_ALL sum up all events.
/* Read the counter values. Return value from location in CMP. For base
 * event xxx_ALL sum up all events. Returns counter value.
 */
static u64 paicrypt_getdata(struct perf_event *event, bool kernel)
static u64 pai_getdata(struct perf_event *event, bool kernel)
{
	struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);
	struct pai_map *cpump = mp->mapptr;
	int idx = PAI_PMU_IDX(event);
	struct pai_pmu *pp = &pai_pmu[idx];
	unsigned int i;
	u64 sum = 0;
	int i;

	if (event->attr.config != PAI_CRYPTO_BASE) {
	if (event->attr.config != pp->base) {
		return paicrypt_getctr(cpump->area,
				       event->attr.config - PAI_CRYPTO_BASE,
				       event->attr.config - pp->base,
				       kernel);
	}

	for (i = 1; i <= paicrypt_cnt; i++) {
	for (i = 1; i <= pp->num_avail; i++) {
		u64 val = paicrypt_getctr(cpump->area, i, kernel);

		if (!val)
@@ -190,9 +192,9 @@ static u64 paicrypt_getall(struct perf_event *event)
	u64 sum = 0;

	if (!event->attr.exclude_kernel)
		sum += paicrypt_getdata(event, true);
		sum += pai_getdata(event, true);
	if (!event->attr.exclude_user)
		sum += paicrypt_getdata(event, false);
		sum += pai_getdata(event, false);

	return sum;
}