summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-01-30 15:28:29 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-01-30 15:28:29 -0600
commit853adace69f2532dfb5427737054b3c94c30f93b (patch)
tree781935eddf02fff61d9c11793f3b36024bbb3a4c /src/lib/eina
parent4697d0c2b3c27cfb31d88918ac3f5d615ff9d541 (diff)
eina_evlog: Don't call get_time prematurely
If we're not logging events this generates a lot of wasted system calls. They probably don't amount to much, but it's trivial to get rid of them, and they make a mess when logging with strace.
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_evlog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c
index 1e87391790..7fec80962f 100644
--- a/src/lib/eina/eina_evlog.c
+++ b/src/lib/eina/eina_evlog.c
@@ -130,11 +130,12 @@ eina_evlog(const char *event, void *obj, double srctime, const char *detail)
130 Eina_Evlog_Item *item; 130 Eina_Evlog_Item *item;
131 int size; 131 int size;
132 char *strings; 132 char *strings;
133 double now = get_time(); 133 double now;
134 unsigned short detail_offset = 0; 134 unsigned short detail_offset = 0;
135 unsigned short event_size; 135 unsigned short event_size;
136 136
137 if (!_evlog_go) return; 137 if (!_evlog_go) return;
138 now = get_time();
138 eina_spinlock_take(&_evlog_lock); 139 eina_spinlock_take(&_evlog_lock);
139 size = sizeof(Eina_Evlog_Item); 140 size = sizeof(Eina_Evlog_Item);
140 event_size = strlen(event) + 1; 141 event_size = strlen(event) + 1;