* [PATCH] hwlatdetect: correctly get CPU number from different sample formats
@ 2026-02-13 17:57 Luis Claudio R. Goncalves
2026-02-19 18:24 ` John Kacur
0 siblings, 1 reply; 2+ messages in thread
From: Luis Claudio R. Goncalves @ 2026-02-13 17:57 UTC (permalink / raw)
To: linux-rt-users, John Kacur, Clark Williams
Make hwlatdetect able to get the CPU number from samples in both
'nolatency-format' (currently covered by the code) and also from
samples in 'latency-format'.
With this change the code is now able to get the CPU from samples
in the following formats:
- nolatency-format:
<...>-3820 [007] d.... 22851.463472: #2 inner/outer(us): 0/233 ts:1770937572.925294075 count:1
<...>-3820 [011] d.... 22855.495526: #3 inner/outer(us): 308/305 ts:1770937576.805213360 count:49
- latency-format:
<...>-3835 13d.... 12608167us : #2 inner/outer(us): 307/299 ts:1770937629.988530678 count:49
<...>-3835 16d.... 15632212us : #3 inner/outer(us): 308/296 ts:1770937633.322710076 count:24
Fixes: 96e780938322 ("rt-tests: hwlatdetect: Add field cpu to samples output")
Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
---
src/hwlatdetect/hwlatdetect.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py
index 68f312db639f..26694abe099a 100755
--- a/src/hwlatdetect/hwlatdetect.py
+++ b/src/hwlatdetect/hwlatdetect.py
@@ -246,7 +246,7 @@ class Tracer(Detector):
def __init__(self, line):
fields = line.split()
- self.cpu = int(fields[1][1:-1])
+ self.cpu = int(fields[1][1:-1]) if fields[1][0] == '[' else int(fields[1][:-5])
i, o = fields[6].split('/')
ts = fields[7][3:]
self.timestamp = str(ts)
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwlatdetect: correctly get CPU number from different sample formats
2026-02-13 17:57 [PATCH] hwlatdetect: correctly get CPU number from different sample formats Luis Claudio R. Goncalves
@ 2026-02-19 18:24 ` John Kacur
0 siblings, 0 replies; 2+ messages in thread
From: John Kacur @ 2026-02-19 18:24 UTC (permalink / raw)
To: Luis Claudio R. Goncalves; +Cc: linux-rt-users, John Kacur, Clark Williams
On Fri, 13 Feb 2026, Luis Claudio R. Goncalves wrote:
> Make hwlatdetect able to get the CPU number from samples in both
> 'nolatency-format' (currently covered by the code) and also from
> samples in 'latency-format'.
>
> With this change the code is now able to get the CPU from samples
> in the following formats:
>
> - nolatency-format:
> <...>-3820 [007] d.... 22851.463472: #2 inner/outer(us): 0/233 ts:1770937572.925294075 count:1
> <...>-3820 [011] d.... 22855.495526: #3 inner/outer(us): 308/305 ts:1770937576.805213360 count:49
>
> - latency-format:
> <...>-3835 13d.... 12608167us : #2 inner/outer(us): 307/299 ts:1770937629.988530678 count:49
> <...>-3835 16d.... 15632212us : #3 inner/outer(us): 308/296 ts:1770937633.322710076 count:24
>
> Fixes: 96e780938322 ("rt-tests: hwlatdetect: Add field cpu to samples output")
> Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
> ---
> src/hwlatdetect/hwlatdetect.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py
> index 68f312db639f..26694abe099a 100755
> --- a/src/hwlatdetect/hwlatdetect.py
> +++ b/src/hwlatdetect/hwlatdetect.py
> @@ -246,7 +246,7 @@ class Tracer(Detector):
>
> def __init__(self, line):
> fields = line.split()
> - self.cpu = int(fields[1][1:-1])
> + self.cpu = int(fields[1][1:-1]) if fields[1][0] == '[' else int(fields[1][:-5])
> i, o = fields[6].split('/')
> ts = fields[7][3:]
> self.timestamp = str(ts)
> --
Signed-off-by: John Kacur <jkacur@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-19 18:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-13 17:57 [PATCH] hwlatdetect: correctly get CPU number from different sample formats Luis Claudio R. Goncalves
2026-02-19 18:24 ` John Kacur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox