aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ftdump.c')
-rw-r--r--src/ftdump.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/ftdump.c b/src/ftdump.c
index 599473b..1462c4d 100644
--- a/src/ftdump.c
+++ b/src/ftdump.c
@@ -29,10 +29,31 @@
29static void dump(struct timestamp* ts, size_t count) 29static void dump(struct timestamp* ts, size_t count)
30{ 30{
31 struct timestamp *x; 31 struct timestamp *x;
32 unsigned int last_seq = 0;
33 const char* name;
32 while (count--) { 34 while (count--) {
33 x = ts++; 35 x = ts++;
34 printf("event:%d seq:%u cpu:%d type:%d\n", 36 name = event2str(x->event);
35 (int) x->event, x->seq_no, x->cpu, x->task_type); 37 if (last_seq && last_seq + 1 != x->seq_no)
38 printf("==== non-consecutive sequence number ====\n");
39 last_seq = x->seq_no;
40 if (name)
41 printf("%-20s seq:%u timestamp:%llu cpu:%d type:%-8s irq:%u irqc:%02u \n",
42 name, x->seq_no,
43 (unsigned long long) x->timestamp,
44 x->cpu,
45 task_type2str(x->task_type),
46 x->irq_flag,
47 x->irq_count);
48 else
49 printf("%16s:%3u seq:%u timestamp:%llu cpu:%u type:%-8s irq:%u irqc:%02u\n",
50 "event",
51 (unsigned int) x->event, x->seq_no,
52 (unsigned long long) x->timestamp,
53 x->cpu,
54 task_type2str(x->task_type),
55 x->irq_flag,
56 x->irq_count);
36 } 57 }
37} 58}
38 59
@@ -57,14 +78,12 @@ int main(int argc, char** argv)
57 "\t offset(timestamp) = %3lu\n" 78 "\t offset(timestamp) = %3lu\n"
58 "\t offset(seq_no) = %3lu\n" 79 "\t offset(seq_no) = %3lu\n"
59 "\t offset(cpu) = %3lu\n" 80 "\t offset(cpu) = %3lu\n"
60 "\t offset(event) = %3lu\n" 81 "\t offset(event) = %3lu\n",
61 "\t offset(task_type) = %3lu\n",
62 (unsigned long) sizeof(struct timestamp), 82 (unsigned long) sizeof(struct timestamp),
63 offset(struct timestamp, timestamp), 83 offset(struct timestamp, timestamp),
64 offset(struct timestamp, seq_no), 84 offset(struct timestamp, seq_no),
65 offset(struct timestamp, cpu), 85 offset(struct timestamp, cpu),
66 offset(struct timestamp, event), 86 offset(struct timestamp, event));
67 offset(struct timestamp, task_type));
68 87
69 if (argc != 2) 88 if (argc != 2)
70 die("Usage: ftdump <logfile>"); 89 die("Usage: ftdump <logfile>");