From owner-freebsd-stable@FreeBSD.ORG Wed May 4 13:18:16 2011 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E765106566C; Wed, 4 May 2011 13:18:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 35A308FC0C; Wed, 4 May 2011 13:18:14 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA22690; Wed, 04 May 2011 16:18:12 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DC15213.2090602@FreeBSD.org> Date: Wed, 04 May 2011 16:18:11 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: lev@FreeBSD.org References: <455293202.20110504164901@serebryakov.spb.ru> In-Reply-To: <455293202.20110504164901@serebryakov.spb.ru> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-stable@FreeBSD.org Subject: Re: How to understand, what userland program does in kernel? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 13:18:16 -0000 on 04/05/2011 15:49 Lev Serebryakov said the following: > Hello, Freebsd-stable. > > I have userland program (transmission BT client), which spent 100% > of one core of E4500 CPU when it has many peers. It is surprises me, > as channel is only 35Mbit, and my "Linux" friends can upload much more > on comparable hardware. > > But what surprises me even more, that 50% of this time it spends as > System time. > > Is here any way to understand, what transmission does in kernel for > so much time? It seems, that userland profiling doesn't help me, am I > right? ktrace can easily show you what system calls are made by your program and how much time they take. Maybe that would be sufficient for you. -- Andriy Gapon