From 9a9466f1fdad6fb6c94c5ef8ddb1a687a7bcd874 Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Thu, 31 Mar 2011 00:37:47 +0100 Subject: Small improvements to speed of reading of configuration file. Tidy up signalling of "ready" to command loop, and checking of appropriate state to close written configuration file. --- lib/vty.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/vty.c') diff --git a/lib/vty.c b/lib/vty.c index 173b59e1..2a936170 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -982,17 +982,21 @@ vty_read_config_file (int fd, const char* name, cmd_command first_cmd, { cmd_return_code_t ret ; vty vty ; + qtime_t taking ; vty = vty_config_read_open(fd, name, full_lex) ; vty_cmd_loop_prepare(vty) ; - zlog_info("Started reading configuration: %s", name) ; + taking = qt_get_monotonic() ; ret = cmd_read_config(vty, first_cmd, ignore_warnings) ; - zlog_info("Finished reading configuration%s", - (ret == CMD_SUCCESS) ? "." : " -- FAILED") ; + taking = (qt_get_monotonic() - taking) / (QTIME_SECOND / 1000) ; + + zlog_info("Finished reading configuration '%s' in %d.%d secs%s", + name, (int)(taking / 1000), (int)(taking % 1000), + (ret == CMD_SUCCESS) ? "." : " -- FAILED") ; vty_cmd_loop_exit(vty) ; -- cgit v1.2.3