From 079136a37039570209031e71304b5a2957cfab68 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Sat, 24 Apr 2010 01:55:09 +0200 Subject: [PATCH] --- yaml --- r: 191247 b: refs/heads/master c: e1889d75aff0c3786bc53aeb7d9eaca0691c19c5 h: refs/heads/master i: 191245: d2604debb9383bf7e935d4ff57a55d333e64593d 191243: 01b2cef75e565ef792145d1f20774ecf6b92c32f 191239: ea5af318605fcf1816b2e3a706745eee19f991b2 191231: 296ac94f2f54879f2eef138c0d784662292c2c68 v: v3 --- [refs] | 2 +- trunk/tools/perf/builtin-trace.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 1134d446bc2e..847fcf26c4fa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9df9bbba9f7e2e4ffdc51bbbfa524b67691321d2 +refs/heads/master: e1889d75aff0c3786bc53aeb7d9eaca0691c19c5 diff --git a/trunk/tools/perf/builtin-trace.c b/trunk/tools/perf/builtin-trace.c index 1d034f6fa28a..77f556f7604c 100644 --- a/trunk/tools/perf/builtin-trace.c +++ b/trunk/tools/perf/builtin-trace.c @@ -11,6 +11,8 @@ static char const *script_name; static char const *generate_script_lang; +static bool debug_ordering; +static u64 last_timestamp; static int default_start_script(const char *script __unused, int argc __unused, @@ -87,6 +89,14 @@ static int process_sample_event(event_t *event, struct perf_session *session) } if (session->sample_type & PERF_SAMPLE_RAW) { + if (debug_ordering) { + if (data.time < last_timestamp) { + pr_err("Samples misordered, previous: %llu " + "this: %llu\n", last_timestamp, + data.time); + } + last_timestamp = data.time; + } /* * FIXME: better resolve from pid from the struct trace_entry * field, although it should be the same than this perf @@ -532,6 +542,8 @@ static const struct option options[] = { "generate perf-trace.xx script in specified language"), OPT_STRING('i', "input", &input_name, "file", "input file name"), + OPT_BOOLEAN('d', "debug-ordering", &debug_ordering, + "check that samples time ordering is monotonic"), OPT_END() };