Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205276
b: refs/heads/master
c: 6fcf7dd
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker committed Jun 24, 2010
1 parent 0565650 commit 08d4423
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa59a48596d8358a908bfb458300b5625cd47785
refs/heads/master: 6fcf7ddbb73d677b3bb7b16f0fff1419cb8349e9
12 changes: 11 additions & 1 deletion trunk/tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ static char const *script_name;
static char const *generate_script_lang;
static bool debug_ordering;
static u64 last_timestamp;
static u64 nr_unordered;

static int default_start_script(const char *script __unused,
int argc __unused,
Expand Down Expand Up @@ -96,8 +97,10 @@ static int process_sample_event(event_t *event, struct perf_session *session)
pr_err("Samples misordered, previous: %llu "
"this: %llu\n", last_timestamp,
data.time);
nr_unordered++;
}
last_timestamp = data.time;
return 0;
}
/*
* FIXME: better resolve from pid from the struct trace_entry
Expand Down Expand Up @@ -132,9 +135,16 @@ static void sig_handler(int sig __unused)

static int __cmd_trace(struct perf_session *session)
{
int ret;

signal(SIGINT, sig_handler);

return perf_session__process_events(session, &event_ops);
ret = perf_session__process_events(session, &event_ops);

if (debug_ordering)
pr_err("Misordered timestamps: %llu\n", nr_unordered);

return ret;
}

struct script_spec {
Expand Down

0 comments on commit 08d4423

Please sign in to comment.