LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: trace: Convert decode_msr.py print syntax to python3
@ 2023-06-21  7:44 Rong Tao
  2023-06-21 15:14 ` Jonathan Corbet
  0 siblings, 1 reply; 4+ messages in thread
From: Rong Tao @ 2023-06-21  7:44 UTC (permalink / raw
  To: corbet; +Cc: rongtao, open list:DOCUMENTATION, open list

From: Rong Tao <rongtao@cestc.cn>

Convert the decode_msr.py file to python3 to solve the following running
errors:

    File "Documentation/trace/postprocess/decode_msr.py", line 35
        print j,
             ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean
    print(j, end=" ")?

Signed-off-by: Rong Tao <rongtao@cestc.cn>
---
 Documentation/trace/postprocess/decode_msr.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/trace/postprocess/decode_msr.py b/Documentation/trace/postprocess/decode_msr.py
index aa9cc7abd5c2..2d45d6c14987 100644
--- a/Documentation/trace/postprocess/decode_msr.py
+++ b/Documentation/trace/postprocess/decode_msr.py
@@ -32,6 +32,6 @@ for j in sys.stdin:
 					break
 		if r:
 			j = j.replace(" " + m.group(2), " " + r + "(" + m.group(2) + ")")
-	print j,
+	print(j + ",")
 
 
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: trace: Convert decode_msr.py print syntax to python3
  2023-06-21  7:44 [PATCH] docs: trace: Convert decode_msr.py print syntax to python3 Rong Tao
@ 2023-06-21 15:14 ` Jonathan Corbet
  2023-06-25  1:03   ` Rong Tao
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Corbet @ 2023-06-21 15:14 UTC (permalink / raw
  To: Rong Tao; +Cc: rongtao, open list:DOCUMENTATION, open list, Andi Kleen

[Adding Andi]

Rong Tao <rtoax@foxmail.com> writes:

> From: Rong Tao <rongtao@cestc.cn>
>
> Convert the decode_msr.py file to python3 to solve the following running
> errors:
>
>     File "Documentation/trace/postprocess/decode_msr.py", line 35
>         print j,
>              ^
>     SyntaxError: Missing parentheses in call to 'print'. Did you mean
>     print(j, end=" ")?
>
> Signed-off-by: Rong Tao <rongtao@cestc.cn>
> ---
>  Documentation/trace/postprocess/decode_msr.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/trace/postprocess/decode_msr.py b/Documentation/trace/postprocess/decode_msr.py
> index aa9cc7abd5c2..2d45d6c14987 100644
> --- a/Documentation/trace/postprocess/decode_msr.py
> +++ b/Documentation/trace/postprocess/decode_msr.py
> @@ -32,6 +32,6 @@ for j in sys.stdin:
>  					break
>  		if r:
>  			j = j.replace(" " + m.group(2), " " + r + "(" + m.group(2) + ")")
> -	print j,
> +	print(j + ",")

So I certainly have no problem applying this.  But it occurs to me that
this file hasn't been touched since it was added in 2015, and nobody has
complained that it doesn't work with modern Python.  That leads me to
wonder if it's being used at all.

Assuming that there is value in keeping it, I wonder if a move to
samples/ might make sense?

Thanks,

jon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: trace: Convert decode_msr.py print syntax to python3
  2023-06-21 15:14 ` Jonathan Corbet
@ 2023-06-25  1:03   ` Rong Tao
  2023-06-25 14:57     ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Rong Tao @ 2023-06-25  1:03 UTC (permalink / raw
  To: corbet; +Cc: ak, linux-doc, linux-kernel, rongtao, rtoax

Thanks for your reply, jon. How about i submit v2 to remove decode_msr.py
totally?

Do the two remaining perl scripts need to be removed?

    - Documentation/trace/postprocess/trace-pagealloc-postprocess.pl
    - Documentation/trace/postprocess/trace-vmscan-postprocess.pl

Thanks,

Rong Tao.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs: trace: Convert decode_msr.py print syntax to python3
  2023-06-25  1:03   ` Rong Tao
@ 2023-06-25 14:57     ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2023-06-25 14:57 UTC (permalink / raw
  To: Rong Tao; +Cc: corbet, linux-doc, linux-kernel, rongtao

On Sun, Jun 25, 2023 at 09:03:57AM +0800, Rong Tao wrote:
> Thanks for your reply, jon. How about i submit v2 to remove decode_msr.py
> totally?

Well only if you can explain how the MSR tracer should be used without
it?

Not sure I understand the whole discussion here.


-Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-25 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21  7:44 [PATCH] docs: trace: Convert decode_msr.py print syntax to python3 Rong Tao
2023-06-21 15:14 ` Jonathan Corbet
2023-06-25  1:03   ` Rong Tao
2023-06-25 14:57     ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).