diff options
author | Jiri Olsa <jolsa@kernel.org> | 2020-12-27 00:20:37 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-01-20 14:34:21 -0300 |
commit | f186cd614878dc886edea5df42ca3225d5ab97ea (patch) | |
tree | e6debe3d3e27007dd83dee68cdfac16ed155c1a3 /tools/perf/util/evlist.h | |
parent | 142544a938f436a6567a88d307346bfe198465b0 (diff) | |
download | lwn-f186cd614878dc886edea5df42ca3225d5ab97ea.tar.gz lwn-f186cd614878dc886edea5df42ca3225d5ab97ea.zip |
perf tools: Add 'stop' control command
Adding control 'stop' command to stop perf record.
When it is received, perf will set the 'done' variable to 1 to stop its
mmap ring buffer reading loop.
Example session:
terminal 1:
# mkfifo control ack
# perf record --control=fifo:control,ack
terminal 2:
# echo stop > control
terminal 1:
[ perf record: Woken up 7 times to write data ]
[ perf record: Captured and wrote 3.214 MB perf.data (38280 samples) ]
#
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Budankov <abudankov@huawei.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20201226232038.390883-4-jolsa@kernel.org
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.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index e79c64d81d21..6f45c3630355 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -331,6 +331,7 @@ struct evsel *evlist__reset_weak_group(struct evlist *evlist, struct evsel *evse #define EVLIST_CTL_CMD_ACK_TAG "ack\n" #define EVLIST_CTL_CMD_SNAPSHOT_TAG "snapshot" #define EVLIST_CTL_CMD_EVLIST_TAG "evlist" +#define EVLIST_CTL_CMD_STOP_TAG "stop" #define EVLIST_CTL_CMD_MAX_LEN 64 @@ -341,6 +342,7 @@ enum evlist_ctl_cmd { EVLIST_CTL_CMD_ACK, EVLIST_CTL_CMD_SNAPSHOT, EVLIST_CTL_CMD_EVLIST, + EVLIST_CTL_CMD_STOP, }; int evlist__parse_control(const char *str, int *ctl_fd, int *ctl_fd_ack, bool *ctl_fd_close); |