Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jul 2011 16:54:03 +0200
From:      Michiel Boland <boland37@xs4all.nl>
To:        freebsd-sparc64@freebsd.org
Subject:   netstat long startup time
Message-ID:  <4E22F78B.8010602@xs4all.nl>

next in thread | raw e-mail | index | archive | help
Hi. The netstat command is very slow on -CURRENT sparc64. (Blade 100.) It first 
spends 1.5 seconds trying to resolve kernel symbols in kldsym(). A fragment of 
ktrace output

  ...
  37251 netstat  0.000029 CALL  getpid
  37251 netstat  0.000017 RET   getpid 37251/0x9183
  37251 netstat  0.000037 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.007638 RET   kldsym -1 errno 2 No such file or directory
  37251 netstat  0.000279 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.007642 RET   kldsym -1 errno 2 No such file or directory
  37251 netstat  0.000147 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.007231 RET   kldsym -1 errno 2 No such file or directory
  37251 netstat  0.000126 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.000041 RET   kldsym 0
  37251 netstat  0.000033 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.003068 RET   kldsym 0
  37251 netstat  0.000782 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.000050 RET   kldsym 0
  37251 netstat  0.000032 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.007160 RET   kldsym -1 errno 2 No such file or directory
  37251 netstat  0.000229 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.007279 RET   kldsym -1 errno 2 No such file or directory
  37251 netstat  0.000128 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffc798)
  37251 netstat  0.007242 RET   kldsym -1 errno 2 No such file or directory
  37251 netstat  0.000160 CALL  kldsym(0,KLDSYM_LOOKUP,0x7fdffffdc78)
  37251 netstat  0.000045 RET   kldsym 0
  (repeated about 50 times)

note the extraordinary amount of time spent in the kldym system call

Is there any way to speed this up? (Apart from rewriting the netstat program so 
that it does not try to resolve symbol names that are then never used.)

Cheers
Michiel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E22F78B.8010602>