aboutsummaryrefslogtreecommitdiffstats
path: root/src/timestamp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/timestamp.c')
-rw-r--r--src/timestamp.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/timestamp.c b/src/timestamp.c
index 4c04ce7..442c445 100644
--- a/src/timestamp.c
+++ b/src/timestamp.c
@@ -22,17 +22,26 @@ static struct event_name event_table[] =
22 EVENT(PLUGIN_TICK), 22 EVENT(PLUGIN_TICK),
23 EVENT(CXS), 23 EVENT(CXS),
24 EVENT(SEND_RESCHED), 24 EVENT(SEND_RESCHED),
25 {"RELEASE_LATENCY", TS_RELEASE_LATENCY},
26
27 EVENT(SYSCALL_IN),
28 EVENT(SYSCALL_OUT),
29 EVENT(LOCK),
30 EVENT(UNLOCK),
31 {"LOCK_SUSPEND", TS_LOCK_SUSPEND},
32 {"LOCK_RESUME", TS_LOCK_RESUME},
25}; 33};
26 34
27int str2event(const char* str, cmd_t *id) 35int str2event(const char* str, cmd_t *id)
28{ 36{
29 int i; 37 int i;
30 38
31 for (i = 0; i < sizeof(event_table) / sizeof(event_table[0]); i++) 39 for (i = 0; i < sizeof(event_table) / sizeof(event_table[0]); i++) {
32 if (!strcmp(str, event_table[i].name)) { 40 if (!strcmp(str, event_table[i].name)) {
33 *id = event_table[i].id; 41 *id = event_table[i].id;
34 return 1; 42 return 1;
35 } 43 }
44 }
36 /* try to parse it as a number */ 45 /* try to parse it as a number */
37 return sscanf(str, "%u", id); 46 return sscanf(str, "%u", id);
38} 47}
@@ -47,3 +56,13 @@ const char* event2str(cmd_t id)
47 56
48 return NULL; 57 return NULL;
49} 58}
59
60const char* task_type2str(int task_type)
61{
62 if (task_type == TSK_RT)
63 return "RT";
64 else if (task_type == TSK_BE)
65 return "BE";
66 else
67 return "UNKNOWN";
68}