Move 'fd' from tools/perf's mmap to libperf's perf_mmap struct.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lore.kernel.org/lkml/20190913132355.21634-13-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
struct perf_mmap {
void *base;
int mask;
+ int fd;
};
#endif /* __LIBPERF_INTERNAL_MMAP_H */
return 0;
for (i = 0; i < evlist->nr_mmaps; i++) {
- int fd = evlist->overwrite_mmap[i].fd;
+ int fd = evlist->overwrite_mmap[i].core.fd;
int err;
if (fd < 0)
return NULL;
for (i = 0; i < evlist->nr_mmaps; i++) {
- map[i].fd = -1;
+ map[i].core.fd = -1;
map[i].overwrite = overwrite;
/*
* When the perf_mmap() call is made we grab one refcount, plus
if (map->core.base != NULL) {
munmap(map->core.base, perf_mmap__mmap_len(map));
map->core.base = NULL;
- map->fd = -1;
+ map->core.fd = -1;
refcount_set(&map->refcnt, 0);
}
auxtrace_mmap__munmap(&map->auxtrace_mmap);
map->core.base = NULL;
return -1;
}
- map->fd = fd;
+ map->core.fd = fd;
map->cpu = cpu;
perf_mmap__setup_affinity_mask(map, mp);
*/
struct mmap {
struct perf_mmap core;
- int fd;
int cpu;
refcount_t refcnt;
u64 prev;