qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 01/14] cpu-timers, icount: new modules


From: Richard Henderson
Subject: Re: [PATCH v5 01/14] cpu-timers, icount: new modules
Date: Fri, 14 Aug 2020 13:20:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 8/12/20 11:32 AM, Claudio Fontana wrote:
> +/*
> + * Return the icount enablement state:
> + *
> + * 0 = Disabled - Do not count executed instructions.
> + * 1 = Enabled - Fixed conversion of insn to ns via "shift" option
> + * 2 = Enabled - Runtime adaptive algorithm to compute shift
> + */
> +int icount_enabled(void);

Why does use_icount need to change to a function?

If it does, or even if this just comes under the heading of cleanup, it should
certainly be done in a separate patch.

Either way, I think we should expose the fact that this is always disabled when
#ifndef CONFIG_TCG, just like we do for tcg_enabled().

> -        if (use_icount) {
> -            return cpu_get_icount();
> +        if (icount_enabled()) {
> +            return icount_get();

Renaming of other functions like this should also be done in a separate patch.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]