Patch "tools/rtla: Enhance argument parsing in timerlat_load.py" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tools/rtla: Enhance argument parsing in timerlat_load.py

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tools-rtla-enhance-argument-parsing-in-timerlat_load.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c5b36ba98770e4996fc6a5a4b228ee76c24fe854
Author: furkanonder <furkanonder@xxxxxxxxxxxxxx>
Date:   Mon Oct 21 15:12:30 2024 +0000

    tools/rtla: Enhance argument parsing in timerlat_load.py
    
    [ Upstream commit bd26818343dc02936a4f2f7b63368d5e1e1773c8 ]
    
    The enhancements made to timerlat_load.py are aimed at improving the clarity of argument parsing.
    
    Summary of Changes:
    - The cpu argument is now specified as an integer type in the argument
      parser to enforce input validation, and the construction of affinity_mask
      has been simplified to directly use the integer value of args.cpu.
    - The prio argument is similarly updated to be of integer type for
      consistency and validation, eliminating the need for the conversion of
      args.prio to an integer, as this is now handled by the argument parser.
    
    Cc: "jkacur@xxxxxxxxxx" <jkacur@xxxxxxxxxx>
    Cc: "lgoncalv@xxxxxxxxxx" <lgoncalv@xxxxxxxxxx>
    Link: https://lore.kernel.org/QfgO7ayKD9dsLk8_ZDebkAV0OF7wla7UmasbP9CBmui_sChOeizy512t3RqCHTjvQoUBUDP8dwEOVCdHQ5KvVNEiP69CynMY94SFDERWl94=@protonmail.com
    Signed-off-by: Furkan Onder <furkanonder@xxxxxxxxxxxxxx>
    Reviewed-by: Tomas Glozar <tglozar@xxxxxxxxxx>
    Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/tracing/rtla/sample/timerlat_load.py b/tools/tracing/rtla/sample/timerlat_load.py
index 8cc5eb2d2e69e..52eccb6225f92 100644
--- a/tools/tracing/rtla/sample/timerlat_load.py
+++ b/tools/tracing/rtla/sample/timerlat_load.py
@@ -25,13 +25,12 @@ import sys
 import os
 
 parser = argparse.ArgumentParser(description='user-space timerlat thread in Python')
-parser.add_argument("cpu", help='CPU to run timerlat thread')
-parser.add_argument("-p", "--prio", help='FIFO priority')
-
+parser.add_argument("cpu", type=int, help='CPU to run timerlat thread')
+parser.add_argument("-p", "--prio", type=int, help='FIFO priority')
 args = parser.parse_args()
 
 try:
-    affinity_mask = { int(args.cpu) }
+    affinity_mask = {args.cpu}
 except:
     print("Invalid cpu: " + args.cpu)
     exit(1)
@@ -44,7 +43,7 @@ except:
 
 if (args.prio):
     try:
-        param = os.sched_param(int(args.prio))
+        param = os.sched_param(args.prio)
         os.sched_setscheduler(0, os.SCHED_FIFO, param)
     except:
         print("Error setting priority")




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux