lkml.org 
[lkml]   [2010]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 9/9] pref: session: Break event ordering when timestamps are missing
Allow the session client to specify that event ordering should be
stopped when not all events have time stamps.

Suggested-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
tools/perf/util/session.c | 13 ++++++++++++-
tools/perf/util/session.h | 1 +
2 files changed, 13 insertions(+), 1 deletion(-)

Index: linux-2.6-tip/tools/perf/util/session.c
===================================================================
--- linux-2.6-tip.orig/tools/perf/util/session.c
+++ linux-2.6-tip/tools/perf/util/session.c
@@ -751,12 +751,23 @@ static int preprocess_sample_record(stru
static int process_user_event(struct perf_session *session, event_t *event,
struct perf_event_ops *ops, u64 file_offset)
{
+ int ret;
+
dump_event(session, event, file_offset, NULL);

/* These events are processed right away */
switch (event->header.type) {
case PERF_RECORD_HEADER_ATTR:
- return ops->attr(event, session);
+ /* This updates session->sample_id_all */
+ ret = ops->attr(event, session);
+ /* Break ordering if sample_id_all is false */
+ if (ops->ordering_requires_timestamps &&
+ ops->ordered_samples && !session->sample_id_all) {
+ session->ordered_samples.next_flush = ULLONG_MAX;
+ flush_sample_queue(session, ops);
+ ops->ordered_samples = false;
+ }
+ return ret;
case PERF_RECORD_HEADER_EVENT_TYPE:
return ops->event_type(event, session);
case PERF_RECORD_HEADER_TRACING_DATA:
Index: linux-2.6-tip/tools/perf/util/session.h
===================================================================
--- linux-2.6-tip.orig/tools/perf/util/session.h
+++ linux-2.6-tip/tools/perf/util/session.h
@@ -78,6 +78,7 @@ struct perf_event_ops {
build_id;
event_op2 finished_round;
bool ordered_samples;
+ bool ordering_requires_timestamps;
};

struct perf_session *perf_session__new(const char *filename, int mode, bool force, bool repipe);



\
 
 \ /
  Last update: 2010-12-07 13:53    [W:0.120 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site