linux/tools/perf/lib/mmap.c
Jiri Olsa 353120b48d libperf: Add perf_mmap__init() function
Add perf_mmap__init() function to initialize 'struct perf_mmap' objects.

Add it to a new mmap.c source file, that will carry all the mmap related
functions.

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 <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20191007125344.14268-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-10-10 09:37:25 -03:00

10 lines
204 B
C

// SPDX-License-Identifier: GPL-2.0
#include <internal/mmap.h>
void perf_mmap__init(struct perf_mmap *map, bool overwrite)
{
map->fd = -1;
map->overwrite = overwrite;
refcount_set(&map->refcnt, 0);
}