From: Maynard J. <may...@us...> - 2009-05-08 23:49:10
|
Andi Kleen wrote: > I had some problems with opcontrol claiming a daemon was running > when it wasn't. I think that was due to reused PIDs. > This patch adds a common shell subfunction to check for the daemon > running and always checks if its process name contains oprofiled. [snip] > do_dump_data() > { > # make sure that the daemon is not dead and gone > - if test -e "$SESSION_DIR/lock"; then > - OPROFILED_PID=`cat $SESSION_DIR/lock` > - if test ! -d "/proc/$OPROFILED_PID"; then > - echo "dump fail: daemon died during last run ?" >&2 > - return 1; > - fi > - else > + if ! daemon_running ; then > + echo "dump fail: daemon died during last run ?" >&2 > return 1; BUG! If you stop the daemon and then happen to run any opcontrol command that does do_dump_data (deinit, stop, shutdown all do an implicit dump), you get this "dump fail" message. I agree with the general idea of the change, but I think we'll wait on accepting this patch (once the "dump fail" problem is fixed) until after we release 0.9.5. I'd rather have the community bang on it for a while before putting it in a release. Thanks. -Maynard > fi > |