svn commit: r323016 - head/usr.bin/netstat
Baptiste Daroussin
bapt at FreeBSD.org
Wed Aug 30 07:58:35 UTC 2017
Author: bapt
Date: Wed Aug 30 07:58:33 2017
New Revision: 323016
URL: https://svnweb.freebsd.org/changeset/base/323016
Log:
Don't call kresolv_list() if using netstat on live kernel
kresolve_list() is calling many kldsym(2). Removing that call on when collecting
stats for the running kernel improves the startup time and CPU usage.
Submitted by: Nikita Kozlov (nikita.kozlov at blade-group.com)
Reviewed by: cem
MFC after: 2 weeks
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D12151
Modified:
head/usr.bin/netstat/main.c
Modified: head/usr.bin/netstat/main.c
==============================================================================
--- head/usr.bin/netstat/main.c Wed Aug 30 07:30:06 2017 (r323015)
+++ head/usr.bin/netstat/main.c Wed Aug 30 07:58:33 2017 (r323016)
@@ -422,13 +422,12 @@ main(int argc, char *argv[])
if (!live) {
if (setgid(getgid()) != 0)
xo_err(-1, "setgid");
+ /* Load all necessary kvm symbols */
+ kresolve_list(nl);
}
if (xflag && Tflag)
xo_errx(1, "-x and -T are incompatible, pick one.");
-
- /* Load all necessary kvm symbols */
- kresolve_list(nl);
if (Bflag) {
if (!live)
More information about the svn-src-all
mailing list