perf evlist: Adopt backwards ring buffer state enum
As this isn't used at all in mmap.h but in evlist.h, so to cut down the header dependency tree, move it to where it is used. Also add mmap.h to the places using it but previously getting it indirectly via evlist.h. Add missing pthread.h to evlist.h, as it has a pthread_t struct member and was getting the header via mmap.h. Noticed while processing a Jiri's libperf batch touching mmap.h, where almost everything gets rebuilt because evlist.h is so popular, so cut down't this rebuild the world party. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Link: https://lkml.kernel.org/n/tip-he0uljeftl0xfveh3d6vtode@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include <internal/evlist.h>
|
||||
#include "events_stats.h"
|
||||
#include "evsel.h"
|
||||
#include "mmap.h"
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -20,6 +20,34 @@ struct thread_map;
|
||||
struct perf_cpu_map;
|
||||
struct record_opts;
|
||||
|
||||
/*
|
||||
* State machine of bkw_mmap_state:
|
||||
*
|
||||
* .________________(forbid)_____________.
|
||||
* | V
|
||||
* NOTREADY --(0)--> RUNNING --(1)--> DATA_PENDING --(2)--> EMPTY
|
||||
* ^ ^ | ^ |
|
||||
* | |__(forbid)____/ |___(forbid)___/|
|
||||
* | |
|
||||
* \_________________(3)_______________/
|
||||
*
|
||||
* NOTREADY : Backward ring buffers are not ready
|
||||
* RUNNING : Backward ring buffers are recording
|
||||
* DATA_PENDING : We are required to collect data from backward ring buffers
|
||||
* EMPTY : We have collected data from backward ring buffers.
|
||||
*
|
||||
* (0): Setup backward ring buffer
|
||||
* (1): Pause ring buffers for reading
|
||||
* (2): Read from ring buffers
|
||||
* (3): Resume ring buffers for recording
|
||||
*/
|
||||
enum bkw_mmap_state {
|
||||
BKW_MMAP_NOTREADY,
|
||||
BKW_MMAP_RUNNING,
|
||||
BKW_MMAP_DATA_PENDING,
|
||||
BKW_MMAP_EMPTY,
|
||||
};
|
||||
|
||||
#define PERF_EVLIST__HLIST_BITS 8
|
||||
#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
|
||||
|
||||
|
Reference in New Issue
Block a user