summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evlist.h
diff options
context:
space:
mode:
authorAlexey Budankov <alexey.budankov@linux.intel.com>2020-07-17 09:01:33 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-07-22 14:28:04 +0200
commitec886bf538f63934f98ef6d4f3c59bf7b5a8965c (patch)
treede973998e0480b45852897b801ed9095a8aeeec9 /tools/perf/util/evlist.h
parentperf evlist: Introduce control file descriptors (diff)
downloadlinux-ec886bf538f63934f98ef6d4f3c59bf7b5a8965c.tar.xz
linux-ec886bf538f63934f98ef6d4f3c59bf7b5a8965c.zip
perf evlist: Implement control command handling functions
Implement functions of initialization, finalization and processing of control command messages coming from control file descriptors. Allocate control file descriptor as descriptor at struct pollfd object of evsel_list for atomic poll() operation. Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/62518ceb-1cc9-2aba-593b-55408d07c1bf@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evlist.h')
-rw-r--r--tools/perf/util/evlist.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 3510af071186..ec676accc76b 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -360,4 +360,22 @@ void perf_evlist__force_leader(struct evlist *evlist);
struct evsel *perf_evlist__reset_weak_group(struct evlist *evlist,
struct evsel *evsel,
bool close);
+#define EVLIST_CTL_CMD_ENABLE_TAG "enable"
+#define EVLIST_CTL_CMD_DISABLE_TAG "disable"
+#define EVLIST_CTL_CMD_ACK_TAG "ack\n"
+
+#define EVLIST_CTL_CMD_MAX_LEN 64
+
+enum evlist_ctl_cmd {
+ EVLIST_CTL_CMD_UNSUPPORTED = 0,
+ EVLIST_CTL_CMD_ENABLE,
+ EVLIST_CTL_CMD_DISABLE,
+ EVLIST_CTL_CMD_ACK
+};
+
+int evlist__initialize_ctlfd(struct evlist *evlist, int ctl_fd, int ctl_fd_ack);
+int evlist__finalize_ctlfd(struct evlist *evlist);
+bool evlist__ctlfd_initialized(struct evlist *evlist);
+int evlist__ctlfd_process(struct evlist *evlist, enum evlist_ctl_cmd *cmd);
+
#endif /* __PERF_EVLIST_H */