[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: high cpu usage in idle state
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: high cpu usage in idle state |
Date: |
Sun, 19 Sep 2021 20:46:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
On 9/19/21 20:06, Peter Maydell wrote:
> On Sat, 18 Sept 2021 at 09:12, Ali Vatankhah <alivatankhah72@gmail.com> wrote:
>> then to check what instructions are executing I run this command:
>>
>> qemu-system-ppc64 -nographic -M ppce500 -cpu e5500 -kernel uImage
>> -singlestep -d in_asm -D target_asm.log
>>
>> Obviously this results in a Kernel panic, but the point is that after panic
>> there is no guest
>> instruction running as there is no more log in the file but still CPU usage
>> is 100.
>
> The lack of further in_asm logging does not mean that guest instructions
> are not running. in_asm logging happens at *translate* time,
> which is to say the first time QEMU encounters any particular instruction.
> After translation, QEMU can re-execute the translated code for that
> instruction many times, and it will not show up in in_asm logs again.
> In particular, if the guest CPU is doing either of:
> * a tight loop
> * an infinite loop of taking exceptions
> it will just be re-running code that has been seen before.
> Probably the code the kernel runs after it panic()s is just a loop.
>
> If you want to log execution, you need to add 'exec' and/or 'cpu' to
> your -d logging. (Warning: this can generate a lot of logging output
> and massively slow down execution as a result.)
In the "infinite loop exception" case, '-d int' might be sufficient,
before using 'exec/cpu', since you'll see the exception raise over
and over.
>> also run this command to check generated host assembly code:
>>
>> qemu-system-ppc64 -nographic -M ppce500 -cpu e5500 -kernel uImage
>> -singlestep -d out_asm -D host_asm.log
>
> out_asm also is logged only at translate time, not at execution time.
>
> -- PMM
>