summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-02 10:13:24 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-02 14:01:10 +0900
commit1b53925b4c2e210972eb24882a5ab5b04effa9af (patch)
treed37291d48bdb9109087021c524d3a06de3d42017 /src/lib/eina
parent3cb947d1a5202d4ca6f56d1d38b0d3a2cda05ce8 (diff)
evlog - fix "remove setting stack var to 0" that broke evlogs
this fixes b38c610c7e60cbdcb45fd6d27450e39e3a9c9dd1 - recent commit by me. bad me! spank!
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_evlog.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c
index 359badb150..8c0685799a 100644
--- a/src/lib/eina/eina_evlog.c
+++ b/src/lib/eina/eina_evlog.c
@@ -128,35 +128,34 @@ EAPI void
128eina_evlog(const char *event, void *obj, double srctime, const char *detail) 128eina_evlog(const char *event, void *obj, double srctime, const char *detail)
129{ 129{
130 Eina_Evlog_Item *item; 130 Eina_Evlog_Item *item;
131 int size;
132 char *strings; 131 char *strings;
133 double now; 132 double now;
133 int size;
134 unsigned short detail_offset, event_size; 134 unsigned short detail_offset, event_size;
135 135
136 if (!_evlog_go) return; 136 if (!_evlog_go) return;
137 137 now = get_time();
138 now = get_time(); 138 event_size = strlen(event) + 1;
139 event_size = strlen(event) + 1; 139 size = sizeof(Eina_Evlog_Item) + event_size;
140 size = sizeof(Eina_Evlog_Item) + event_size; 140 detail_offset = 0;
141 if (detail) 141 if (detail)
142 { 142 {
143 detail_offset = size; 143 detail_offset = size;
144 size += strlen(detail) + 1; 144 size += strlen(detail) + 1;
145 } 145 }
146 else detail_offset = 0; 146 size = sizeof(double) * ((size + sizeof(double) - 1)
147 size = sizeof(double) * ((size + sizeof(double) - 1) / sizeof(double)); 147 / sizeof(double));
148
149 eina_spinlock_take(&_evlog_lock); 148 eina_spinlock_take(&_evlog_lock);
150 strings = push_buf(buf, size); 149 strings = push_buf(buf, size);
151 item = (Eina_Evlog_Item *)strings; 150 item = (Eina_Evlog_Item *)strings;
152 item->tim = now; 151 item->tim = now;
153 item->srctim = srctime; 152 item->srctim = srctime;
154 item->thread = (unsigned long long)pthread_self(); 153 item->thread = (unsigned long long)pthread_self();
155 item->obj = (unsigned long long)obj; 154 item->obj = (unsigned long long)obj;
156 item->event_offset = sizeof(Eina_Evlog_Item); 155 item->event_offset = sizeof(Eina_Evlog_Item);
157 item->detail_offset = detail_offset; 156 item->detail_offset = detail_offset;
158 item->event_next = size; 157 item->event_next = size;
159 strcpy(strings + size, event); 158 strcpy(strings + sizeof(Eina_Evlog_Item), event);
160 if (detail_offset > 0) strcpy(strings + detail_offset, detail); 159 if (detail_offset > 0) strcpy(strings + detail_offset, detail);
161 eina_spinlock_release(&_evlog_lock); 160 eina_spinlock_release(&_evlog_lock);
162} 161}