Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright IBM Corp. 2019
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Author(s): Thomas Richter <tmricht@linux.ibm.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * This program is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * it under the terms of the GNU General Public License (version 2 only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * as published by the Free Software Foundation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * Architecture specific trace_event function. Save event's bc000 raw data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * to file. File name is aux.ctr.## where ## stands for the CPU number the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * sample was taken from.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <unistd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <stdio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <inttypes.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <sys/stat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <linux/compiler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <asm/byteorder.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include "debug.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include "session.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include "evlist.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include "color.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include "sample-raw.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include "s390-cpumcf-kernel.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include "pmu-events/pmu-events.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) static size_t ctrset_size(struct cf_ctrset_entry *set)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	return sizeof(*set) + set->ctr * sizeof(u64);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static bool ctrset_valid(struct cf_ctrset_entry *set)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	return set->def == S390_CPUMCF_DIAG_DEF;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) /* CPU Measurement Counter Facility raw data is a byte stream. It is 8 byte
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * aligned and might have trailing padding bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * Display the raw data on screen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) static bool s390_cpumcfdg_testctr(struct perf_sample *sample)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	size_t len = sample->raw_size, offset = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	unsigned char *buf = sample->raw_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	struct cf_trailer_entry *te;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	struct cf_ctrset_entry *cep, ce;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	if (!len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	while (offset < len) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		cep = (struct cf_ctrset_entry *)(buf + offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		ce.def = be16_to_cpu(cep->def);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		ce.set = be16_to_cpu(cep->set);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		ce.ctr = be16_to_cpu(cep->ctr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		ce.res1 = be16_to_cpu(cep->res1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		if (!ctrset_valid(&ce) || offset + ctrset_size(&ce) > len) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 			/* Raw data for counter sets are always multiple of 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 			 * bytes. Prepending a 4 bytes size field to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 			 * raw data block in the sample causes the perf tool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 			 * to append 4 padding bytes to make the raw data part
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 			 * of the sample a multiple of eight bytes again.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 			 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 			 * If the last entry (trailer) is 4 bytes off the raw
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 			 * area data end, all is good.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 			if (len - offset - sizeof(*te) == 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 			pr_err("Invalid counter set entry at %zd\n", offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 			return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		offset += ctrset_size(&ce);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) /* Dump event bc000 on screen, already tested on correctness. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) static void s390_cpumcfdg_dumptrail(const char *color, size_t offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 				    struct cf_trailer_entry *tep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	struct cf_trailer_entry  te;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	te.flags = be64_to_cpu(tep->flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	te.cfvn = be16_to_cpu(tep->cfvn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	te.csvn = be16_to_cpu(tep->csvn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	te.cpu_speed = be32_to_cpu(tep->cpu_speed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	te.timestamp = be64_to_cpu(tep->timestamp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	te.progusage1 = be64_to_cpu(tep->progusage1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	te.progusage2 = be64_to_cpu(tep->progusage2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	te.progusage3 = be64_to_cpu(tep->progusage3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	te.tod_base = be64_to_cpu(tep->tod_base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	te.mach_type = be16_to_cpu(tep->mach_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	te.res1 = be16_to_cpu(tep->res1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	te.res2 = be32_to_cpu(tep->res2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	color_fprintf(stdout, color, "    [%#08zx] Trailer:%c%c%c%c%c"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		      " Cfvn:%d Csvn:%d Speed:%d TOD:%#llx\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		      offset, te.clock_base ? 'T' : ' ',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		      te.speed ? 'S' : ' ', te.mtda ? 'M' : ' ',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		      te.caca ? 'C' : ' ', te.lcda ? 'L' : ' ',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		      te.cfvn, te.csvn, te.cpu_speed, te.timestamp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	color_fprintf(stdout, color, "\t\t1:%lx 2:%lx 3:%lx TOD-Base:%#llx"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		      " Type:%x\n\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		      te.progusage1, te.progusage2, te.progusage3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		      te.tod_base, te.mach_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) /* Return starting number of a counter set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) static int get_counterset_start(int setnr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	switch (setnr) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	case CPUMF_CTR_SET_BASIC:		/* Basic counter set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	case CPUMF_CTR_SET_USER:		/* Problem state counter set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		return 32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	case CPUMF_CTR_SET_CRYPTO:		/* Crypto counter set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		return 64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	case CPUMF_CTR_SET_EXT:			/* Extended counter set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		return 128;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	case CPUMF_CTR_SET_MT_DIAG:		/* Diagnostic counter set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		return 448;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		return -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) /* Scan the PMU table and extract the logical name of a counter from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)  * PMU events table. Input is the counter set and counter number with in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)  * set. Construct the event number and use this as key. If they match return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)  * the name of this counter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)  * If no match is found a NULL pointer is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) static const char *get_counter_name(int set, int nr, struct pmu_events_map *map)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	int rc, event_nr, wanted = get_counterset_start(set) + nr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	if (map) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		struct pmu_event *evp = map->table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		for (; evp->name || evp->event || evp->desc; ++evp) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 			if (evp->name == NULL || evp->event == NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 				continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 			rc = sscanf(evp->event, "event=%x", &event_nr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			if (rc == 1 && event_nr == wanted)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 				return evp->name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) static void s390_cpumcfdg_dump(struct perf_sample *sample)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	size_t i, len = sample->raw_size, offset = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	unsigned char *buf = sample->raw_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	const char *color = PERF_COLOR_BLUE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	struct cf_ctrset_entry *cep, ce;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	struct pmu_events_map *map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	struct perf_pmu pmu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	u64 *p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	memset(&pmu, 0, sizeof(pmu));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	map = perf_pmu__find_map(&pmu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	while (offset < len) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		cep = (struct cf_ctrset_entry *)(buf + offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 		ce.def = be16_to_cpu(cep->def);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		ce.set = be16_to_cpu(cep->set);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		ce.ctr = be16_to_cpu(cep->ctr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		ce.res1 = be16_to_cpu(cep->res1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		if (!ctrset_valid(&ce)) {	/* Print trailer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 			s390_cpumcfdg_dumptrail(color, offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 						(struct cf_trailer_entry *)cep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		color_fprintf(stdout, color, "    [%#08zx] Counterset:%d"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 			      " Counters:%d\n", offset, ce.set, ce.ctr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		for (i = 0, p = (u64 *)(cep + 1); i < ce.ctr; ++i, ++p) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 			const char *ev_name = get_counter_name(ce.set, i, map);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 			color_fprintf(stdout, color,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 				      "\tCounter:%03d %s Value:%#018lx\n", i,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 				      ev_name ?: "<unknown>", be64_to_cpu(*p));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		offset += ctrset_size(&ce);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) /* S390 specific trace event function. Check for PERF_RECORD_SAMPLE events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)  * and if the event was triggered by a counter set diagnostic event display
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)  * its raw data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)  * The function is only invoked when the dump flag -D is set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) void perf_evlist__s390_sample_raw(struct evlist *evlist, union perf_event *event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 				  struct perf_sample *sample)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	struct evsel *ev_bc000;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	if (event->header.type != PERF_RECORD_SAMPLE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	ev_bc000 = perf_evlist__event2evsel(evlist, event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	if (ev_bc000 == NULL ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	    ev_bc000->core.attr.config != PERF_EVENT_CPUM_CF_DIAG)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	/* Display raw data on screen */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	if (!s390_cpumcfdg_testctr(sample)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 		pr_err("Invalid counter set data encountered\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	s390_cpumcfdg_dump(sample);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) }