From: Richard P. <rp...@rp...> - 2007-09-28 21:38:29
|
On Fri, 2007-09-28 at 18:45 +0100, John Levon wrote: > On Fri, Sep 28, 2007 at 12:24:44PM +0100, Richard Purdie wrote: > > > On smaller systems the overhead of the opcontrol scripts is not > > insignificant so I've implemented some lightweight start and stop > > commands. The idea is you'd run "opcontrol --start-daemon" to setup > > I'm confused. Can't you make an opcontrol fast path for start and stop? > What exactly is so slow? There are two ways of handling this, one is to optimise opcontrol, the other is to write the fast path directly in C. With opcontrol its shell script which has more overhead than C before you start. The number of forks or other syscalls required before it reaches the point where the trace starts is significant due to the nature of shell script and I doubt I'd ever be able to remove them all. The same applies to the stop command. Trying to optimise the shell script, there are two more potential issues: 1. Someone can easily and inadvertently introduce overhead in the future 2. The behaviour might need to change for starting and stopping to make it optimal. The opstart/opstop approach I proposed addresses both points. If you want an illustration of what I'm talking about try stracing opcontrol. The opstart/opstop commands are a *lot* cleaner... Cheers, Richard |