diff options
Diffstat (limited to 'src/ft2csv.c')
-rw-r--r-- | src/ft2csv.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/ft2csv.c b/src/ft2csv.c index cc6636f..0df45ce 100644 --- a/src/ft2csv.c +++ b/src/ft2csv.c | |||
@@ -39,7 +39,7 @@ static unsigned int interleaved = 0; | |||
39 | 39 | ||
40 | #define CYCLES_PER_US 2128 | 40 | #define CYCLES_PER_US 2128 |
41 | 41 | ||
42 | static unsigned long long threshold = CYCLES_PER_US * 1000; /* 1 ms == 1 full tick */ | 42 | static unsigned long long threshold = CYCLES_PER_US * 10000; /* 10 ms == 10 full ticks */ |
43 | 43 | ||
44 | static struct timestamp* next(struct timestamp* start, struct timestamp* end, | 44 | static struct timestamp* next(struct timestamp* start, struct timestamp* end, |
45 | int cpu) | 45 | int cpu) |
@@ -100,7 +100,16 @@ static void show_csv(struct timestamp* first, struct timestamp *end) | |||
100 | } | 100 | } |
101 | } else | 101 | } else |
102 | incomplete++; | 102 | incomplete++; |
103 | } | ||
103 | 104 | ||
105 | static void show_single_csv(struct timestamp* ts) | ||
106 | { | ||
107 | if (ts->task_type == TSK_RT) { | ||
108 | printf("0, 0, %llu\n", | ||
109 | (unsigned long long) (ts->timestamp)); | ||
110 | complete++; | ||
111 | } else | ||
112 | non_rt++; | ||
104 | } | 113 | } |
105 | 114 | ||
106 | static inline uint64_t bget(int x, uint64_t quad) | 115 | static inline uint64_t bget(int x, uint64_t quad) |
@@ -145,6 +154,14 @@ static void show_id(struct timestamp* start, struct timestamp* end, | |||
145 | show_csv(start, end); | 154 | show_csv(start, end); |
146 | } | 155 | } |
147 | 156 | ||
157 | static void show_single_records(struct timestamp* start, struct timestamp* end, | ||
158 | unsigned long id) | ||
159 | { | ||
160 | for (; start != end; start++) | ||
161 | if (start->event == id) | ||
162 | show_single_csv(start); | ||
163 | } | ||
164 | |||
148 | #define USAGE \ | 165 | #define USAGE \ |
149 | "Usage: ft2csv [-e] [-i] [-b] <event_name> <logfile> \n" \ | 166 | "Usage: ft2csv [-e] [-i] [-b] <event_name> <logfile> \n" \ |
150 | " -e: endianess swap -- restores byte order \n" \ | 167 | " -e: endianess swap -- restores byte order \n" \ |
@@ -210,7 +227,11 @@ int main(int argc, char** argv) | |||
210 | 227 | ||
211 | if (swap_byte_order) | 228 | if (swap_byte_order) |
212 | restore_byte_order(ts, end); | 229 | restore_byte_order(ts, end); |
213 | show_id(ts, end, id); | 230 | |
231 | if (id >= SINGLE_RECORDS_RANGE) | ||
232 | show_single_records(ts, end, id); | ||
233 | else | ||
234 | show_id(ts, end, id); | ||
214 | 235 | ||
215 | fprintf(stderr, | 236 | fprintf(stderr, |
216 | "Total : %10d\n" | 237 | "Total : %10d\n" |