From: Maynard J. <may...@us...> - 2009-05-28 19:52:36
|
Arthur Y Lau wrote: > Hi, > > The opreport still doesn't work after following your suggestion, same > situation as before . > > root@picocpe:~# opreport --callgraph > opreport error: > /var/lib/oprofile/samples/current/{root}/root/221/rnc/{dep}/{root}/root/221/rnc/TIMER.0.0.all.all.all: > Invalid argument > root@picocpe:~# opreport > opreport error: > /var/lib/oprofile/samples/current/{root}/root/221/rnc/{dep}/{root}/root/221/rnc/TIMER.0.0.all.all.all: > Invalid argument > root@picocpe:~# ls -ls /<directory as above> > 0 -rw-r--r-- 1 root root 2680 Jan 1 00:30 > TIMER.0.0.all.all.all > root@picocpe:~# opreport --version > opreport: oprofile 0.9.3 compiled on Nov 5 2008 12:43:02 > > The very end of the file oprofiled.log: > oprofiled: open of > /var/lib/oprofile/samples//current/{root}//root/221/rnc/{dep}/{root}//root/221/rnc/TIMER.0.0.all.all.all > failed: Invalid argument Looking through the oprofile daemon code, libdb/db_manage.c:odb_open() is returning EINVAL to the caller, and that's why the oprofile daemon is logging this file open error. You can get this error if the daemon encounters a pre-existing file that doesn't match the expected format (err is set to EINVAL on line 239 of libdb/db_manage.c in oprofile 0.9.3). It's also possible (but unlikely) that one of the other system calls in odb_open() failed with EINVAL (open, or fstat). My bet is on the pre-existing files problem. Apparently, your system clock isn't set right since timestamps are showing up with the year of 1970, so it may be difficult to tell the age of your samples directory and the files contained therein. If you did indeed completely remove /var/lib/oprofile/samples/current directory as I suggested previously, then you can either try to do some debugging or try building/installing oprofile 0.9.4. If you want to debug, it would be easier to start with the opreport failure since you can run gdb or ltrace more easily against that. Debugging the daemon is harder, since it's started as a batch job and then does some forks -- probably easiest to put printf's in the code. -Maynard > oprofiled: open of > /var/lib/oprofile/samples//current/{root}//root/221/rnc/{dep}/{root}//root/221/rnc/TIMER.0.0.all.all.all > failed: Invalid argument > oprofiled: open of > /var/lib/oprofile/samples//current/{root}//root/221/rnc/{dep}/{root}//root/221/rnc/TIMER.0.0.all.all.all > failed: Invalid argument > oprofiled: open of > /var/lib/oprofile/samples//current/{root}//root/221/rnc/{dep}/{root}//root/vmlinux-linux-2.6.18-picochip-2.0.4-cpe20x/TIMER.0.0.all.all.all > failed: Invalid argument > oprofiled: open of > /var/lib/oprofile/samples//current/{root}//root/221/rnc/{dep}/{root}//root/vmlinux-linux-2.6.18-picochip-2.0.4-cpe20x/TIMER.0.0.all.all.all > failed: Invalid argument > oprofiled: open of > /var/lib/oprofile/samples//current/{root}//root/221/rnc/{dep}/{root}//root/vmlinux-linux-2.6.18-picochip-2.0.4-cpe20x/TIMER.0.0.all.all.all > failed: Invalid argument > > Thu Jan 1 00:37:17 1970 > > Nr. sample dumps: 11 > Nr. non-backtrace samples: 184376 > Nr. kernel samples: 155545 > Nr. lost samples (no kernel/user): 0 > Nr. lost kernel samples: 0 > Nr. incomplete code structs: 2 > Nr. samples lost due to sample file open failure: 26189 > Nr. samples lost due to no permanent mapping: 1 > Nr. event lost due to buffer overflow: 1483314 > Nr. samples lost due to no mapping: 1198 > Nr. backtraces skipped due to no file mapping: 0 > Nr. samples lost due to no mm: 0 > Nr. samples lost cpu buffer overflow: 0 > Nr. samples received: 460320 > Nr. backtrace aborted: 0 > oprofiled stopped Thu Jan 1 00:37:17 1970 > > Thanks > > Arthur > ----- Original Message ----- > From: "Maynard Johnson" <may...@us...> > To: "Arthur Y Lau" <art...@ab...> > Cc: <opr...@li...> > Sent: Wednesday, May 27, 2009 7:07 AM > Subject: Re: opreport invalid argument? > > >> Arthur Y Lau wrote: >>> I don't think the opreport worked at all. >>> I tried various options for oprofile and opreport. It always returned me >>> with "invalid argument". >>> I start to wonder if oprofile did actually collect any data at all. >>> Although I run my app for 10 minutes and its on timer mode, it supposed >>> to collect enough data? Is there any way to make sure that oprofile did >>> collect data? >>> >>> The data size in the oprofile session dir, the file TIMER.0.0.all.all.all >>> seems too small. >> What version of oprofile are you using? Have you re-run oprofile (i.e, >> with --reset and --start) and you still get this error when using >> opreport? Because of your use of --session-dir and the aforementioned bug >> we recently fixed, it's possible the --reset you're doing is not resetting >> the correct samples dir. If you can't get by this error, I recommend >> starting from scratch by doing the following: >> 1. opcontrol --deinit >> 2. rm /root/.oprofile/daemonrc >> 3. rm -rf /var/lib/oprofile/samples/current >> 4. rm -rf /tmp/current >> Then try to profile again, but don't use session-dir on any commands -- >> let it default to /var/lib/oprofile. >> >> -Maynard >>> Best regards, >>> >>> Arthur >>> >>> >>> ----- Original Message ----- From: "Maynard Johnson" >>> <may...@us...> >>> To: "Arthur Y Lau" <art...@ab...> >>> Cc: <opr...@li...> >>> Sent: Tuesday, May 26, 2009 4:34 PM >>> Subject: Re: opreport invalid argument? >>> >>> >>>> Arthur Y Lau wrote: >>>>> Hi, >>>>> >>>>> I am currently trying to do profiling on a ARM7 on a patched kernel. >>>>> But I could not get the result of the profilling from opreport. Is >>>>> there something I did incorrect? The pre-installed oprofile is >>>>> installed on TIMER mode. >>>> What version of oprofile is installed? >>>>> Below is a screen log of my trail. >>>>> >>>>> root@picocpe:~# opcontrol --reset >>>>> root@picocpe:~# killall oprofiled >>>> Do NOT do this. The opcontrol script should be used to shutdown the >>>> oprofile >>>> daemon. >>>>> killall: oprofiled: no process killed >>>>> root@picocpe:~# opcontrol --init >>>>> root@picocpe:~# >>>>> opcontrol --vmlinux=/root/vmlinux-linux-2.6.18-picochip-2.0.4-cpe20x >>>>> root@picocpe:~# opcontrol --session-dir=/tmp >>>> This probably didn't take -- a known bug that was fixed in CVS just >>>> recently. >>>> By the way, I recommend against using --sesssion-dir unless you >>>> ABSOLUTELY MUST. >>>> If you use it to collect the profile, then you must >>>> specify --session-dir with >>>> any oprofile post-processing tools, too (e.g., opreport, opannotate). >>>>> root@picocpe:~# opcontrol --callgraph=40 >>>>> root@picocpe:~# opcontrol --separate=kernel >>>>> root@picocpe:~# opcontrol --image=/root/221/rnc >>>>> root@picocpe:~# opcontrol --start >>>>> Using 2.6+ OProfile kernel interface. >>>>> Using log file /var/lib/oprofile/samples/oprofiled.log >>>>> Daemon started. >>>>> Profiler running. >>>>> >>>>> run_binary_here /root/221/rnc >>>>> >>>>> root@picocpe:~/221# opcontrol --stop >>>>> Stopping profiling. >>>>> root@picocpe:~/221# opcontrol --shutdown >>>>> Stopping profiling. >>>>> Killing daemon. >>>>> root@picocpe:~/221# opreport --callgraph >>>>> opreport error: >>>>> /var/lib/oprofile/samples/current/{root}/root/221/rnc/{dep}/{root}/root/221/rnc/TIMER.0.0.all.all.all: >>>>> Invalid argument >>>>> root@picocpe:~/221# cd ../ >>>>> root@picocpe:~# opreport --callgraph >>>>> opreport error: >>>>> /var/lib/oprofile/samples/current/{root}/root/221/rnc/{dep}/{root}/root/221/rnc/TIMER.0.0.all.all.all: >>>>> Invalid argument >>>> hmmm . . . odd, I don't see what's invalid about this. Does opreport >>>> work? >>>> >>>> -Maynard >>>>> root@picocpe:~# opreport --callgraph --session-dir=/tmp >>>>> opreport error: No sample file found: try running opcontrol --dump >>>>> or specify a session containing sample files >>>>> root@picocpe:~# cd /tmp >>>>> root@picocpe:/tmp# ls >>>>> oprofile.HiJgpB oprofile.RjLrQe oprofile.oiL4kT >>>>> root@picocpe:/tmp# ls -ls >>>>> 0 -rw------- 1 root root 0 Jan 1 00:14 >>>>> oprofile.HiJgpB >>>>> 0 -rw------- 1 root root 0 Jan 1 00:14 >>>>> oprofile.RjLrQe >>>>> 0 -rw------- 1 root root 0 Jan 1 00:13 >>>>> oprofile.oiL4kT >>>>> root@picocpe:/tmp# cd >>>>> root@picocpe:~# cd .oprofile/ >>>>> root@picocpe:~/.oprofile# ls >>>>> daemonrc >>>>> root@picocpe:~/.oprofile# more daemonrc >>>>> SESSION_DIR=/var/lib/oprofile >>>>> NR_CHOSEN=0 >>>>> SEPARATE_LIB=1 >>>>> SEPARATE_KERNEL=1 >>>>> SEPARATE_THREAD=0 >>>>> SEPARATE_CPU=0 >>>>> VMLINUX=/root/vmlinux-linux-2.6.18-picochip-2.0.4-cpe20x >>>>> IMAGE_FILTER=/root/221/rnc >>>>> CPU_BUF_SIZE=0 >>>>> CALLGRAPH=40 >>>>> XENIMAGE=none >>>>> >>>>> >>>>> Best regards, >>>>> >>>>> Arthur >>>>> >>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> >>>>> Crystal Reports - New Free Runtime and 30 Day Trial >>>>> Check out the new simplified licensing option that enables >>>>> unlimited royalty-free distribution of the report engine >>>>> for externally facing server and web deployment. >>>>> http://p.sf.net/sfu/businessobjects >>>>> >>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> _______________________________________________ >>>>> oprofile-list mailing list >>>>> opr...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/oprofile-list >>>> >>>> >> > |