patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Zhang Chujun <zhangchujun@cmss.chinamobile.com>,
	"Steven Rostedt (Google)" <rostedt@goodmis.org>,
	Sasha Levin <sashal@kernel.org>,
	alexandre.f.demers@gmail.com, alexander.deucher@amd.com
Subject: [PATCH AUTOSEL 6.17-5.15] tracing/tools: Fix incorrcet short option in usage text for --threads
Date: Mon, 10 Nov 2025 14:57:02 -0500	[thread overview]
Message-ID: <20251110195718.859919-2-sashal@kernel.org> (raw)
In-Reply-To: <20251110195718.859919-1-sashal@kernel.org>

From: Zhang Chujun <zhangchujun@cmss.chinamobile.com>

[ Upstream commit 53afec2c8fb2a562222948cb1c2aac48598578c9 ]

The help message incorrectly listed '-t' as the short option for
--threads, but the actual getopt_long configuration uses '-e'.
This mismatch can confuse users and lead to incorrect command-line
usage. This patch updates the usage string to correctly show:
	"-e, --threads NRTHR"
to match the implementation.

Note: checkpatch.pl reports a false-positive spelling warning on
'Run', which is intentional.

Link: https://patch.msgid.link/20251106031040.1869-1-zhangchujun@cmss.chinamobile.com
Signed-off-by: Zhang Chujun <zhangchujun@cmss.chinamobile.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

Based on my analysis of the commit and examination of the kernel
repository, here is my assessment:

## Backport Decision: YES

## Detailed Analysis

### 1. Code Changes Examined

The commit changes a single line in the help text of
`tools/tracing/latency/latency-collector.c`:
- **Line 1728**: Changed from `"-t, --threads NRTHR\t..."` to `"-e,
  --threads NRTHR\t..."`

### 2. Tools Used for Analysis

Since this is a documentation-only change in a user-space tool (not
kernel code), I used basic repository analysis tools rather than
semantic code analysis tools:

- **Read tool**: Examined the usage text section and surrounding code
  context
- **Grep tool**: Searched for and verified:
  - The `getopt_long()` configuration (line 1863): confirmed `"e:"` is
    in the option string
  - The `long_options[]` array (line 1843): confirmed `{ "threads",
    required_argument, 0, 'e' }`
  - The case handlers: confirmed `case 'e':` handles the threads option
    (line 1927)
  - Verified `case 't':` is used for the tracer option (line 1873), not
    threads
- **Git history**: Reviewed recent commits to understand the file's
  maintenance status

### 3. Findings Summary

**Bug Verification:**
- The long_options array at line 1843 explicitly maps `--threads` to
  short option `'e'`
- The short option `'t'` is correctly mapped to `--tracer` at line 1832
- The help text incorrectly showed `-t` for `--threads`, creating a
  direct conflict with `-t` for `--tracer`
- This would cause user confusion if someone tried to use `-t` expecting
  threads behavior but got tracer behavior instead

**Impact Assessment:**
- **Scope**: User-space tool only (tools/tracing/latency/)
- **Risk**: Zero - only a string literal in help text changes
- **Severity**: Low - documentation bug, not functional
- **User Benefit**: Prevents confusion about command-line options

### 4. Reasoning for Backport

This commit should be backported because:

1. **Fixes a Real Bug**: While only documentation, incorrect help text
   is a genuine bug that misleads users about the tool's interface

2. **Zero Risk of Regression**: The change is confined to a string
   literal in the usage text - there is absolutely no way this can break
   anything or cause regressions

3. **Meets Stable Tree Criteria**:
   - ✅ Obviously correct (verified against actual implementation)
   - ✅ Small and contained (one line)
   - ✅ Fixes a user-visible issue
   - ✅ Safe to backport

4. **Improves User Experience**: Users on stable kernels who use this
   latency collector tool will have correct documentation, reducing
   support burden and confusion

5. **Trivial to Backport**: Single line change with no dependencies

6. **Low Priority but Still Valid**: While this is low severity compared
   to kernel bugs, it perfectly fits the stable tree philosophy of
   including safe, helpful fixes that improve the user experience
   without any downside

The fact that it's in the `tools/` directory rather than kernel proper
doesn't disqualify it - documentation correctness matters for all
components distributed with the kernel.

 tools/tracing/latency/latency-collector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tracing/latency/latency-collector.c b/tools/tracing/latency/latency-collector.c
index cf263fe9deaf4..ef97916e3873a 100644
--- a/tools/tracing/latency/latency-collector.c
+++ b/tools/tracing/latency/latency-collector.c
@@ -1725,7 +1725,7 @@ static void show_usage(void)
 "-n, --notrace\t\tIf latency is detected, do not print out the content of\n"
 "\t\t\tthe trace file to standard output\n\n"
 
-"-t, --threads NRTHR\tRun NRTHR threads for printing. Default is %d.\n\n"
+"-e, --threads NRTHR\tRun NRTHR threads for printing. Default is %d.\n\n"
 
 "-r, --random\t\tArbitrarily sleep a certain amount of time, default\n"
 "\t\t\t%ld ms, before reading the trace file. The\n"
-- 
2.51.0


  reply	other threads:[~2025-11-10 19:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 19:57 [PATCH AUTOSEL 6.17-6.12] drm/amdgpu: fix gpu page fault after hibernation on PF passthrough Sasha Levin
2025-11-10 19:57 ` Sasha Levin [this message]
2025-11-10 19:57 ` [PATCH AUTOSEL 6.17-5.4] net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error Sasha Levin
2025-11-10 19:57 ` [PATCH AUTOSEL 6.17] scsi: ufs: ufs-qcom: Fix UFS OCP issue during UFS power down (PC=3) Sasha Levin
2025-11-10 19:57 ` [PATCH AUTOSEL 6.17] btrfs: set inode flag BTRFS_INODE_COPY_EVERYTHING when logging new name Sasha Levin
2025-11-10 19:57 ` [PATCH AUTOSEL 6.17-6.12] drm/xe: Move declarations under conditional branch Sasha Levin

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=20251110195718.859919-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=alexandre.f.demers@gmail.com \
    --cc=patches@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    --cc=zhangchujun@cmss.chinamobile.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;
as well as URLs for NNTP newsgroup(s).