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.... 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"