diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-06-04 04:36:19 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-06-04 04:36:19 +0000 |
commit | 78e334b845fd815976369a2a9c0756c8cbe5d7b6 (patch) | |
tree | 7ecc504c8af78c9cb36ec5cfde644c23cea2acbd /ui | |
parent | ee109cc7b230127f04a4ef9d4ad5ed98a7820a42 (diff) |
From Mike Garratt:
Friendly Names support causing unnecessary delay when Wireshark starts.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8034
svn path=/trunk/; revision=49752
Diffstat (limited to 'ui')
-rw-r--r-- | ui/iface_lists.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/ui/iface_lists.c b/ui/iface_lists.c index aec2e91ecf..4741424859 100644 --- a/ui/iface_lists.c +++ b/ui/iface_lists.c @@ -38,6 +38,7 @@ #include "ui/capture_globals.h" #include "ui/iface_lists.h" +#include "../log.h" /* * Used when sorting an interface list into alphabetical order by @@ -341,18 +342,33 @@ scan_local_interfaces(void) } /* - * Get the global interface list. Generate it if we haven't - * done so already. + * Get the global interface list. Generate it if we haven't done so + * already. This can be quite time consuming the first time, so + * record how long it takes in the info log. */ void fill_in_local_interfaces(void) { - static gboolean initialized = FALSE; + GTimeVal start_time; + GTimeVal end_time; + float elapsed; + static gboolean initialized = FALSE; + /* record the time we started, so we can log total time later */ + g_get_current_time(&start_time); + g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "fill_in_local_interfaces() starts"); + if (!initialized) { + /* do the actual work */ scan_local_interfaces(); initialized = TRUE; } + /* log how long it took */ + g_get_current_time(&end_time); + elapsed = (float) ((end_time.tv_sec - start_time.tv_sec) + + ((end_time.tv_usec - start_time.tv_usec) / 1e6)); + + g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "fill_in_local_interfaces() ends, taking %.3fs", elapsed); } void |