On 06/09/2023 2:14 pm, Javi Merino wrote:
> diff --git a/tools/xentrace/xentrace_format b/tools/xentrace/xentrace_format
> index 5ff85ae2e8..166ebae325 100644
> --- a/tools/xentrace/xentrace_format
> +++ b/tools/xentrace/xentrace_format
> @@ -4,11 +4,15 @@
>  
>  # Program for reformatting trace buffer output according to user-supplied 
> rules
>  
> +from __future__ import division
> +from __future__ import print_function
> +from __future__ import unicode_literals
> +from builtins import str
> +from past.utils import old_div

This adds a new dependency on a package we (upstream Xen) don't
currently use.  AFAICT, it's only for...

> @@ -223,7 +232,7 @@ while not interrupted:
>              last_tsc[cpu] = tsc
>  
>          if mhz:
> -            tsc = tsc / (mhz*1000000.0)
> +            tsc = old_div(tsc, (mhz*1000000.0))

... this, which is always int / float and doesn't fall into Py2's
int/int behaviour in the first place.

I'm pretty sure the code can just stay as it is, without needing to use
old_div().

~Andrew

Reply via email to