From 23624a2fd62515146c0eace874583fb66586de4c Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Mon, 10 Sep 2012 09:09:50 +0200 Subject: Remove two sources of outliers - Don't enforce sequentiality constraint on SEND_RESCHED samples. - Refuse samples with negative time deltas (possible due to clock skew). --- src/ft2csv.c | 2 +- src/ftsort.c | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/ft2csv.c b/src/ft2csv.c index d8e8e95..6a0402d 100644 --- a/src/ft2csv.c +++ b/src/ft2csv.c @@ -289,7 +289,7 @@ static void find_event_by_eid(struct timestamp *first, struct timestamp* end) int interrupted = 0; second = find_second_ts(first, end, &interrupted); - if (second) { + if (second && second->timestamp > first->timestamp) { exec_time = second->timestamp - first->timestamp; if (first->task_type != TSK_RT && second->task_type != TSK_RT && !want_best_effort) diff --git a/src/ftsort.c b/src/ftsort.c index 42717fe..8ba0114 100644 --- a/src/ftsort.c +++ b/src/ftsort.c @@ -134,17 +134,21 @@ static void move_record(struct timestamp* target, struct timestamp* pos) /* Refuse to violate task and CPU sequentiality: since CPUs and * tasks execute sequentially, it makes no sense to move a * timestamp before something recorded by the same task or - * CPU. */ - if (prev->cpu == pos->cpu || - prev->pid == pos->pid) { + * CPU. Exception: TS_SEND_RESCHED_START is actually recorded + * on a different CPU, so it is not subject to sequentiality + * constraints.*/ + if (prev->event != TS_SEND_RESCHED_START && + pos->event != TS_SEND_RESCHED_START && + (prev->cpu == pos->cpu || + (prev->pid == pos->pid && pos->pid != 0))) { /* Bail out before we cause more disturbance to the * stream. */ aborted_moves++; if (want_verbose) - printf("Sequentiality constraint: " - " " - "must come before " - "\n", + printf("Sequentiality constraint:\n" + "\t\n" + "\tmust come before\n" + "\t\n", event2str(prev->event), prev->seq_no, prev->pid, prev->cpu, (unsigned long long) prev->timestamp, @@ -213,7 +217,8 @@ static void pre_check_cpu_monotonicity(struct timestamp *start, prev[i] = pos[i] = NULL; for (next = start; next < end; next++) { - if (next->event >= SINGLE_RECORDS_RANGE) + if (next->event >= SINGLE_RECORDS_RANGE || + next->event == TS_SEND_RESCHED_START) continue; outlier = 0; -- cgit v1.2.2