[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1453715801-7732-24-git-send-email-wangnan0@huawei.com>
Date: Mon, 25 Jan 2016 09:56:10 +0000
From: Wang Nan <wangnan0@...wei.com>
To: Alexei Starovoitov <ast@...nel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>
CC: Brendan Gregg <brendan.d.gregg@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
"David S. Miller" <davem@...emloft.net>,
He Kuang <hekuang@...wei.com>, Jiri Olsa <jolsa@...nel.org>,
Li Zefan <lizefan@...wei.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, <pi3orama@....com>,
Will Deacon <will.deacon@....com>,
<linux-kernel@...r.kernel.org>, Wang Nan <wangnan0@...wei.com>
Subject: [PATCH 23/54] perf tools: Introduce API to pause ring buffer
perf_evsel__pause() is introduced to pause a ring buffer. Since output
of a evsel is bound together, ioctl() on the first file is enough.
Signed-off-by: Wang Nan <wangnan0@...wei.com>
Signed-off-by: He Kuang <hekuang@...wei.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Zefan Li <lizefan@...wei.com>
Cc: pi3orama@....com
---
tools/perf/util/evsel.c | 6 ++++++
tools/perf/util/evsel.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 7498d58..0b562cf 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1009,6 +1009,12 @@ int perf_evsel__disable(struct perf_evsel *evsel)
0);
}
+int perf_evsel__pause(struct perf_evsel *evsel, bool pause)
+{
+ return perf_evsel__run_ioctl(evsel, 1, 1, PERF_EVENT_IOC_PAUSE_OUTPUT,
+ (void *)(pause ? 1UL : 0UL));
+}
+
int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads)
{
if (ncpus == 0 || nthreads == 0)
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 022fcff..d5ae7ba 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -230,6 +230,7 @@ int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
const char *filter);
int perf_evsel__enable(struct perf_evsel *evsel);
int perf_evsel__disable(struct perf_evsel *evsel);
+int perf_evsel__pause(struct perf_evsel *evsel, bool pause);
int perf_evsel__open_per_cpu(struct perf_evsel *evsel,
struct cpu_map *cpus);
--
1.8.3.4
Powered by blists - more mailing lists