[R-sig-Debian] sprof works on your Debian/Ubuntu ?

Dirk Eddelbuettel edd at debian.org
Sun Jun 28 22:04:58 CEST 2009


Paul,

On 28 June 2009 at 14:40, Paul Johnson wrote:
| I'm asking here, rather than R-devel, because it seems to be a Linux
| specific question and because I'm using Ubuntu-9.04.

Quite right!

| I'm trying to profile an package, and got errors, so I decided to
| follow BDR's (http://tolstoy.newcastle.edu.au/R/devel/06/02/4254.html)
| example exactly, and got same problem.
| 
| Can anyone replicate?
| 
| $ sudo mkdir -p /var/tmp//usr/lib/R/library/stats/libs
| 
| $ chown -R pauljohn.pauljohn /var/tmp/usr/lib/R
| 
| $ export LD_PROFILE=/usr/lib/R/library/stats/libs/stats.so
| 
| $ R
| 
| ### in R session, type
| >example(smooth.spline)
| > q()
| 
| Observe that does create the profile file:
| 
| $ ls -la /var/tmp/usr/lib/R/library/stats/libs
| total 20
| drwxr-xr-x 2 pauljohn pauljohn    4096 2009-06-28 14:26 .
| drwxr-xr-x 3 pauljohn pauljohn    4096 2009-06-28 14:25 ..
| -rw-r--r-- 1 pauljohn pauljohn 1356800 2009-06-28 14:26 stats.so.profile
| 
| $ sprof /usr/lib/R/library/stats/libs/stats.so
| /var/tmp/usr/lib/R/library/stats/libs/stats.so.profile
| Inconsistency detected by ld.so: dl-open.c: 652: _dl_open: Assertion
| `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT'
| failed!
| pauljohn at pols124:Siena-Profiling$ sudo sprof /usr/lib/R/library/stats/
| libs/stats.so /var/tmp/usr/lib/R/library/stats/libs/stats.so.profile
| Inconsistency detected by ld.so: dl-open.c: 652: _dl_open: Assertion
| `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT'
| failed!
| 
| I Google to find one discussion that there's a bug in glibc that was
| unearthed in 2008 and there was debate on whether "sprof" is now
| deprecated.  I don't understand the details completely.
| (http://sources.redhat.com/ml/libc-alpha/2008-08/msg00013.html)
| 
| Nobody on Ubuntu has tried it lately?
| 
| Instead of sprof, I'll try oprofile, I guess.

No, sorry. While I mention both sprof and oprofile in my tutorial notes on
'an introduction to high-performance computing with R', I actually stress
Google's profiling tool with a worked example. On Debian and Ubuntu, this
tool is in package libgoogle-perftools0 with frontend /usr/bin/google-pprof.

The last release version of the tutorial notes is 
	http://dirk.eddelbuettel.com/papers/bocDec2008introHPCwithR.pdf 
and there is likely to be an updated version following UseR 2009 and the
tutorial session there.

| I already tried to do this with gprof applied to the specific package,
| but no profile is produced.  I believe that means I need to re-build
| all of R with the -pg flag, and I'm a bit reluctant to break
| everything by doing that.

Yes, rebuilding only the parts you want to profile using google-perftools is
easier. 

Hope this helps, Dirk

-- 
Three out of two people have difficulties with fractions.



More information about the R-SIG-Debian mailing list