Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up fixes sent via perf/urgent and in the BPF tools/ directories. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -1812,3 +1812,36 @@ int perf_pmu__caps_parse(struct perf_pmu *pmu)
|
||||
|
||||
return nr_caps;
|
||||
}
|
||||
|
||||
void perf_pmu__warn_invalid_config(struct perf_pmu *pmu, __u64 config,
|
||||
char *name)
|
||||
{
|
||||
struct perf_pmu_format *format;
|
||||
__u64 masks = 0, bits;
|
||||
char buf[100];
|
||||
unsigned int i;
|
||||
|
||||
list_for_each_entry(format, &pmu->format, list) {
|
||||
if (format->value != PERF_PMU_FORMAT_VALUE_CONFIG)
|
||||
continue;
|
||||
|
||||
for_each_set_bit(i, format->bits, PERF_PMU_FORMAT_BITS)
|
||||
masks |= 1ULL << i;
|
||||
}
|
||||
|
||||
/*
|
||||
* Kernel doesn't export any valid format bits.
|
||||
*/
|
||||
if (masks == 0)
|
||||
return;
|
||||
|
||||
bits = config & ~masks;
|
||||
if (bits == 0)
|
||||
return;
|
||||
|
||||
bitmap_scnprintf((unsigned long *)&bits, sizeof(bits) * 8, buf, sizeof(buf));
|
||||
|
||||
pr_warning("WARNING: event '%s' not valid (bits %s of config "
|
||||
"'%llx' not supported by kernel)!\n",
|
||||
name ?: "N/A", buf, config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user