xrmx / bootchart

merge of bootchart-collector and pybootchartgui
GNU General Public License v2.0
239 stars 89 forks source link

wrong paths for 64bit #1

Closed doogy closed 14 years ago

doogy commented 14 years ago

when i try to run your script n 64bit kernel i have this error:

mkdir: cannot create directory /dev/.bootchart/lib/bootchart: Not a directory cp: accessing /dev/.bootchart/lib/bootchart: Not a directory chroot: failed to run command /lib/bootchart/bootchart-collector: No such file or a directory

mmeeks commented 14 years ago

Interesting; I wonder if your mkdir doesn't understand "-p" in your initrd - perhaps you're using some cut-down shell; can you try replacing the 'mkdir -p' in bootchartd with a separate set of mkdirs ? - then re-run mkinitrd & re-test ?

Thanks.

mmeeks commented 14 years ago

I've also added some more -p pieces to master, and some fixes for 64bit jail creation it'd be great if you could try those out.

eikesauer commented 14 years ago

It turned out my bug report (issue 2) is based on the same problem. I get the same messages as doogy. When looking at these directories, this can be found:

eike@donald:~$ ls -lad /dev/.bootchart/lib drwxr-xr-x 2 root root 60 16. Apr 2010 /dev/.bootchart/lib64 eike@donald:~$ ls -l /dev/.bootchart/lib64/ insgesamt 132 -rwxr-xr-x 1 root root 123488 16. Apr 2010 ld-linux-x86-64.so.2 eike@donald:~$ ls -la /lib/bootchart/bootchart-collector -rwxr-xr-x 1 root root 12856 16. Apr 16:12 /lib64/bootchart/bootchart-collector -rwxr-xr-x 1 root root 12856 16. Apr 16:12 /lib/bootchart/bootchart-collector

This is a Debian/testing system, amd64 flavour.

eikesauer commented 14 years ago

It seems the bug tracking system stripped some "*" (asterisks) in my last remark.

eikesauer commented 14 years ago

Fortunatly, I've been hurting my leg yesterday and so had time for some investigation today. (Pavements just shouldn't have holes!) The problem is that with a 64 bit system, /dev/.bootchart/lib is not created. When creating it when creating lib64, I get a valid bootchart. But... see next issue. :o)

eikesauer commented 14 years ago

...so instead of doing "mkdir -p $JAIL/lib" only on 32 bit systems, you'll have to do it for 64 bit systems as well:

if [ "uname -m" = "x86_64" ] then mkdir -p $JAIL/lib64 cp /lib64/ld-linux-x86-64.so.* /lib64/libc.so.* $JAIL/lib64 else mkdir -p $JAIL/lib cp /lib/ld-linux.so.* /lib/libc.so.* $JAIL/lib fi

...becomes...

mkdir -p $JAIL/lib if [ "uname -m" = "x86_64" ] then mkdir -p $JAIL/lib64 cp /lib64/ld-linux-x86-64.so.* /lib64/libc.so.* $JAIL/lib64 else cp /lib/ld-linux.so.* /lib/libc.so.* $JAIL/lib fi

mmeeks commented 14 years ago

Thanks so much for the fixes. I got so annoyed with the chroot creation - which is a real pain. That I created a new way to extract log information, that should not require a chroot [ why did it anyway ? ].

I've committed that to master; if you could install that & have a go - it would be -much- appreciated :-)

Thanks.

eikesauer commented 14 years ago

Somethings seems to go wrong with the new code on my system (Debian (mostly) Testing AMD64). This is what I get at the end of the bootup messages...

