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. 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. 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. pj -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas
Dirk Eddelbuettel
2009-Jun-28 20:04 UTC
[R-sig-Debian] sprof works on your Debian/Ubuntu ?
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.
On Tue, Jun 30, 2009 at 1:09 PM, Paul Johnson<pauljohn32 at gmail.com> wrote:> On Sun, Jun 28, 2009 at 3:04 PM, Dirk Eddelbuettel<edd at debian.org> wrote: >> >> Paul, > >> >> Yes, rebuilding only the parts you want to profile using google-perftools is >> easier. >> >> Hope this helps, Dirk >Hello Dirk and others: I wonder about the small r in your notes. What is that? In Ubuntu 9.04, I installed "libgoogle-perftool0" and "libgoogle-perftools-dev" from the Ubuntu archive. The version of google perftools that Ubuntu repositories provide is old. The Version is: 0.98, but i see on their homepage it is now up to 1.3. (http://code.google.com/p/google-perftools/) I run into the same problem with either one. This happens: $ LD_PRELOAD="/usr/lib/libprofiler.so.0.0.0" CPUPROFILE=/tmp/rprof3.log R Profiling timer expired I am in the thin air now.. Hm. I just noticed I can run the same with "sudo" and it does not stop with "Profiling timer expired". Do you have to run this as root as well? (Same problem I encountered with oprofile, incidentally). I can link my package with -lprofile. I suppose I could rebuild R. Would root access be needed to start the profile collector?> -- > Paul E. Johnson > Professor, Political Science > 1541 Lilac Lane, Room 504 > University of Kansas >-- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas
Reasonably Related Threads
- Does sprof work on CentOS5?
- Compile error in x86 Solaris
- beginner's guide to C++ programming with R packages?
- [LLVMdev] [patch] New feature: debug info in add2line format (--jit-emit-debug-addr2line)
- [LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)