Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1228981
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Namhyung Kim <namhyung@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] perf tools: Introduce perf_evlist__start_workload_ex() |
| Date | Mon, 21 Sep 2015 03:00:02 +0200 |
| Message-ID | <qaXCy-7Sc-7@gated-at.bofh.it> (permalink) |
| X-Original-To | Arnaldo Carvalho de Melo <acme@kernel.org> |
| X-Original-Senderip | 156.147.1.125 |
| X-Original-Mailfrom | namhyung@kernel.org |
| X-Original-Senderip | 10.177.222.170 |
| X-Original-Mailfrom | namhyung@kernel.org |
| X-Mailer | git-send-email 2.5.0 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 55 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <a.p.zijlstra@chello.nl>, Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>, David Ahern <dsahern@gmail.com> |
| X-Original-Date | Mon, 21 Sep 2015 09:26:48 +0900 |
| X-Original-Message-ID | <1442795209-6875-1-git-send-email-namhyung@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1228981 |
Show key headers only | View raw
The perf_evlist__start_workload_ex() does same as __start_work() but
also invokes callback which does additional work for each command.
Acked-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/evlist.c | 11 +++++++++++
tools/perf/util/evlist.h | 4 ++++
2 files changed, 15 insertions(+)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index a8643735dcea..12b32a059772 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1593,6 +1593,17 @@ int perf_evlist__start_workload(struct perf_evlist *evlist)
return 0;
}
+int perf_evlist__start_workload_ex(struct perf_evlist *evlist,
+ workload_callback_t callback, void *arg)
+{
+ int ret = callback(evlist, arg);
+
+ if (ret == 0)
+ ret = perf_evlist__start_workload(evlist);
+
+ return ret;
+}
+
int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *event,
struct perf_sample *sample)
{
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 115d8b53c601..a8ee12c54195 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -128,6 +128,10 @@ int perf_evlist__prepare_workload(struct perf_evlist *evlist,
void *ucontext));
int perf_evlist__start_workload(struct perf_evlist *evlist);
+typedef int (*workload_callback_t)(struct perf_evlist *evlist, void *arg);
+int perf_evlist__start_workload_ex(struct perf_evlist *evlist,
+ workload_callback_t callback, void *arg);
+
struct option;
int __perf_evlist__parse_mmap_pages(unsigned int *mmap_pages, const char *str);
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/2] perf tools: Introduce perf_evlist__start_workload_ex() Namhyung Kim <namhyung@kernel.org> - 2015-09-21 03:00 +0200
[PATCH 2/2] perf record: Synthesize COMM event for a command line workload Namhyung Kim <namhyung@kernel.org> - 2015-09-21 03:00 +0200
Re: [PATCH 2/2] perf record: Synthesize COMM event for a command line workload Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-21 21:40 +0200
Re: [PATCH 2/2] perf record: Synthesize COMM event for a command line workload Namhyung Kim <namhyung@kernel.org> - 2015-09-22 02:20 +0200
csiph-web