2003-11-16 16:10:39

by Peter Zaitsev

[permalink] [raw]
Subject: Measuring per thread CPU consumption & others statistics for NPTL

Dear Kernel developers,

I would wish to add to MySQL profiling of CPU and system usage, which
would allow for example to see amount of system/user CPU needed to
process particular query as well as amount of IO needed.

With LinuxThreads I probably can use times() or getrusage() for this
purpose, as Threads share a lot of infrastructure with processes.

This however would not work with NPTL threads.


Are there any ways to get similar information for thread rather than
process ?

Second question is about accuracy - Is any way to get system/user CPU
consumption information with more than 1/100 sec accuracy ?

Thank you for your advices.

--
Peter Zaitsev, Full-Time Developer
MySQL AB, http://www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification


2003-11-17 00:27:27

by Peter Chubb

[permalink] [raw]
Subject: Re: Measuring per thread CPU consumption & others statistics for NPTL

>>>>> "Peter" == Peter Zaitsev <[email protected]> writes:


Peter> Are there any ways to get similar information for thread rather
Peter> than process ?

Peter> Second question is about accuracy - Is any way to get
Peter> system/user CPU consumption information with more than 1/100
Peter> sec accuracy ?

If you apply my microstate accounting patch, you can get nanosecomnd
resolution per thread.

Peter C

2003-11-17 09:25:44

by Peter Zaitsev

[permalink] [raw]
Subject: Re: Measuring per thread CPU consumption & others statistics for NPTL

On Mon, 2003-11-17 at 03:27, Peter Chubb wrote:

>
> Peter> Second question is about accuracy - Is any way to get
> Peter> system/user CPU consumption information with more than 1/100
> Peter> sec accuracy ?
>
> If you apply my microstate accounting patch, you can get nanosecomnd
> resolution per thread.

Great Peter,

Is it planned to be included in the kernel at some point ?
For me it is the most important not to get things working on some
particular test systems, but to allow customers, which run generic or
vendor provided kernels to use the functionality.

Does your patch only computes statistics on per process basics or per
thread as well ?


--
Peter Zaitsev, Full-Time Developer
MySQL AB, http://www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification

2003-11-17 16:37:00

by John Reiser

[permalink] [raw]
Subject: Re: Measuring per thread CPU consumption & others statistics for NPTL

Peter Zaitsev wrote:
> On Mon, 2003-11-17 at 03:27, Peter Chubb wrote:
>>If you apply my microstate accounting patch, you can get nanosecomnd
>>resolution per thread.
>
> Is it planned to be included in the kernel at some point ?
> For me it is the most important not to get things working on some
> particular test systems, but to allow customers, which run generic or
> vendor provided kernels to use the functionality.

The current 2.6.0-test9-bk22 has no microsecond-or-finer per-thread
accounting, so based on current policy and past experience you may
have to wait two years.

A leading contender for x86 and x86_64 is the perfctr patches
http://www.csd.uu.se/~mikpe/linux/perfctr/ which have been maintained
for a number of years (v1.0 at 2000-01-31 for Linux 2.2.14/2.3.41) and
have a following, including http://icl.cs.utk.edu/projects/papi/ .
A recent patched, ready-to-install NPTL kernel happens to reside at
http://www.BitWagon.com/ftp/kernel-smp-2.4.20-20.9.perfctr2.5.5.i686.rpm .

For a complete profiler: http://www.BitWagon.com/tsprof/tsprof.html
which also will run on a generic kernel in "-wallclock" mode
(TSC cycle accuracy, but not virtualized.)

--



2003-11-20 18:02:21

by Herbert Poetzl

[permalink] [raw]
Subject: Re: Measuring per thread CPU consumption & others statistics for NPTL

On Mon, Nov 17, 2003 at 11:27:17AM +1100, Peter Chubb wrote:
> >>>>> "Peter" == Peter Zaitsev <[email protected]> writes:
>
>
> Peter> Are there any ways to get similar information for thread rather
> Peter> than process ?
>
> Peter> Second question is about accuracy - Is any way to get
> Peter> system/user CPU consumption information with more than 1/100
> Peter> sec accuracy ?
>
> If you apply my microstate accounting patch, you can get nanosecomnd
> resolution per thread.

is there a version for 2.4 available?

TIA,
Herbert

> Peter C
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/