[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Remove line buffering from log file
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH] Remove line buffering from log file |
Date: |
Thu, 29 Sep 2011 20:11:00 +0000 |
On Thu, Sep 29, 2011 at 7:57 AM, Peter Maydell <address@hidden> wrote:
> On 29 September 2011 06:03, Peter Chubb <address@hidden> wrote:
>> Stefan> That's the reason why line buffering is needed today. I
>> Stefan> enable log file output to see what happened last before the
>> Stefan> crash.
>>
>> Thanks for this, I didn't think of this use-case. I don't think I've
>> ever seen a qemu crash that wasn't caused by something really obvious.
>
> You don't need the logging for the obvious ones :-)
>
>> abort() already flushes all open streams. So only signals that cause
>> immediate death are a problem: SIGSEGV is the obvious one. If its
>> handler called abort() then that would flush too. abort() is
>> guaranteed by the POSIX spec to be callable from a signal handler.
>
> Catching SIGSEGV is likely to interact badly with the signal
> handling in linux-user mode, I expect.
>
>> Stefan> Speed is not the primary target when somebody runs qemu -d ...
>>
>> It is if it takes hours to reach the problem that causes
>> the abort(). Speeding up by an order of magnitude is worth it.
>
> One tactic I've found useful in these cases is to run without
> logging up to nearly the point where things fail, and then
> do a savevm. Then you can loadvm on a qemu with logging enabled
> and only look at the section of execution that causes the problem.
This sounds like it should be possible to enable and disable logging
during run time.
The performance could be improved by taking a trace point like
approach, where all possible processing is postponed to outside
process. Guest and host code disassembly and op printout could be left
to postprocessing, the logs should contain only binary data.