summaryrefslogtreecommitdiff
path: root/sal/android
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-01-31 15:24:06 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-01-31 15:24:06 +0200
commit6e2e4c4c674ad2b6d1b3aa3759c7c838a0b16728 (patch)
tree8778f831adbffed37667ec4d62903756322c264b /sal/android
parent73a47ed3750bde3de1f8abcf0005ee068b1ed96e (diff)
Log time taken by dlopen()
Diffstat (limited to 'sal/android')
-rw-r--r--sal/android/lo-bootstrap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c
index b5a0a051f0e0..b9ed8dcd01ae 100644
--- a/sal/android/lo-bootstrap.c
+++ b/sal/android/lo-bootstrap.c
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
@@ -815,6 +816,8 @@ lo_dlopen(const char *library)
int i;
int found;
+ struct timeval tv0, tv1, tvdiff;
+
rover = loaded_libraries;
while (rover != NULL &&
strcmp(rover->name, library) != 0)
@@ -869,8 +872,13 @@ lo_dlopen(const char *library)
}
free_ptrarray((void **) needed);
+ gettimeofday(&tv0, NULL);
p = dlopen(full_name, RTLD_LOCAL);
- LOGI("dlopen(%s) = %p", full_name, p);
+ gettimeofday(&tv1, NULL);
+ timersub(&tv1, &tv0, &tvdiff);
+ LOGI("dlopen(%s) = %p, %ld.%03lds",
+ full_name, p,
+ (long) tvdiff.tv_sec, (long) tvdiff.tv_usec / 1000);
free(full_name);
if (p == NULL)
LOGE("lo_dlopen: Error from dlopen(%s): %s", library, dlerror());