[Rd] profiling C code

2006-02-20 Thread Ross Boylan
Does anyone have any advice about profiling C/C++ code in a package under R? Does R need to be built specially for this to work? The FAQ has some entries about profiling but they cover R level profiling; I'm try to get at the C++ code I've written that is called from R. Primary target is Mac OS

Re: [Rd] profiling C code

2006-02-20 Thread Liaw, Andy
The last time I tried I didn't have much luck. The gprof manual I could find seems to indicate that it can not profile code that are dynamically loaded. (I was trying on Linux.) The R source seems to hint otherwise. I'd very much appreciate pointers as well. Andy From: Ross Boylan > > Does an

Re: [Rd] profiling C code

2006-02-20 Thread Torsten Hothorn
On Mon, 20 Feb 2006, Liaw, Andy wrote: > The last time I tried I didn't have much luck. The gprof manual I could > find seems to indicate that it can not profile code that are dynamically > loaded. (I was trying on Linux.) The R source seems to hint otherwise. > I'd very much appreciate pointe

Re: [Rd] profiling C code

2006-02-20 Thread Prof Brian Ripley
On Mon, 20 Feb 2006, Liaw, Andy wrote: > The last time I tried I didn't have much luck. The gprof manual I could > find seems to indicate that it can not profile code that are dynamically > loaded. (I was trying on Linux.) The R source seems to hint otherwise. grof is not mentioned in any of t

Re: [Rd] profiling C code

2006-02-21 Thread Thomas Lumley
On Mon, 20 Feb 2006, Ross Boylan wrote: > Does anyone have any advice about profiling C/C++ code in a package > under R? Does R need to be built specially for this to work? > > The FAQ has some entries about profiling but they cover R level > profiling; I'm try to get at the C++ code I've written

Re: [Rd] profiling C code

2006-02-21 Thread Prof Brian Ripley
Some more information. 1) Whether gprof works is system-specific. Solaris says in man gprof 64-bit profiling 64-bit profiling may be used freely with dynamically linked executables, and profiling information is collected for the shared objects if the objects are compiled

Re: [Rd] profiling C code

2006-02-21 Thread Simon Urbanek
On Feb 20, 2006, at 7:18 PM, Ross Boylan wrote: > Does anyone have any advice about profiling C/C++ code in a package > under R? Does R need to be built specially for this to work? > > The FAQ has some entries about profiling but they cover R level > profiling; I'm try to get at the C++ code

Re: [Rd] profiling C code

2006-02-22 Thread Torsten Hothorn
> > 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 ...

Re: [Rd] profiling C code

2006-02-22 Thread Prof Brian Ripley
On Wed, 22 Feb 2006, Torsten Hothorn wrote: > >> >> 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-v