[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f78e394-9cc3-e3fc-0497-d0ff0216d331@suse.de>
Date: Fri, 18 Jan 2019 17:12:01 -0800
From: Tony Jones <tonyj@...e.de>
To: Seeteena Thoufeek <s1seetee@...ux.vnet.ibm.com>,
peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
namhyung@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] perf scripts python: Add Python 3 support to
failed-syscalls-by-pid.py
On 1/17/19 1:45 AM, Seeteena Thoufeek wrote:
> +from __future__ import print_function
You don't need this unless you're actually requiring functionality that only exists in v3.
For example, you need it to handle the suppress newline functionality such as "end=".
> def print_error_totals():
> if for_comm is not None:
> - print "\nsyscall errors for %s:\n\n" % (for_comm),
> + print("\nsyscall errors for %s:\n\n" % (for_comm)),
> else:
> - print "\nsyscall errors:\n\n",
> + print("\nsyscall errors:\n\n"),
>
> - print "%-30s %10s\n" % ("comm [pid]", "count"),
> - print "%-30s %10s\n" % ("------------------------------", \
> - "----------"),
> + print("%-30s %10s\n" % ("comm [pid]", "count")),
> + print("%-30s %10s\n" % ("------------------------------", \
> + "----------")),
Same comments as before regarding trailing comma for function.
See: https://build.opensuse.org/package/view_file/devel:tools/perf/port-failed-syscalls-by-pid-script-to-python3.patch?expand=1
Powered by blists - more mailing lists