summaryrefslogtreecommitdiff
path: root/tools/perf/util/include
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-08-06 16:51:12 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-08-06 16:51:12 -0300
commit43730982c3e9355dd8bd6b31f0a0a3508ad4209d (patch)
treea6f05a4fc0ff118745d1000c535e506321510bd9 /tools/perf/util/include
parent449e5b247ca7c9dc9fc3391b7eebfefdeb2ce1fc (diff)
perf tui: Introduce list_head based generic ui_browser refresh routine
So that building other browser based on structures linked via a linked list can be as easy as it is already for the ones linked via an rb_tree. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/include')
-rw-r--r--tools/perf/util/include/linux/list.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/include/linux/list.h b/tools/perf/util/include/linux/list.h
index dbe4b814382a..f5ca26e53fbb 100644
--- a/tools/perf/util/include/linux/list.h
+++ b/tools/perf/util/include/linux/list.h
@@ -15,4 +15,12 @@ static inline void list_del_range(struct list_head *begin,
begin->prev->next = end->next;
end->next->prev = begin->prev;
}
+
+/**
+ * list_for_each_from - iterate over a list from one of its nodes
+ * @pos: the &struct list_head to use as a loop cursor, from where to start
+ * @head: the head for your list.
+ */
+#define list_for_each_from(pos, head) \
+ for (; prefetch(pos->next), pos != (head); pos = pos->next)
#endif