Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 416153

Summary: app-benchmarks/bootchart2 - /sbin/bootchartd requires initrd=/sbin/bootchartd
Product: Gentoo Linux Reporter: Jesús Guerrero Botella (RETIRED) <i92guboj>
Component: New packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: gef.kornflakes, pacho
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: The graph
The logs from which the graph is born

Description Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-15 21:43:48 UTC
I am giving bootchart2 a try and I carefully seeked the instructions in the README file.

I added this to my kernel line:

    initcall_debug printk.time=y quiet init=/sbin/bootchartd

I made sure CONFIG_PROC_EVENTS=y and CONFIG_TASKSTATS=y were in my kernel, and yes, I am running the right kernel.

I have a fairly simple setup, and want to keep it that way. I don't use a randisk, dracut, or any other fanciness at all. I log in using mingetty.

I also added the bootchart2 service to the default runlevel, via rc-update.

Then I rebooted, and way my init complaining that bootchart wasn't found, so it couldn't be scheduled for removal (which I guess is the purpose of the bootchart2 "daemon", to calle it something).

I edited the /etc/init.d/bootchart2 file, and found this:

start() {
        if /bin/grep -q "rdinitrd=/sbin/bootchartd" /proc/cmdline; then
                if /bin/pidof bootchart-collector> /dev/null 2>&1; then
                        ebegin "Scheduling termination of Bootchart"
                        /sbin/bootchartd start
                        /sbin/bootchartd wait &
                        eend $?
                fi
        else
                einfo "No bootchart process found!"
                eindent
                einfo "This script does not start bootchart, but only schedules its termination."
                einfo "Bootchart should be started from the kernel command line."
                einfo "Please check the README on how to do that."
                eoutdent
                eend 0
        fi
}

Which, obviously enough, only cares about one case (the initrd one) forgetting about the rest of us. Well, that can be cured easily, by changing the if sentence this way:

        if /bin/grep -q "rdinitrd=/sbin/bootchartd\|init=/sbin/bootchartd" /proc/cmdline; then

Simple enough. Now, init doesn't complain. Still, bootchart doesn't do anything:

$ pybootchartgui 
No path given, trying /var/log/bootchart.tgz
warning: path '/var/log/bootchart.tgz' does not exist, ignoring.
Parse error: empty state: '/var/log/bootchart.tgz' does not contain a valid bootchart

Strangely enough, I have a lot of related processes running, I don't know if that's to be expected, it seems weird to me:

$ ps aux | grep bootchart
root      1330  0.0  0.0  20200   752 ?        S    23:29   0:00 /bin/bash /sbin/bootchartd
root      1331  0.0  0.0  20200   928 ?        S    23:29   0:00 /bin/bash /sbin/bootchartd
root      1333  4.4  7.5 141460 135784 ?       S    23:29   0:32 /lib/bootchart/bootchart-collector 50
root      2158  0.0  0.0  13372  1660 ?        S    23:29   0:00 /bin/bash /sbin/bootchartd wait
root      5908  0.0  0.0   6260   496 ?        S    23:41   0:00 /lib/bootchart/bootchart-collector --usleep 1000000
root      5910  0.0  0.0   6260   500 ?        S    23:41   0:00 /lib/bootchart/bootchart-collector --usleep 1000000
i92guboj  5912  0.0  0.0   8372   996 pts/3    S+   23:41   0:00 grep --colour=auto bootchart

