summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-05-10 22:36:39 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-05-10 22:36:39 +0900
commit6c99fb6c92e6dd2300f6738c1ee6078fffc83212 (patch)
treed73559f26e07f550e7378d8f08e045aaf07468d6 /src/bin
parent71182a57a34e4783f44b575105ae14094ab95865 (diff)
eina evlog - make log dumps simple binary from debugd with header
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/efl/efl_debugd.c47
1 files changed, 13 insertions, 34 deletions
diff --git a/src/bin/efl/efl_debugd.c b/src/bin/efl/efl_debugd.c
index c4a5e5a50b..79d8aa40f7 100644
--- a/src/bin/efl/efl_debugd.c
+++ b/src/bin/efl/efl_debugd.c
@@ -11,7 +11,6 @@ struct _Client
11 Ecore_Timer *evlog_fetch_timer; 11 Ecore_Timer *evlog_fetch_timer;
12 int evlog_on; 12 int evlog_on;
13 FILE *evlog_file; 13 FILE *evlog_file;
14 int evlog_inset;
15 14
16 int version; 15 int version;
17 pid_t pid; 16 pid_t pid;
@@ -110,10 +109,9 @@ _do(Client *c, char *op, unsigned char *d, int size)
110 109
111 send_cli(c2->client, "EVON", NULL, 0); 110 send_cli(c2->client, "EVON", NULL, 0);
112 c2->evlog_fetch_timer = ecore_timer_add(0.2, _cb_evlog, c2); 111 c2->evlog_fetch_timer = ecore_timer_add(0.2, _cb_evlog, c2);
113 snprintf(buf, sizeof(buf), "%s/efl_debug_evlog-%i.txt", 112 snprintf(buf, sizeof(buf), "%s/efl_debug_evlog-%i.log",
114 getenv("HOME"), c->pid); 113 getenv("HOME"), c->pid);
115 c2->evlog_file = fopen(buf, "w"); 114 c2->evlog_file = fopen(buf, "w");
116 c->evlog_inset = 0;
117 } 115 }
118 } 116 }
119 } 117 }
@@ -144,42 +142,23 @@ _do(Client *c, char *op, unsigned char *d, int size)
144 } 142 }
145 else if (!strcmp(op, "EVLG")) 143 else if (!strcmp(op, "EVLG"))
146 { 144 {
147// unsigned int *overflow = (unsigned int *)(d + 0); 145 unsigned int *overflow = (unsigned int *)(d + 0);
148 unsigned char *end = d + size; 146 unsigned char *end = d + size;
149 unsigned char *p = d + 8; 147 unsigned char *p = d + 4;
150 char *event_str, *detail_str; 148 Eina_Evlog_Item hitem;
151 Eina_Evlog_Item *item;
152 int i, inset;
153 149
154 printf("EVLG!!!! %i\n", size);
155 inset = c->evlog_inset;
156 if (c->evlog_file) 150 if (c->evlog_file)
157 { 151 {
158 printf(" have out file\n"); 152 hitem.tim = 0.0;
159 while (p < end) 153 hitem.srctim = 0.0;
160 { 154 hitem.thread = 0;
161 item = (Eina_Evlog_Item *)p; 155 hitem.obj = *overflow;
162 printf(" have item %p\n", p); 156 hitem.event_offset = 0;
163 if ((item->event_next > item->detail_offset) && 157 hitem.detail_offset = 0;
164 ((p + item->event_next) < end)) 158 hitem.event_next = sizeof(Eina_Evlog_Item);
165 { 159 fwrite(&hitem, sizeof(Eina_Evlog_Item), 1, c->evlog_file);
166 detail_str = ""; 160 fwrite(p, end - p, 1, c->evlog_file);
167 event_str = (char *)(p + item->event_offset);
168 if (event_str[0] == '+') inset++;
169 if (item->detail_offset)
170 detail_str = (char *)(p + item->detail_offset);
171 for (i = 0; i < inset; i++) fprintf(c->evlog_file, " ");
172 fprintf(c->evlog_file,
173 "%1.10f [%s] %1.10f 0x%llx 0x%llx %s\n",
174 item->tim, event_str, item->srctim,
175 item->thread, item->obj,
176 detail_str);
177 if (event_str[0] == '-') inset--;
178 }
179 p += item->event_next;
180 }
181 } 161 }
182 c->evlog_inset = inset;
183 } 162 }
184} 163}
185 164