[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a025e4f0d8a92b38539d39b495b530015296b4d9@git.kernel.org>
Date: Mon, 16 Dec 2013 07:27:33 -0800
From: tip-bot for Adrian Hunter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, eranian@...gle.com, mingo@...hat.com,
mingo@...nel.org, a.p.zijlstra@...llo.nl, efault@....de,
jolsa@...hat.com, fweisbec@...il.com, ak@...ux.intel.com,
dsahern@...il.com, tglx@...utronix.de, hpa@...or.com,
paulus@...ba.org, linux-kernel@...r.kernel.org, namhyung@...il.com,
adrian.hunter@...el.com
Subject: [tip:perf/core] perf evlist: Add perf_evlist__to_front()
Commit-ID: a025e4f0d8a92b38539d39b495b530015296b4d9
Gitweb: http://git.kernel.org/tip/a025e4f0d8a92b38539d39b495b530015296b4d9
Author: Adrian Hunter <adrian.hunter@...el.com>
AuthorDate: Wed, 11 Dec 2013 14:36:35 +0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 13 Dec 2013 10:30:21 -0300
perf evlist: Add perf_evlist__to_front()
Add a function to move a selected event to the
front of the list.
This is needed because it is not possible
to use the PERF_EVENT_IOC_SET_OUTPUT IOCTL
from an Instruction Tracing event to a
non-Instruction Tracing event. Thus the
Instruction Tracing event must come first.
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Mike Galbraith <efault@....de>
Cc: Namhyung Kim <namhyung@...il.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/r/1386765443-26966-24-git-send-email-alexander.shishkin@linux.intel.com
Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/evlist.c | 17 +++++++++++++++++
tools/perf/util/evlist.h | 3 +++
2 files changed, 20 insertions(+)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 2eb7378..0b31cee 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1212,3 +1212,20 @@ int perf_evlist__strerror_open(struct perf_evlist *evlist __maybe_unused,
return 0;
}
+
+void perf_evlist__to_front(struct perf_evlist *evlist,
+ struct perf_evsel *move_evsel)
+{
+ struct perf_evsel *evsel, *n;
+ LIST_HEAD(move);
+
+ if (move_evsel == perf_evlist__first(evlist))
+ return;
+
+ list_for_each_entry_safe(evsel, n, &evlist->entries, node) {
+ if (evsel->leader == move_evsel->leader)
+ list_move_tail(&evsel->node, &move);
+ }
+
+ list_splice(&move, &evlist->entries);
+}
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 8a04aae..9f64ede 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -194,5 +194,8 @@ static inline void perf_mmap__write_tail(struct perf_mmap *md,
}
bool perf_evlist__can_select_event(struct perf_evlist *evlist, const char *str);
+void perf_evlist__to_front(struct perf_evlist *evlist,
+ struct perf_evsel *move_evsel);
+
#endif /* __PERF_EVLIST_H */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists