diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-05-22 11:08:30 -0400 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-05-22 11:08:30 -0400 |
| commit | 1e68c15dfd99e85be1eecdd1c426a35c6b8a6cc5 (patch) | |
| tree | ef8642a15fb646e47fa5d9511db2812954e764aa /src | |
| parent | 70030c70da321f66f0be4508f76dc7ed1b43be4a (diff) | |
follow kernel API change: use fixed width fields
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftcat.c | 10 | ||||
| -rw-r--r-- | src/timestamp.c | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/ftcat.c b/src/ftcat.c index 0afba87..b317cba 100644 --- a/src/ftcat.c +++ b/src/ftcat.c | |||
| @@ -11,14 +11,14 @@ | |||
| 11 | 11 | ||
| 12 | static int fd; | 12 | static int fd; |
| 13 | static int event_count = 1; | 13 | static int event_count = 1; |
| 14 | static unsigned long ids[MAX_EVENTS]; | 14 | static cmd_t ids[MAX_EVENTS]; |
| 15 | 15 | ||
| 16 | static int disable_all(int fd) | 16 | static int disable_all(int fd) |
| 17 | { | 17 | { |
| 18 | int ret, size; | 18 | int ret, size; |
| 19 | ids[0] = DISABLE_CMD; | 19 | ids[0] = DISABLE_CMD; |
| 20 | fprintf(stderr, "Disabling %d events.\n", event_count - 1); | 20 | fprintf(stderr, "Disabling %d events.\n", event_count - 1); |
| 21 | size = event_count * sizeof(long); | 21 | size = event_count * sizeof(cmd_t); |
| 22 | ret = write(fd, ids, size); | 22 | ret = write(fd, ids, size); |
| 23 | //fprintf(stderr, "write = %d, meant to write %d (%m)\n", ret, size); | 23 | //fprintf(stderr, "write = %d, meant to write %d (%m)\n", ret, size); |
| 24 | return size == ret; | 24 | return size == ret; |
| @@ -26,8 +26,8 @@ static int disable_all(int fd) | |||
| 26 | 26 | ||
| 27 | static int enable_events(int fd, char* str) | 27 | static int enable_events(int fd, char* str) |
| 28 | { | 28 | { |
| 29 | unsigned long *id; | 29 | cmd_t *id; |
| 30 | unsigned long cmd[3]; | 30 | cmd_t cmd[3]; |
| 31 | 31 | ||
| 32 | id = ids + event_count; | 32 | id = ids + event_count; |
| 33 | if (!str2event(str, id)) | 33 | if (!str2event(str, id)) |
| @@ -38,7 +38,7 @@ static int enable_events(int fd, char* str) | |||
| 38 | cmd[0] = ENABLE_CMD; | 38 | cmd[0] = ENABLE_CMD; |
| 39 | cmd[1] = id[0]; | 39 | cmd[1] = id[0]; |
| 40 | cmd[2] = id[1]; | 40 | cmd[2] = id[1]; |
| 41 | return write(fd, cmd, 3 * sizeof(long)) == 3 * sizeof(long); | 41 | return write(fd, cmd, 3 * sizeof(cmd_t)) == 3 * sizeof(cmd_t); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | 44 | ||
diff --git a/src/timestamp.c b/src/timestamp.c index b495603..1df252a 100644 --- a/src/timestamp.c +++ b/src/timestamp.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | struct event_name { | 5 | struct event_name { |
| 6 | const char* name; | 6 | const char* name; |
| 7 | unsigned long id; | 7 | cmd_t id; |
| 8 | }; | 8 | }; |
| 9 | 9 | ||
| 10 | #define EVENT(name) {#name, TS_ ## name ## _START} | 10 | #define EVENT(name) {#name, TS_ ## name ## _START} |
| @@ -37,7 +37,7 @@ static struct event_name event_table[] = | |||
| 37 | EVENT(SRPT) | 37 | EVENT(SRPT) |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | int str2event(const char* str, unsigned long *id) | 40 | int str2event(const char* str, cmd_t *id) |
| 41 | { | 41 | { |
| 42 | int i; | 42 | int i; |
| 43 | 43 | ||
| @@ -49,7 +49,7 @@ int str2event(const char* str, unsigned long *id) | |||
| 49 | return 0; | 49 | return 0; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | const char* event2str(unsigned long id) | 52 | const char* event2str(cmd_t id) |
| 53 | { | 53 | { |
| 54 | int i; | 54 | int i; |
| 55 | 55 | ||
