lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <98c8deb4-e078-82cf-ec5b-372274f5fc9d@suse.de>
Date:   Fri, 18 Jan 2019 16:53:30 -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
 syscall-counts-by-pid.py

On 1/17/19 1:45 AM, Seeteena Thoufeek wrote:

> -	    print "\nsyscall events for %s:\n\n" % (for_comm),
> +	    print("\nsyscall events for %s:\n\n" % (for_comm)),
>      else:
> -	    print "\nsyscall events by comm/pid:\n\n",
> +	    print("\nsyscall events by comm/pid:\n\n"),
>  
> -    print "%-40s  %10s\n" % ("comm [pid]/syscalls", "count"),
> -    print "%-40s  %10s\n" % ("----------------------------------------", \
> -                                 "----------"),
> +    print("%-40s  %10s\n" % ("comm [pid]/syscalls", "count")),
> +    print("%-40s  %10s\n" % ("----------------------------------------", \
> +                                 "----------")),

Is the 'print (x),' [trailing comma] syntax valid for function syntax?

Print "x", in Py2 means suppress the trailing newline.

You need to actually run the scripts (old,  new PYTHON=python2, new PYTHON=python3) and compare the output.

This:
print "%-40s  %10s\n" % ("comm [pid]/syscalls", "count"),

can be reworked as:
print ("%-40s  %10s" % ("comm [pid]/syscalls", "count"))


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