]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools/rtla: Improve exception handling in timerlat_load.py
authorfurkanonder <furkanonder@protonmail.com>
Mon, 21 Oct 2024 15:13:57 +0000 (15:13 +0000)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 19 Nov 2024 13:57:13 +0000 (08:57 -0500)
commit4d8c1ba0790b4341a58e2042810a952c62df06e9
treea77f9407ed7947ff34aeb0467f0ad3706ffd14f6
parentbd26818343dc02936a4f2f7b63368d5e1e1773c8
tools/rtla: Improve exception handling in timerlat_load.py

The enhancements made to timerlat_load.py are intended to improve the script's exception handling.

Summary of the changes:
  - Specific exceptions are now caught for CPU affinity and priority
    settings, with clearer error messages provided.
  - The timerlat file descriptor opening now includes handling for
    PermissionError and OSError, with informative messages.
  - In the infinite loop, generic exceptions have been replaced with
    specific types like KeyboardInterrupt and IOError, improving feedback.

 Before:
    $ sudo python timerlat_load.py 122
    Error setting affinity
 After:
    $ sudo python timerlat_load.py 122
    Error setting affinity: [Errno 22] Invalid argument

 Before:
    $ sudo python timerlat_load.py 1 -p 950
    Error setting priority
 After:
    $ sudo python timerlat_load.py 1 -p 950
    Error setting priority: [Errno 22] Invalid argument

 Before:
    $ python timerlat_load.py 1
    Error opening timerlat fd, did you run timerlat -U?
 After:
    $ python timerlat_load.py 1
    Permission denied. Please check your access rights.

Cc: "lgoncalv@redhat.com" <lgoncalv@redhat.com>
Cc: "jkacur@redhat.com" <jkacur@redhat.com>
Link: https://lore.kernel.org/Q_k1s4hBtUy2px8ou0QKenjEK2_T_LoV8IxAE79aBakBogb-7uHp2fpET3oWtI1t3dy8uKjWeRzQOdKNzIzOOpyM4OjutJOriZ9TrGY6b-g=@protonmail.com
Signed-off-by: Furkan Onder <furkanonder@protonmail.com>
Reviewed-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
tools/tracing/rtla/sample/timerlat_load.py