Skip to contentSkip to conversation

docs: trace: Convert decode_msr.py print syntax to python3

PATCH In review Rong Tao 3 participants 4 messages Jun 21, 2023 – Jun 25, 2023 Documentation

lore
Share & tools
lore

Rong Tao

author
#0 lore raw

PATCH 1/1 docs: trace: Convert decode_msr.py print syntax to python3

From: Rong Tao <[email protected]>

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=" ")?

---
 Documentation/trace/postprocess/decode_msr.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/trace/postprocess/decode_msr.py +1 -1
index aa9cc7abd5c2..2d45d6c14987 100644
@@ -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 + ",")
 
 
Signature · 1 line
2.39.3
maintainer
#1 lore raw

[Adding Andi]

Quoted 21 lines · Rong Tao

From: Rong Tao <[email protected]>

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=" ")?

---
 Documentation/trace/postprocess/decode_msr.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/trace/postprocess/decode_msr.py +0 -0
index aa9cc7abd5c2..2d45d6c14987 100644

Documentation/trace/postprocess/decode_msr.py for j in sys.stdin: · line 35

Quoted 5 lines
Documentation/trace/postprocess/decode_msr.py +1 -1
@@ -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

author
#2 lore raw

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.

#3 lore raw
Quoted 2 lines · Rong Tao

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