summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/api/fd/array.c4
-rw-r--r--tools/lib/perf/evlist.c5
-rw-r--r--tools/lib/perf/include/internal/evsel.h2
-rw-r--r--tools/lib/perf/mmap.c2
4 files changed, 10 insertions, 3 deletions
diff --git a/tools/lib/api/fd/array.c b/tools/lib/api/fd/array.c
index 67b73481df27..3200746d1657 100644
--- a/tools/lib/api/fd/array.c
+++ b/tools/lib/api/fd/array.c
@@ -116,6 +116,10 @@ int fdarray__filter(struct fdarray *fda, short revents,
return 0;
for (fd = 0; fd < fda->nr; ++fd) {
+ /*
+ * Explicitly bypass nonfilterable items (e.g. control descriptors).
+ * This ensures their fd, events, and revents remain completely untouched.
+ */
if (fda->priv[fd].flags & fdarray_flag__nonfilterable)
continue;
diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c
index 1f210dadd666..c1c5b0684eed 100644
--- a/tools/lib/perf/evlist.c
+++ b/tools/lib/perf/evlist.c
@@ -79,8 +79,9 @@ static void __perf_evlist__propagate_maps(struct perf_evlist *evlist,
}
}
- /* Ensure cpus only references valid PMU CPUs. */
- if (!perf_cpu_map__has_any_cpu(evsel->cpus) &&
+ /* Ensure cpus only references valid PMU CPUs, except for uncore PMUs. */
+ if (!evsel->is_pmu_uncore &&
+ !perf_cpu_map__has_any_cpu(evsel->cpus) &&
!perf_cpu_map__is_subset(evsel->pmu_cpus, evsel->cpus)) {
struct perf_cpu_map *tmp = perf_cpu_map__intersect(evsel->pmu_cpus, evsel->cpus);
diff --git a/tools/lib/perf/include/internal/evsel.h b/tools/lib/perf/include/internal/evsel.h
index b988034f1371..35447bed0f95 100644
--- a/tools/lib/perf/include/internal/evsel.h
+++ b/tools/lib/perf/include/internal/evsel.h
@@ -128,6 +128,8 @@ struct perf_evsel {
bool requires_cpu;
/** Is the PMU for the event a core one? Effects the handling of own_cpus. */
bool is_pmu_core;
+ /** Is the PMU for the event an uncore one? */
+ bool is_pmu_uncore;
/** Does the evsel on read on the first CPU index such as tool time events? */
bool reads_only_on_cpu_idx0;
int idx;
diff --git a/tools/lib/perf/mmap.c b/tools/lib/perf/mmap.c
index ec124eb0ec0a..ab3adf1d8baf 100644
--- a/tools/lib/perf/mmap.c
+++ b/tools/lib/perf/mmap.c
@@ -200,7 +200,7 @@ void perf_mmap__read_done(struct perf_mmap *map)
/*
* Check if event was unmapped due to a POLLHUP/POLLERR.
*/
- if (!refcount_read(&map->refcnt))
+ if (!refcount_read(&map->refcnt) || !map->overwrite)
return;
map->prev = perf_mmap__read_head(map);