diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2017-12-12 14:47:04 +0100 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2017-12-12 14:47:04 +0100 |
commit | a699dd69ea4731fc2d75d55171524fdd362f65d5 (patch) | |
tree | d89e2baf6b01384e3e98a5952ad48bdf1904af4e /isisd | |
parent | Merge pull request #1526 from chiragshah6/ospfv3_dev (diff) | |
download | frr-a699dd69ea4731fc2d75d55171524fdd362f65d5.tar.xz frr-a699dd69ea4731fc2d75d55171524fdd362f65d5.zip |
isisd: save a clock_gettime() call
Use the thread cached clock to use as start time. It will save a call to
clock_gettime() and also provide a more 'accurate' time measurement from
the start of the procedure.
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_spf.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 3008fb6a1..47d2c5caa 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1249,7 +1249,7 @@ static void init_spt(struct isis_spftree *spftree, int mtid, int level, } static int isis_run_spf(struct isis_area *area, int level, int family, - u_char *sysid) + u_char *sysid, struct timeval *nowtv) { int retval = ISIS_OK; struct isis_vertex *vertex; @@ -1263,9 +1263,8 @@ static int isis_run_spf(struct isis_area *area, int level, int family, uint16_t mtid; /* Get time that can't roll backwards. */ - monotime(&time_now); - start_time = time_now.tv_sec; - start_time = (start_time * 1000000) + time_now.tv_usec; + start_time = nowtv->tv_sec; + start_time = (start_time * 1000000) + nowtv->tv_usec; if (family == AF_INET) spftree = area->spftree[level - 1]; @@ -1372,9 +1371,11 @@ static int isis_run_spf_cb(struct thread *thread) area->area_tag, level); if (area->ip_circuits) - retval = isis_run_spf(area, level, AF_INET, isis->sysid); + retval = isis_run_spf(area, level, AF_INET, isis->sysid, + &thread->real); if (area->ipv6_circuits) - retval = isis_run_spf(area, level, AF_INET6, isis->sysid); + retval = isis_run_spf(area, level, AF_INET6, isis->sysid, + &thread->real); return retval; } |