[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>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Mon, 11 Sep 2023 11:52:43 +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=xelWf9d6rI5cqVeQqpNe4QKfNCKLQbSwLeta34xxgx8=; b=GGLZTVsybYsLyw8VCvpJObhlq9Rzfgx8Zc34R86x3R2qB3zw0ClcEjljdFGagJzAF8r3C7zufGbprZE19pYs6gwmHrBb95wZhDouDb1Nbu/CnuCUy+nJY2VqSamqldJryK7JAPIYmPNYGLrdPxDcHE6YcfzuGcSrDxmtngKF4XYOWR0tAviVVJz13CJWIu+LEnk00wLXxsuNWrfBoA1oMBhPFPuvwK5Y4cPBlctcdAotL6beaHcygQzz5deIMr/LJEXB45OQ9mAaenhvfUSi1N4T7rAeDj/T3lJdE8gyzCxd/eE1ICgdP1KTVV9UP4WZaE4y+C0ERMdlJiBiHpQ7fA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZOtHYu5Sl4a6qv55gROCFo2zW/7yay7s8pE4P5M8WpASrMiKaoILtgEjYE7l4zYzluS0MVuVYCzEFamIJvg6Z3YyEmg3rdT4TL2xJKxz+jj+gCkszbI1FE3UcXhTWPyfOWlLFaU7CFiWjktxkG7+358tZyO3IH4u5jrdidPWm40x/uEtHy5AUUO9ng4U5rAG1cM9Xb9CxTbrwDaURAOj9Vxgl0/H26XSchvyIGfvIF9cUHQK1ZTMHRlzLAdnQ8HJJhm+yToyFA5nwHeGLfgbO5kzA1WQqFI39hmDEvv9gSFtiE5Mk1MuwuraL2vTkZ3sZ+xCXLodG8xpmtHb5Psgdw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Delivery-date: Mon, 11 Sep 2023 10:53:03 +0000
- Ironport-data: A9a23:HKugD6kNvRhyBvcYlauf4bTo5gyoJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xIcDzrUbP/cMGTyLt5waN7gp00Ev8fSzodrHlM5rH9jFSMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+e6UKicfHkpGWeIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE0p5K6aVA8w5ARkPqga5QeGzBH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 cQnAyoSUgKCu+Po8K+wQfk3gMItBuC+aevzulk4pd3YJdAPZMmZBonvu5pf1jp2gd1SF/HDY cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkV03iea9WDbWUoXiqcF9t0CUv G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapLTuXprqE72Qz7Kmo7JwY4ZHqVn/2Fp2GTdvJDD 2w9pycllP1nnKCsZpynN/Gim1aGtwAdHd9dCew87ymGzq3J70CSAW1sZi5MbpkqudE7QRQu1 0SVhJX5CDp3qrqXRHmBsLCOoluaJiw9PWIEIygeQmM4D8LLpYgyilfDS4hlGavs1NntQ2iuk 3aNsTQ0gKgVgYgTzaKn8FvbgjWq4J/UUgoy4QaRVWWghu9kWLOYi0WTwQCzxZ59wEyxFDFtY FBsdxCi0d0z
- Ironport-hdrordr: A9a23:mr70zKgIr9V7Iuo0+fcttIPTznBQX8d23DAbv31ZSRFFG/FwyP rCoB1L73XJYWgqM03I+eruBEBPewK7yXcH2/h0AV7EZniahILIFvAZ0WKG+VHd8kLFh41gPM tbAtBD4ZjLfCNHZKXBkXeF+rQboOVvmZrA7Ym+854ud3ASV0gJ1XYHNu/xKDwSeOApP+tfKH PR3Lskm9L2Ek5nEvhTS0N1F9Qq4Lbw5eDbSC9DIyRixBiFjDuu5rK/Ox+E3i0GWzcK7aY+/X PDmwnZ4Lzml/2g0BfT20La8pwTwbLau5d+Lf3JrvJQBiTniw6uaogkc7qevAotqOXqxEc2nM LKqxIAOd02z3/KZGm6rTbkxgGl+jcz7H3Jz0OenBLY0IHEbQN/L/AEqZNScxPf5UZllNZg0J hT12bck5ZMFxvPkAn0+tCNDnhR5wCJiEtntdRWo21UUIMYZrMUhYsD/HlNGJNFOC7h8ogoHM RnEcmZzvdLdlGxaWzfowBUsZeRd0V2Oi3DblkJu8ST3TQTtHdlz3EAzMhapXsE/IJVcegy28 30doBT0J1eRM4faqxwQM0bR9GsN2DLSRXQdEqPPFXODsg8SjLwgq+yxI9wyPCheZQOwpd3so /GSklkuWk7fF+rIdGS3adM7gvGTAyGLHXQI/llltpEU4DHNf/W2XXpciFrryLgmYRQPiTjYY fxBHoMaMWTalcHGu5yrnnDstdpWD8jufYuy6UGsmK107P2w7LRx5zmmdboVczQ+GUfKyrCK0 pGegTPD+N9yW3uckPEoXHqKgbQkwrEjN1NLJQ=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|