diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-04-13 13:09:49 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-04-13 13:09:49 -0400 |
commit | 98648884360b21854944b933a035a9e8290c14e7 (patch) | |
tree | 47e629c53db2b65cf81e3edae82f26f5dafe8361 | |
parent | 1f616c930367ca69cbb27e9fea1d19eddb3eaae6 (diff) |
I guess these are the last uncommitted changes from the RTAS work?
-rw-r--r-- | src/ft2csv.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/src/ft2csv.c b/src/ft2csv.c index 4e3f2ad..92957c7 100644 --- a/src/ft2csv.c +++ b/src/ft2csv.c | |||
@@ -7,11 +7,13 @@ | |||
7 | 7 | ||
8 | #include "timestamp.h" | 8 | #include "timestamp.h" |
9 | 9 | ||
10 | static unsigned int complete = 0; | ||
10 | static unsigned int incomplete = 0; | 11 | static unsigned int incomplete = 0; |
11 | static unsigned int filtered = 0; | 12 | static unsigned int filtered = 0; |
12 | static unsigned int skipped = 0; | 13 | static unsigned int skipped = 0; |
13 | 14 | ||
14 | static unsigned long long threshold = 2700 * 1000; /* 1 ms == 1 full tick */ | 15 | //static unsigned long long threshold = 2700 * 1000; /* 1 ms == 1 full tick */ |
16 | static unsigned long long threshold = 2700 * 50; /* 1 ms == 1 full tick */ | ||
15 | 17 | ||
16 | static struct timestamp* next(struct timestamp** pos, size_t* count, int cpu) | 18 | static struct timestamp* next(struct timestamp** pos, size_t* count, int cpu) |
17 | { | 19 | { |
@@ -47,10 +49,12 @@ static void show_csv(struct timestamp* ts, size_t count) | |||
47 | if (find_pair(start, &stop, count)) { | 49 | if (find_pair(start, &stop, count)) { |
48 | if (stop->timestamp - start->timestamp > threshold) | 50 | if (stop->timestamp - start->timestamp > threshold) |
49 | filtered++; | 51 | filtered++; |
50 | else | 52 | else { |
51 | printf("%llu, %llu, %llu\n", | 53 | printf("%llu, %llu, %llu\n", |
52 | start->timestamp, stop->timestamp, | 54 | start->timestamp, stop->timestamp, |
53 | stop->timestamp - start->timestamp); | 55 | stop->timestamp - start->timestamp); |
56 | complete++; | ||
57 | } | ||
54 | } else | 58 | } else |
55 | incomplete++; | 59 | incomplete++; |
56 | 60 | ||
@@ -73,14 +77,30 @@ static void show_csv(struct timestamp* ts, size_t count) | |||
73 | } | 77 | } |
74 | }*/ | 78 | }*/ |
75 | 79 | ||
80 | |||
81 | static void skip_n(struct timestamp** ts, size_t *count, unsigned int n) | ||
82 | { | ||
83 | while (n-- && (*count)--) | ||
84 | { | ||
85 | (*ts)++; | ||
86 | skipped++; | ||
87 | } | ||
88 | } | ||
89 | |||
76 | static void show_id(struct timestamp* ts, size_t count, unsigned long id) | 90 | static void show_id(struct timestamp* ts, size_t count, unsigned long id) |
77 | { | 91 | { |
78 | while (ts->event != id + 1 && count--) { | 92 | while (ts->event != id + 1 && count) { |
79 | skipped++; | 93 | skipped++; |
80 | ts++; | 94 | ts++; |
95 | count--; | ||
81 | } | 96 | } |
97 | //printf("count == %d\n", count); | ||
98 | if (!count) | ||
99 | return; | ||
100 | skip_n(&ts, &count, 100); | ||
82 | if (!count) | 101 | if (!count) |
83 | return; | 102 | return; |
103 | //printf("count == %d\n", count); | ||
84 | while (count--) | 104 | while (count--) |
85 | if (ts->event == id) | 105 | if (ts->event == id) |
86 | show_csv(ts++, count); | 106 | show_csv(ts++, count); |
@@ -125,10 +145,14 @@ int main(int argc, char** argv) | |||
125 | show_id(ts, count, id); | 145 | show_id(ts, count, id); |
126 | 146 | ||
127 | fprintf(stderr, | 147 | fprintf(stderr, |
128 | "Skipped : %d\n" | 148 | "Total : %10d\n" |
129 | "Incomplete: %d\n" | 149 | "Skipped : %10d\n" |
130 | "Filtered : %d\n", | 150 | "Complete : %10d\n" |
131 | skipped, incomplete, filtered); | 151 | "Incomplete: %10d\n" |
152 | "Filtered : %10d\n", | ||
153 | count, | ||
154 | skipped, complete, | ||
155 | incomplete, filtered); | ||
132 | 156 | ||
133 | return 0; | 157 | return 0; |
134 | } | 158 | } |