From 1dc17eee5dca539654f3a22649c3a713fb3b0482 Mon Sep 17 00:00:00 2001 From: Galaxy Date: Mon, 6 May 2024 23:47:00 -0700 Subject: [PATCH] Merge bug fix from master to v1.0. Fix loss of spe packets. --- pmu/spe.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pmu/spe.cpp b/pmu/spe.cpp index eeb77e1..e2a5ece 100644 --- a/pmu/spe.cpp +++ b/pmu/spe.cpp @@ -405,6 +405,13 @@ static void SetTidByTimestamp(struct ContextSwitchData *dummyData, int *dummyIdx start->cpu = cpu; start->timestamp = recordTime; + if (start->tid != -1) { + // In some kernel versions, tid is contained in spe packet, + // which has been decoded in arm_spe_decoder.cpp. + // Then we do not need dummy events to derive tid for this packet. + continue; + } + if (*dummyIdx >= dummyData[0].num - 1) { // Now, all spe records locate after the last switch-in data. // We have to use switch-out data to get pid of the last time slice. -- Gitee