bootchart-collector started with 3 args: '--dump' '/tmp/bootchart.mIQM5t56L7' Extracting profile data from pid 553 map 0x7fff108fe000 -> 0x7fff10913000 size: 84k from '7fff108fe000' '7fff10913000' 21 chunks type: 'proc_stat.log' len 131000 type: 'proc_diskstats.log' len 131000 type: 'taskstats.log' len 64547 type: 'cmdline.log' len 18692 type: 'proc_stat.log' len 131000 type: 'proc_diskstats.log' len 131000 type: 'proc_stat.log' len 131000 type: 'proc_diskstats.log' len 131000 type: 'proc_stat.log' len 131000 type: 'proc_stat.log' len 131000 type: 'proc_diskstats.log' len 131000 type: 'proc_stat.log' len 131000 type: 'proc_diskstats.log' len 131000 type: 'proc_stat.log' len 131000 type: 'proc_diskstats.log' len 131000 type: 'proc_stat.log' len 131000 type: 'proc_stat.log' len 131000 type: 'proc_diskstats.log' len 131000 type: 'proc_stat.log' len 131000 type: 'proc_diskstats.log' len 97015 type: 'proc_stat.log' len 71429 umount /lib/bootchart/tmpfs/proc: Device or resource busy bootchart-collector unmounted proc / clean exit umount /lib/bootchart/tmpfs: Device or resource busy Can't extract boot chart from collector /sbin/bootchartd: line 52: 553 Killed /lib/bootchart/bootchart-collector

No file /var/log/bootchart.tgz is created.

mmeeks commented 14 years ago

Hah ! all the hard work was done nicely, but then we stuffed it up with an irrelevant error return value in this state.

commit 9ce3a731d9895d5f6cbde2f5ffad2f4a87aeee6f Author: Michael Meeks michael.meeks@novell.com Date: Tue May 18 12:45:40 2010 +0100

don't return an (irrelevant) error status when dumping, if we can't
unmount the procfs (etc.) ourselves (yet).

fixes this (pushed to master).

Thanks for the report !

Also - it appears you do not have CONFIG_TASKSTATS enabled in your kernel - or there would be a 'taskstats.log' file in there. To get a higher res chart, you should try that.

Thanks.

eikesauer commented 14 years ago

I tried it yesterday. We're one step further, I've got a /var/log/bootchart.tgz, but pybootchartgui won't show it. The output is as follows...

No path given, trying /var/log/bootchart.tgz parsing '/var/log/bootchart.tgz' parsing 'header' parsing 'dmesg' parsing 'cmdline2.log' Traceback (most recent call last): File "/usr/bin/pybootchartgui", line 23, in sys.exit(main()) File "/usr/lib/pymodules/python2.5/pybootchartgui/main.py", line 114, in main options.crop_after, options.annotate) File "/usr/lib/pymodules/python2.5/pybootchartgui/parsing.py", line 536, in parse state = parse_paths(writer, ParserState(), paths) File "/usr/lib/pymodules/python2.5/pybootchartgui/parsing.py", line 456, in parse_paths state = _do_parse(writer, state, name, tf.extractfile(name)) File "/usr/lib/pymodules/python2.5/pybootchartgui/parsing.py", line 422, in _do_parse state.cmdline = _parse_cmdline(writer, file) File "/usr/lib/pymodules/python2.5/pybootchartgui/parsing.py", line 365, in _parse_cmdline pid = float(lines[0]) ValueError: empty string for float()

I've put my data here: http://user.cs.tu-berlin.de/~eikes/debian/bootchart-20-05.tgz

mmeeks commented 14 years ago

I've tweaked it to overcome the bug ( it seems that some processes have empty arguments - ie. the app is not arg[0] ) and were not coping with that well.

I've pushed a commit; that should let you see the (manually cleaned up) chart at: http://www.gnome.org/~michael/foo.tgz.

I'll do some more parsing robustness work now I think :-)

Thanks.

eikesauer commented 14 years ago

Thanks for your work! After I downloaded a newer version (23. May, I think), I finally get a bootchart with an out-of-the-box version of bootchart 2 on a 64 bit system!

mmeeks commented 14 years ago

Wonderful :-) thanks for the encouragement. Now you can help find all the other rendering, collection and accuracy bugs ;->