aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-04-13 15:30:03 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-04-13 15:30:03 -0400
commitdbe9dbe3b16baa55b7867ddd834197421324e131 (patch)
treea3101e1888e5d19487bcdc26e3837574485d8ef9
parent98648884360b21854944b933a035a9e8290c14e7 (diff)
add PCP timestamps
-rw-r--r--include/timestamp.h33
-rw-r--r--src/ftcat.c2
-rw-r--r--src/timestamp.c11
3 files changed, 43 insertions, 3 deletions
diff --git a/include/timestamp.h b/include/timestamp.h
index 6d69150..423a20e 100644
--- a/include/timestamp.h
+++ b/include/timestamp.h
@@ -13,7 +13,7 @@ const char* event2str(unsigned long id);
13 13
14#define ENABLE_CMD 0L 14#define ENABLE_CMD 0L
15 15
16#define TIMESTAMP(id) id ## L 16#define TIMESTAMP(id) id
17 17
18#define TS_SCHED_START TIMESTAMP(100) 18#define TS_SCHED_START TIMESTAMP(100)
19#define TS_SCHED_END TIMESTAMP(101) 19#define TS_SCHED_END TIMESTAMP(101)
@@ -50,6 +50,37 @@ const char* event2str(unsigned long id);
50#define TS_FIFO_DOWN_START TIMESTAMP(182) 50#define TS_FIFO_DOWN_START TIMESTAMP(182)
51#define TS_FIFO_DOWN_END TIMESTAMP(183) 51#define TS_FIFO_DOWN_END TIMESTAMP(183)
52 52
53#define PCP1 200
54#define PCP2 204
55
56#define DPCP 210
57#define MPCP 220
58#define FMLP 230
59#define SRPT 240
60
61#define TS_PCP_UP_START TIMESTAMP(PCP1)
62#define TS_PCP_UP_END TIMESTAMP(PCP1 + 1)
63#define TS_PCP1_DOWN_START TIMESTAMP(PCP1 + 2)
64#define TS_PCP1_DOWN_END TIMESTAMP(PCP1 + 3)
65#define TS_PCP2_DOWN_START TIMESTAMP(PCP2 + 2)
66
67#define TS_PCP2_DOWN_END TIMESTAMP(PCP2 + 3)
68
69#define TS_DPCP_INVOKE_START TIMESTAMP(DPCP)
70#define TS_DPCP_INVOKE_END TIMESTAMP(DPCP + 1)
71#define TS_DPCP_AGENT1_START TIMESTAMP(DPCP + 2)
72#define TS_DPCP_AGENT1_END TIMESTAMP(DPCP + 3)
73#define TS_DPCP_AGENT2_START TIMESTAMP(DPCP + 4)
74#define TS_DPCP_AGENT2_END TIMESTAMP(DPCP + 5)
75
76#define TS_MPCP_UP_START TIMESTAMP(MPCP)
77#define TS_MPCP_UP_END TIMESTAMP(MPCP + 1)
78#define TS_MPCP_DOWN_START TIMESTAMP(MPCP + 2)
79#define TS_MPCP_DOWN_END TIMESTAMP(MPCP + 3)
80
81
82#define TS_SRPT_START TIMESTAMP(SRPT)
83#define TS_SRPT_END TIMESTAMP(SRPT + 1)
53 84
54 85
55 86
diff --git a/src/ftcat.c b/src/ftcat.c
index 151fa29..4d83f56 100644
--- a/src/ftcat.c
+++ b/src/ftcat.c
@@ -34,7 +34,7 @@ static void cat2stdout(int fd)
34{ 34{
35 static char buf[4096]; 35 static char buf[4096];
36 int rd; 36 int rd;
37 while (rd = read(fd, buf, 4096)) 37 while ((rd = read(fd, buf, 4096)))
38 fwrite(buf, 1, rd, stdout); 38 fwrite(buf, 1, rd, stdout);
39} 39}
40 40
diff --git a/src/timestamp.c b/src/timestamp.c
index b7e78c9..ca03393 100644
--- a/src/timestamp.c
+++ b/src/timestamp.c
@@ -23,7 +23,16 @@ static struct event_name event_table[] =
23 EVENT(PI_UP), 23 EVENT(PI_UP),
24 EVENT(PI_DOWN), 24 EVENT(PI_DOWN),
25 EVENT(FIFO_UP), 25 EVENT(FIFO_UP),
26 EVENT(FIFO_DOWN) 26 EVENT(FIFO_DOWN),
27 EVENT(PCP_UP),
28 EVENT(PCP1_DOWN),
29 EVENT(PCP2_DOWN),
30 EVENT(DPCP_INVOKE),
31 EVENT(DPCP_AGENT1),
32 EVENT(DPCP_AGENT2),
33 EVENT(MPCP_UP),
34 EVENT(MPCP_DOWN),
35 EVENT(SRPT)
27}; 36};
28 37
29int str2event(const char* str, unsigned long *id) 38int str2event(const char* str, unsigned long *id)