diff options
author | bapt <bapt@FreeBSD.org> | 2017-09-17 06:32:05 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2017-09-17 06:32:05 +0000 |
commit | aa98cc7cdb93fdc3a50701017b337926acf32e58 (patch) | |
tree | 335b17f2721a3c47958e937d2ec75fd1c42b1f2c /usr.bin | |
parent | 1e81a56b04731d6e5d317fbb487126d3214f3dc4 (diff) | |
download | FreeBSD-src-aa98cc7cdb93fdc3a50701017b337926acf32e58.zip FreeBSD-src-aa98cc7cdb93fdc3a50701017b337926acf32e58.tar.gz |
MFC r323016:
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@blade-group.com)
Reviewed by: cem
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D12151
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/netstat/main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index f26bf57..da69afc 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -422,14 +422,13 @@ 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) usage(); |