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

Re: [PATCH v1] tools/xentrace/xentrace_format: Add python 3 compatibility


  • To: Javi Merino <javi.merino@xxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 11 Sep 2023 14:45:56 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xiBAzcrfVe1ri4hEx1DSaJa3YaxZX0Fs1TA0n3S4yAc=; b=XIpEYGYggnq3VWFCM+ups6+iBhHOv5Abi+lvQX2NGkNqtxlduJB1TzqFneOalCJHGPi1UogBxhJAtq6kBDyTlYz8nHkzWHtENVAexenF+kRhYA11qdSbegSpaCrHTIzZEvg/H4nndnDbbavlPtZ+cZIavUr9U3tNziiwzQxUYkMo9We2pVJ9DOJ4AEiijWrwj90YOCDKmK8MMuA+fEiqzzS7dZDXViqNifmkB0cWUARPhXJnEWC/yyklQyl/ayL6hFnYsCXBSdp8q4VBrp1YpWsBDNnHq/ByK/vU1l7/TJB7rnoQTvvilPH7+1E0ujVlGmnKUCdFvedJGVMoevkxIw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GORQZO65CBf55NzcsXCvzDWaV8hrGneAsj2K1ko70gtZon9jqMPFCTCh5+fvbmWo/1fR70zsSQyJLsPV3WkC/t2GBfDv4WUBeVT/9kMpEtZmIxenqHfnTE3kUE0JKYOTASITYvtGCOsNRxH8GBJejOY6hsrSDYcvEm9g5MHU+JEgKr9opAGmy7IU/6e0Es1y+eSWnpAXQSHJRlyP1WEqGqu9xWOvdYVvtzDu5cS26j1d4YGWE7ex8diIn6GVFYezOGjIGycHEplst++XfcYJFpQDFxggetK1dPai506x9pfdc3bGX02rmhbYnbBanCE/BPOxsQZ1AaTzg0hShV6zYQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Mon, 11 Sep 2023 13:46:19 +0000
  • Ironport-data: A9a23:bWs1BKwC94sGx2+HvUV6t+cexyrEfRIJ4+MujC+fZmUNrF6WrkUPn GQWWW2Cb/jYYTOkf9olPt+w8BwAvsTXndNrSwA9rSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjPzOHvykTrecZkidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw/zF8EkHUMja4mtC5QRvPKkT5TcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KThL6 KYlCAgWUhCsmrL12JySFtA0v9t2eaEHPKtH0p1h5RfwKK9/BLrlE+DN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjiVlVIguFTuGIO9ltiibMNZhEuH4 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuiAttPT+XkqqQCbFu7+zJNLjlLRwWHhOC9jxGbRcICA k8qw397xUQ13AnxJjXnZDW6qWCF+BsRQdtWFMUx7AaQxuzf5APxLngJSHtNZcIrsOcyRCc2z RmZktXxHzttvbaJD3WH+d+8sjeaKSUTa2gYakc5oRAt5tDipMQ5iELJR9M6Saqt1ISrSHf33 iyAqzU4i/MLl8kX2q6n/FfBxTWxupzOSQ1z7QLSNo640j5EiEeeT9TAwTDmATxode51knHpU KA4pvWj
  • Ironport-hdrordr: A9a23:leidka1BQQ89zP1KqBzo5AqjBahyeYIsimQD101hICG9Kvbo8P xHnJwguiMc+wxhPk3I+OrwcZVoLkmslqKdjbN9AV7mZniDhILKFvAr0WKB+UyDJ8SWzIc0vs 1dmupFebjN5DNB4/oSlTPZLz9W+ri6Gc6T6ds2hE0dND2CI5sQlzuQ0mugYzBLrNIqP+tHKH JHi/A32wZJdRksH76G7rppZZm0m/Tb0JbtaRELCxMj8U2ShT3tsdfBYmal9wZbVzlGzrsv/G 3d1xHw6OH62svLuiP0xivW5ZxYlNftz8IGGcSDzpN9EESeti+4IIBqU7KPsD0xuaWz4Fhvyr D30mUdFtU273nYcW24rB71nxTp3nJygkWSvGOwkD/mq8T3SD42DtMEmIpWNkex0TtVgPhslK ZA122Uu5dTFFfclCry69WgbWAaqqObmwtUrQal5UYvKrcjVA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11/09/2023 2:44 pm, Javi Merino wrote:
> On Mon, Sep 11, 2023 at 11:52:43AM +0100, Andrew Cooper wrote:
>> 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().
> Ok, I will the dependency on python3 future and the old_div() for v2.

My point is that I don't think we need this dependency at all, and I
don't think you need to change this line at all.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.