From 853adace69f2532dfb5427737054b3c94c30f93b Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 30 Jan 2017 15:28:29 -0600 Subject: [PATCH] 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. --- src/lib/eina/eina_evlog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) Eina_Evlog_Item *item; int size; char *strings; - double now = get_time(); + double now; unsigned short detail_offset = 0; unsigned short event_size; if (!_evlog_go) return; + now = get_time(); eina_spinlock_take(&_evlog_lock); size = sizeof(Eina_Evlog_Item); event_size = strlen(event) + 1;