Where should I go from here? I report this here because for the look of that if sentence I already know that the implementation of this package in Gentoo is buggy, and I don't want to report upstream a bug that's been introduced by Gentoo (I am not saying it's the case, I am saying I want to make sure first).



Reproducible: Always
Comment 1 Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-15 22:28:16 UTC
Changing /etc/bootchartd.conf this way:

BOOTLOG_DEST=/bootchart.tgz
AUTO_RENDER_DIR="/"
EXIT_PROC="kdm_greet xterm konsole gnome-terminal metacity mutter compiz ldm icewm-session enlightenment mingetty" ## added mingetty here

Seems to aware the thing when I log in, some messages are printed in the terminal and I can see this file being created. However if I use pybootchart on it it generates an empty graph, not strange considering that most log files in the tarball are also empty.

It's worth noting that /var is a separate partition.

Time to sleep. Enough for today.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-05-16 03:04:40 UTC
Er, huh?
Comment 3 Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-16 05:35:33 UTC
I am not sure all the problem is it requiring initrd. As I say, I modified the init script to contemplate the non-initrd case, and it starts, but produces empty output. Something is highly broken in this package, or there's some extra configuration needed that's not described in the README file nor in the elogs/ewarns or whatever they are.

As weird as it might seem, the previous "doesn't do anything" title was more accurate :P
Comment 4 Justin Lecher (RETIRED) gentoo-dev 2012-05-16 07:08:56 UTC
So I played around some time until I got the init script fixed. As far as can remember setting it to only rdinitrd=/sbin/bootchartd was enough, but I cannot remember why. I will look into the issue and see what is wrong here.
Comment 5 Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-16 07:33:34 UTC
(In reply to comment #4)
> So I played around some time until I got the init script fixed. As far as
> can remember setting it to only rdinitrd=/sbin/bootchartd was enough, but I
> cannot remember why. I will look into the issue and see what is wrong here.

Well, that will match any kernel line that uses an initrd, which surely is ok for a lot of gentoo users since the Gentoo way is genkernel, and that puts an initrd by default (doesn't it?), but I am sure that a very significant user base still installs their kernel by hand and do not use genkernel.

In any case, not supporting the non-initrd systems is not only against this user base, but also against what the distributed README file says, which is confusing.

In any case, my problem is not the init script failing any longer, since I already took care of that. My problem is that bootchart2 doesn't produce any output.

Could it have something to do with the fact that /var is a separate partition that's not mounted when init starts? I tried setting the paths to /, as I told you above, however the output is still a blank graph. I can send you the tgz file later if you think it will help.
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2012-05-16 07:39:00 UTC
(In reply to comment #5)
> Well, that will match any kernel line that uses an initrd, which surely is
> ok for a lot of gentoo users since the Gentoo way is genkernel, and that

If I remember correctly, it is only necessary for initrd users. Other users don't need that part of the init script. But I need to investigate it again. I can remember I put in both options, but removed it later.

> In any case, my problem is not the init script failing any longer, since I
> already took care of that. My problem is that bootchart2 doesn't produce any
> output.
> Could it have something to do with the fact that /var is a separate
> partition that's not mounted when init starts? I tried setting the paths to

That might be related. I will look into it. 

> /, as I told you above, however the output is still a blank graph. I can
> send you the tgz file later if you think it will help.

I will contact you in case I need more information
Comment 7 Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-16 07:51:21 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Well, that will match any kernel line that uses an initrd, which surely is
> > ok for a lot of gentoo users since the Gentoo way is genkernel, and that
> 
> If I remember correctly, it is only necessary for initrd users. Other users
> don't need that part of the init script. But I need to investigate it again.
> I can remember I put in both options, but removed it later.

That could very well be. I am thinking that maybe the problem is that I don't use any standard login program. I modified the conf file at the same time to put the path in / and to add mingetty to the list of programs to wait for. So, maybe what did the thing was the mingetty addition, and not the change to /.

So, is bootchart2 supposed to write the log files when this wait for the login screen ends without the need for the terminator daemon?

> > In any case, my problem is not the init script failing any longer, since I
> > already took care of that. My problem is that bootchart2 doesn't produce any
> > output.
> > Could it have something to do with the fact that /var is a separate
> > partition that's not mounted when init starts? I tried setting the paths to
> 
> That might be related. I will look into it. 

I think I can also do some tests remotely. 

Thanks you.
Comment 8 Justin Lecher (RETIRED) gentoo-dev 2012-05-16 07:58:08 UTC
(In reply to comment #7)
> So, is bootchart2 supposed to write the log files when this wait for the
> login screen ends without the need for the terminator daemon?
Please try to add a terminator trigger into

/etc/bootchartd.conf:
EXIT_PROC="...."

For the rest we need to wait until tonight.
Comment 9 Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-16 10:55:35 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > So, is bootchart2 supposed to write the log files when this wait for the
> > login screen ends without the need for the terminator daemon?
> Please try to add a terminator trigger into
> 
> /etc/bootchartd.conf:
> EXIT_PROC="...."
> 
> For the rest we need to wait until tonight.

I tried to remotely reboot the machine and something failed, I can ping it but ssh doesn't respond for some reason. So, I won't be able to do anything either until I arrive home tonight.
Comment 10 Christian Ruppert (idl0r) gentoo-dev 2012-05-16 18:09:12 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > So, is bootchart2 supposed to write the log files when this wait for the
> > login screen ends without the need for the terminator daemon?
> Please try to add a terminator trigger into
> 
> /etc/bootchartd.conf:
> EXIT_PROC="...."
> 
> For the rest we need to wait until tonight.

agetty should be fine. Should be even default IMHO.
Comment 11 Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-16 20:32:48 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > So, is bootchart2 supposed to write the log files when this wait for the
> > login screen ends without the need for the terminator daemon?
> Please try to add a terminator trigger into
> 
> /etc/bootchartd.conf:
> EXIT_PROC="...."
> 
> For the rest we need to wait until tonight.

I added mingetty into there, I also changed the location to /bootchart2/ and created that directory. Then chmoded it 777 just to be sure. I adjusted the conf file accordingly and now it seems to create something in there, however the graph is still useless. 

If I run pybootchartgui I get this:

# pybootchartgui -i bootchart.tgz 
parsing 'bootchart.tgz'
parsing 'header'
parsing 'dmesg'
parsing 'cmdline2.log'
parsing 'paternity.log'
parsing 'proc_cpuinfo.log'
parsing 'proc_diskstats.log'
parsing 'proc_meminfo.log'
parsing 'proc_stat.log'
parsing 'taskstats.log'
merged 0 logger processes
pruned 405 process, 0 exploders, 0 threads, and 0 runs
merged 0 logger processes
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart
degenerate boot chart


I'll attach the resulting png file and the tgz.
Comment 12 Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-16 20:33:24 UTC
Created attachment 312055 [details]
The graph
Comment 13 Jesús Guerrero Botella (RETIRED) gentoo-dev 2012-05-16 20:34:17 UTC
Created attachment 312057 [details]
The logs from which the graph is born
Comment 14 Pacho Ramos gentoo-dev 2024-06-18 14:47:33 UTC
I would check again with 0.14.9-r1 version
Thanks