aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft2csv.c
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-17 18:58:18 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-17 18:58:18 -0500
commit26b6535eaa2750df407ec06a37d05aca6183e163 (patch)
treeea183da5cd79b5991376575205d7b28bc4a46c93 /src/ft2csv.c
parent5ba03d45f4b90c25dd5537e0b173568274fd2a14 (diff)
add support for release latency; make ftdump a bit prettier
Diffstat (limited to 'src/ft2csv.c')
-rw-r--r--src/ft2csv.c25
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
42static unsigned long long threshold = CYCLES_PER_US * 1000; /* 1 ms == 1 full tick */ 42static unsigned long long threshold = CYCLES_PER_US * 10000; /* 10 ms == 10 full ticks */
43 43
44static struct timestamp* next(struct timestamp* start, struct timestamp* end, 44static 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
105static 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
106static inline uint64_t bget(int x, uint64_t quad) 115static 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
157static 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"