Skip to contentSkip to conversation

perf tools: Create ordered-events object

tip:perf/core tip-bot for Jiri Olsa 1 participant 1 message Aug 13, 2014 perf events

lore
Share & tools
lore

tip-bot for Jiri Olsa

author merge bot
#0 lore raw
Commit-ID:  5f86b80b85f0dcd05fd1471eac6984181a707c4f
Gitweb:     http://git.kernel.org/tip/5f86b80b85f0dcd05fd1471eac6984181a707c4f
Author:     Jiri Olsa <[email protected]>
AuthorDate: Fri, 1 Aug 2014 13:02:58 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 12 Aug 2014 12:02:58 -0300

perf tools: Create ordered-events object

Move ordered events code into separated object ordered-events.[ch].

No functional change was intended.

---
 tools/perf/Makefile.perf         |   2 +
 tools/perf/util/ordered-events.c | 196 +++++++++++++++++++++++++++++++++++++
 tools/perf/util/ordered-events.h |  41 ++++++++
 tools/perf/util/session.c        | 206 ---------------------------------------
 tools/perf/util/session.h        |  17 +---
 5 files changed, 240 insertions(+), 222 deletions(-)
tools/perf/Makefile.perf +2 -0
index 2240974..1ea31e2 100644
@@ -263,6 +263,7 @@ LIB_H += util/xyarray.h
 LIB_H += util/header.h
 LIB_H += util/help.h
 LIB_H += util/session.h
+LIB_H += util/ordered-events.h
 LIB_H += util/strbuf.h
 LIB_H += util/strlist.h
 LIB_H += util/strfilter.h
@@ -347,6 +348,7 @@ LIB_OBJS += $(OUTPUT)util/machine.o
 LIB_OBJS += $(OUTPUT)util/map.o
 LIB_OBJS += $(OUTPUT)util/pstack.o
 LIB_OBJS += $(OUTPUT)util/session.o
+LIB_OBJS += $(OUTPUT)util/ordered-events.o
 LIB_OBJS += $(OUTPUT)util/comm.o
 LIB_OBJS += $(OUTPUT)util/thread.o
 LIB_OBJS += $(OUTPUT)util/thread_map.o
tools/perf/util/ordered-events.c new file +196 -0

196 lines not on this page · raw message

tools/perf/util/ordered-events.h new file +41 -0

41 lines not on this page · raw message

tools/perf/util/session.c +0 -206

224 lines not on this page · raw message

tools/perf/util/session.h +1 -16
index 03da1cb..0630e65 100644
@@ -9,28 +9,13 @@
 #include "symbol.h"
 #include "thread.h"
 #include "data.h"
+#include "ordered-events.h"
 #include <linux/rbtree.h>
 #include <linux/perf_event.h>
 
-struct ordered_event;
 struct ip_callchain;
 struct thread;
 
-struct ordered_events {
-	u64			last_flush;
-	u64			next_flush;
-	u64			max_timestamp;
-	u64			max_alloc_size;
-	u64			cur_alloc_size;
-	struct list_head	events;
-	struct list_head	cache;
-	struct list_head	to_free;
-	struct ordered_event	*buffer;
-	struct ordered_event	*last;
-	int			buffer_idx;
-	unsigned int		nr_events;
-};
-
 struct perf_session {
 	struct perf_header	header;
 	struct machines		machines;