public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: furkanonder <furkanonder@protonmail.com>
Cc: Clark Williams <williams@redhat.com>,
	"linux-trace-kernel@vger.kernel.org"
	<linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools/timerlat: Enhance Error Handling and Readability for timerlat_load.py
Date: Thu, 26 Sep 2024 00:38:23 -0400	[thread overview]
Message-ID: <20240926003823.50a14245@rorschach.local.home> (raw)
In-Reply-To: <2eV3oMRbTimO2AnpsTNrv5qQFnWBqljnkXxLciVNWDGDWP4rTQS1nfvRZAsJ9-Mx9U9GsxMyQZ5UZ94FSBjZrFeuJHKloPzE45D3k-3LnIA=@protonmail.com>


Hi,

Thank you for your patch. First, Daniel is unfortunately no longer the
maintainer of this code:

  https://lwn.net/Articles/979912/

This patch is not formatted correctly, so it can not even be reviewed.
Please take a look at Submitting Patches:

  https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html

-- Steve


On Sat, 21 Sep 2024 23:43:02 +0000
furkanonder <furkanonder@protonmail.com> wrote:

> The enhancements made to timerlat_load.py focus on improving error handling, readability, and overall user experience. These changes aim to make the script more robust and easier to maintain while providing clearer feedback to users.
> Key modifications include:
> 
> Type Declaration in Argument Parsing:
> Added type declarations for command-line arguments in the argument parser. This removes the need for manual type checks later in the code, improving clarity and safety.
> Before:
> parser.add_argument("cpu", help='CPU to run timerlat thread')
> parser.add_argument("-p", "--prio", help='FIFO priority')
> After:
> parser.add_argument("cpu", type=int, help='CPU to run timerlat thread')
> parser.add_argument("-p", "--prio", type=int, help='FIFO priority')
> 
> String Formatting:
> Replaced string concatenation with an f-string to enhancing readability and conciseness.
> Before:
> timerlat_path = "/sys/kernel/tracing/osnoise/per_cpu/cpu" + args.cpu + "/timerlat_fd"
> After:
> timerlat_path = f"/sys/kernel/tracing/osnoise/per_cpu/cpu{args.cpu}/timerlat_fd"
> 
> Enhanced Exception Handling and Consistent Error Reporting:
> Specific exceptions are now caught and printed with clearer messages, providing context for errors when opening file descriptors. Added exception
> handling for the data file descriptor opening to ensure uniformity across the script.
> 
> 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.
> 
> Changes for the read Infinite Loop:
> The original generic exception clause has been replaced with more specific exception types to provide clearer feedback on errors.

  reply	other threads:[~2024-09-26  4:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-21 23:43 [PATCH] tools/timerlat: Enhance Error Handling and Readability for timerlat_load.py furkanonder
2024-09-26  4:38 ` Steven Rostedt [this message]
2024-09-29 23:21   ` furkanonder
2024-09-30 14:08     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240926003823.50a14245@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=furkanonder@protonmail.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox