From Torsten.Hothorn at rzmail.uni-erlangen.de  Wed Feb 22 11:39:33 2006
From: Torsten.Hothorn at rzmail.uni-erlangen.de (Torsten Hothorn)
Date: Wed, 22 Feb 2006 11:39:33 +0100 (CET)
Subject: [Rd] profiling C code
In-Reply-To: <Pine.LNX.4.64.0602211551440.11480@gannet.stats.ox.ac.uk>
References: <39B6DDB9048D0F4DAD42CB26AAFF0AFAFED82C@usctmx1106.merck.com>
	<Pine.LNX.4.64.0602210720001.30643@gannet.stats.ox.ac.uk>
	<Pine.LNX.4.64.0602211551440.11480@gannet.stats.ox.ac.uk>
Message-ID: <Pine.LNX.4.64.0602221135290.23956@artemis.imbe.med.uni-erlangen.de>


>
> If you are running Linux, Torsten's suggestion of oprofile is a good one,
> provided you have root access (it seems to need it).  So I used in a root
> terminal (running the same example in another window in the middle)
>
> % opcontrol --no-vmlinux
> % opcontrol --start
> .... run things ...

opcontrol --dump

doesn't require root privileges on my system and

> % opreport -l /users/ripley/R/R-devel/bin/exec/R
> % opreport -l /users/ripley/R/R-devel/library/stats/libs/stats.so

should be allowed for `normal users', too.

> ...
> (No unit mask) count 100000
> samples  %        symbol name
> 6        31.5789  bvalue_
> 4        21.0526  bsplvb_
> 3        15.7895  bsplvd_
> 2        10.5263  sbart_
> 2        10.5263  sslvrg_
> 1         5.2632  anonymous symbol from section .plt
> 1         5.2632  stxwx_
> % opannotate -s /users/ripley/R/R-devel/library/stats/libs/stats.so
> [Problem, root cannot read my source files]

for me, opannotate did not ask about running as `root'.

> % opcontrol --shutdown
>
> If there is a way to use this without root access I would like to know it,
> as only a few very privileged users get that here, and I am not going to
> open up root access to my private file server.

root needs to start the daemon via

opcontrol --start-daemon

and normal users can dump the output. But I don't know how a normal user 
would clean up and start new.

Best,

Torsten



[Rd] profiling C code
Torsten Hothorn