From owner-freebsd-sparc64@FreeBSD.ORG Sun Jul 17 15:12:54 2011 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 367401065673 for ; Sun, 17 Jul 2011 15:12:54 +0000 (UTC) (envelope-from boland37@xs4all.nl) Received: from smtp-vbr7.xs4all.nl (smtp-vbr7.xs4all.nl [194.109.24.27]) by mx1.freebsd.org (Postfix) with ESMTP id C56668FC16 for ; Sun, 17 Jul 2011 15:12:53 +0000 (UTC) Received: from charlemagne.boland.org (59-36-215.ftth.xms.internl.net [82.215.36.59]) (authenticated bits=0) by smtp-vbr7.xs4all.nl (8.13.8/8.13.8) with ESMTP id p6HEs4r1002852 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sun, 17 Jul 2011 16:54:05 +0200 (CEST) (envelope-from boland37@xs4all.nl) Message-ID: <4E22F78B.8010602@xs4all.nl> Date: Sun, 17 Jul 2011 16:54:03 +0200 From: Michiel Boland User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110701 Thunderbird/3.1.11 MIME-Version: 1.0 To: freebsd-sparc64@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner Subject: netstat long startup time X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 15:12:54 -0000 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