Lev Serebryakov
2011-May-04 12:57 UTC
How to understand, what userland program does in kernel?
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? -- // Black Lion AKA Lev Serebryakov <lev@FreeBSD.org>
Andriy Gapon
2011-May-04 13:18 UTC
How to understand, what userland program does in kernel?
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
Alexander Leidinger
2011-May-04 13:19 UTC
How to understand, what userland program does in kernel?
Quoting Lev Serebryakov <lev@FreeBSD.org> (from Wed, 4 May 2011 16:49:01 +0400):> 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 and dtrace are your friends. ktrace for a simple "it makes those syscalls/ioctls/..." type of information gathering, and dtrace for in-deep investigation. Bye, Alexander. -- The difference between a good haircut and a bad one is seven days. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137
Lev Serebryakov
2011-May-04 13:26 UTC
How to understand, what userland program does in kernel?
Hello, Lev. You wrote 4 ??? 2011 ?., 16:49:01:> 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.When it spents, says, 75% of one core, SYSTEM is only 1-2%, not 75%/2 =~ 37%, what is interesting... -- // Black Lion AKA Lev Serebryakov <lev@FreeBSD.org>