[24.04_linux-nvidia-6.17] Backport perf tool_pmu: Use old_count when computing count values for time events#471
Closed
nvmochs wants to merge 1 commit into
Conversation
When running in interval mode every third count of a time event isn't
showing properly:
```
$ perf stat -e duration_time -a -I 1000
1.001082862 1,002,290,425 duration_time
2.004264262 1,003,183,516 duration_time
3.007381401 <not counted> duration_time
4.011160141 1,003,705,631 duration_time
5.014515385 1,003,290,110 duration_time
6.018539680 <not counted> duration_time
7.022065321 1,003,591,720 duration_time
```
The regression came in with a different fix, found through bisection,
commit 68cb156 ("perf tool_pmu: Fix aggregation on
duration_time"). The issue is caused by the enabled and running time
of the event matching the old_count's and creating a delta of 0, which
is indicative of an error.
Fixes: 68cb156 ("perf tool_pmu: Fix aggregation on duration_time")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
(backported from commit bdf96c4)
[mochs: Minor context adjustment due to absent definitions]
Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
Collaborator
BaseOS Kernel ReviewSummaryOnly a low-severity issue found: in tools/perf/util/tool_pmu.c, the time conversion uses a floating-point literal (1e9), which can lose precision for very large __u64 deltas, though practical impact on perf time stats is negligible. Findings: Critical: 0, High: 0, Medium: 0, Low: 1 Latest watcher review: open review Kernel deb build: failed (failure log, build artifacts) Head: This comment is maintained by nv-pr-bot. It is updated when the GitHub watcher publishes a newer review. |
Contributor
PR Validation ReportPatchscan ✅ No Missing FixesAll cherry-picked commits checked — no missing upstream fixes found. PR Lint ❌ Errors foundDetailsChecking 1 commits...
Cherry-pick digest:
E: b30d2bbf616f ("perf tool_pmu: Use old_count when comput"): patch-ID mismatch with upstream bdf96c4ecd69
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local │ Referenced upstream / Patch subject │ Patch-ID │ Subject │ SoB chain │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ b30d2bbf616f │ bdf96c4ecd69 perf tool_pmu: Use old_count when computing count v │ MISMATCH │ match │ preserved + mochs added │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘
Lint: all checks passed.
|
clsotog
approved these changes
Jun 24, 2026
clsotog
left a comment
Collaborator
There was a problem hiding this comment.
Acked-by: Carol L Soto <csoto@nvidia.com>
nirmoy
approved these changes
Jun 24, 2026
nirmoy
left a comment
Collaborator
There was a problem hiding this comment.
Acked-by: Nirmoy Das <nirmoyd@nvidia.com>
Collaborator
Author
|
Merged, closing PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This upstream patch from v6.19 resolves an issue (injected with a v6.16 commit) when running the perf command to measure duration time.
When running in interval mode every third count of a time event isn't
showing properly:
Patch: torvalds/linux@bdf96c4
LKML: https://lore.kernel.org/all/20251113180517.44096-4-irogers@google.com/
Backport the patch to linux-nvidia-6.17.
Verified by running the perf command with the fix:
LP: https://bugs.launchpad.net/ubuntu/+source/linux-nvidia-6.17/+bug/2158038