[Backport,for,4.14] perf script python: Remove explicit shebang from tests/attr.c

Message ID 3ca0515edb717e0f394f973f3cbbe2c80abb35e4.1671190496.git.christophe.leroy@csgroup.eu
State New
Headers
Series [Backport,for,4.14] perf script python: Remove explicit shebang from tests/attr.c |

Commit Message

Christophe Leroy Dec. 16, 2022, 11:38 a.m. UTC
  From: Tony Jones <tonyj@suse.de>

[Upstream commit d72eadbc1d2866fc047edd4535ffb0298fe240be]

tests/attr.c invokes attr.py via an explicit invocation of Python
($PYTHON) so there is therefore no need for an explicit shebang.

Also most distros follow pep-0394 which recommends that /usr/bin/python
refer only to v2 and so may not exist on the system (if PYTHON=python3).

Signed-off-by: Tony Jones <tonyj@suse.de>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20190124005229.16146-5-tonyj@suse.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 tools/perf/tests/attr.py | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Greg KH Dec. 19, 2022, 12:18 p.m. UTC | #1
On Fri, Dec 16, 2022 at 12:38:12PM +0100, Christophe Leroy wrote:
> From: Tony Jones <tonyj@suse.de>
> 
> [Upstream commit d72eadbc1d2866fc047edd4535ffb0298fe240be]
> 
> tests/attr.c invokes attr.py via an explicit invocation of Python
> ($PYTHON) so there is therefore no need for an explicit shebang.
> 
> Also most distros follow pep-0394 which recommends that /usr/bin/python
> refer only to v2 and so may not exist on the system (if PYTHON=python3).
> 
> Signed-off-by: Tony Jones <tonyj@suse.de>
> Acked-by: Jiri Olsa <jolsa@kernel.org>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
> Cc: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
> Link: http://lkml.kernel.org/r/20190124005229.16146-5-tonyj@suse.de
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  tools/perf/tests/attr.py | 1 -
>  1 file changed, 1 deletion(-)

Why only 4.14?  What about 4.19?

thanks,

greg k-h
  
Christophe Leroy Dec. 19, 2022, 12:21 p.m. UTC | #2
Le 19/12/2022 à 13:18, Greg KH a écrit :
> On Fri, Dec 16, 2022 at 12:38:12PM +0100, Christophe Leroy wrote:
>> From: Tony Jones <tonyj@suse.de>
>>
>> [Upstream commit d72eadbc1d2866fc047edd4535ffb0298fe240be]
>>
>> tests/attr.c invokes attr.py via an explicit invocation of Python
>> ($PYTHON) so there is therefore no need for an explicit shebang.
>>
>> Also most distros follow pep-0394 which recommends that /usr/bin/python
>> refer only to v2 and so may not exist on the system (if PYTHON=python3).
>>
>> Signed-off-by: Tony Jones <tonyj@suse.de>
>> Acked-by: Jiri Olsa <jolsa@kernel.org>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
>> Cc: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
>> Link: http://lkml.kernel.org/r/20190124005229.16146-5-tonyj@suse.de
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>>   tools/perf/tests/attr.py | 1 -
>>   1 file changed, 1 deletion(-)
> 
> Why only 4.14?  What about 4.19?
> 


I submitted that backport because I encountered the problem while 
building perf for 4.14.

I didn't look at other kernel versions.

Christophe
  
Greg KH Dec. 19, 2022, 12:42 p.m. UTC | #3
On Mon, Dec 19, 2022 at 12:21:47PM +0000, Christophe Leroy wrote:
> 
> 
> Le 19/12/2022 à 13:18, Greg KH a écrit :
> > On Fri, Dec 16, 2022 at 12:38:12PM +0100, Christophe Leroy wrote:
> >> From: Tony Jones <tonyj@suse.de>
> >>
> >> [Upstream commit d72eadbc1d2866fc047edd4535ffb0298fe240be]
> >>
> >> tests/attr.c invokes attr.py via an explicit invocation of Python
> >> ($PYTHON) so there is therefore no need for an explicit shebang.
> >>
> >> Also most distros follow pep-0394 which recommends that /usr/bin/python
> >> refer only to v2 and so may not exist on the system (if PYTHON=python3).
> >>
> >> Signed-off-by: Tony Jones <tonyj@suse.de>
> >> Acked-by: Jiri Olsa <jolsa@kernel.org>
> >> Cc: Jonathan Corbet <corbet@lwn.net>
> >> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
> >> Cc: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
> >> Link: http://lkml.kernel.org/r/20190124005229.16146-5-tonyj@suse.de
> >> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> >> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> >> ---
> >>   tools/perf/tests/attr.py | 1 -
> >>   1 file changed, 1 deletion(-)
> > 
> > Why only 4.14?  What about 4.19?
> > 
> 
> 
> I submitted that backport because I encountered the problem while 
> building perf for 4.14.
> 
> I didn't look at other kernel versions.

In the future, remember that we can not add fixes to an older version
and not a newer one, otherwise you would have a regression moving to a
newer kernel.

thanks,

greg k-h
  

Patch

diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
index 6c68435585c7..3e07eee33b10 100644
--- a/tools/perf/tests/attr.py
+++ b/tools/perf/tests/attr.py
@@ -1,4 +1,3 @@ 
-#! /usr/bin/env python
 # SPDX-License-Identifier: GPL-2.0
 
 import os