Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libperf: Add 'flush' to 'struct perf_mmap'

Move 'flush' 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-19-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
65aa2e6b 4443e6d7

+8 -8
+5 -5
tools/perf/builtin-record.c
··· 973 973 if (map->core.base) { 974 974 record__adjust_affinity(rec, map); 975 975 if (synch) { 976 - flush = map->flush; 977 - map->flush = 1; 976 + flush = map->core.flush; 977 + map->core.flush = 1; 978 978 } 979 979 if (!record__aio_enabled(rec)) { 980 980 if (perf_mmap__push(map, rec, record__pushfn) < 0) { 981 981 if (synch) 982 - map->flush = flush; 982 + map->core.flush = flush; 983 983 rc = -1; 984 984 goto out; 985 985 } ··· 987 987 if (record__aio_push(rec, map, &off) < 0) { 988 988 record__aio_set_pos(trace_fd, off); 989 989 if (synch) 990 - map->flush = flush; 990 + map->core.flush = flush; 991 991 rc = -1; 992 992 goto out; 993 993 } 994 994 } 995 995 if (synch) 996 - map->flush = flush; 996 + map->core.flush = flush; 997 997 } 998 998 999 999 if (map->auxtrace_mmap.base && !rec->opts.auxtrace_snapshot_mode &&
+1
tools/perf/lib/include/internal/mmap.h
··· 25 25 u64 start; 26 26 u64 end; 27 27 bool overwrite; 28 + u64 flush; 28 29 char event_copy[PERF_SAMPLE_MAX_SIZE] __aligned(8); 29 30 }; 30 31
+2 -2
tools/perf/util/mmap.c
··· 383 383 384 384 perf_mmap__setup_affinity_mask(map, mp); 385 385 386 - map->flush = mp->flush; 386 + map->core.flush = mp->flush; 387 387 388 388 map->comp_level = mp->comp_level; 389 389 ··· 450 450 md->core.start = md->core.overwrite ? head : old; 451 451 md->core.end = md->core.overwrite ? old : head; 452 452 453 - if ((md->core.end - md->core.start) < md->flush) 453 + if ((md->core.end - md->core.start) < md->core.flush) 454 454 return -EAGAIN; 455 455 456 456 size = md->core.end - md->core.start;
-1
tools/perf/util/mmap.h
··· 32 32 } aio; 33 33 #endif 34 34 cpu_set_t affinity_mask; 35 - u64 flush; 36 35 void *data; 37 36 int comp_level; 38 37 };