Re: [PATCH] Fix get-call-chain thread filtering

2023-07-03 Thread felix . winkelmann
> Hi there,
>
> The attached patch fixes a small but important oversight in
> get-call-chain.  With this patch, the "trace" egg's tests pass again.
>

Pushed.


felix




[PATCH] Fix get-call-chain thread filtering

2023-06-30 Thread Peter Bex
Hi there,

The attached patch fixes a small but important oversight in
get-call-chain.  With this patch, the "trace" egg's tests pass again.

Cheers,
Peter
From 7e20f8dc5310ee8fb41522bff062783b224b07f3 Mon Sep 17 00:00:00 2001
From: Peter Bex 
Date: Fri, 30 Jun 2023 09:42:48 +0200
Subject: [PATCH] Fix thread id extraction in get-call-chain

This was missed when changing the trace buffer struct; all accessors
had to be adjusted by adding one to the index, except for the "raw"
slot.

Without it, the filtering of call chain entries for the current thread
will fail for anything with "frameinfo" / a filled cooked2 slot, so
the call chain will be a lot smaller than it ought to be.
---
 library.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library.scm b/library.scm
index 94f304b8..b04b330a 100644
--- a/library.scm
+++ b/library.scm
@@ -4975,7 +4975,7 @@ EOF
(let loop ((i 0))
  (if (fx>= i n)
  '()
- (let ((t (##sys#slot vec (fx+ i 3 ; thread id
+ (let ((t (##sys#slot vec (fx+ i 4 ; thread id
(if (or (not t) (not thread) (eq? t-id t))
(cons (vector
   (or (##sys#slot vec (fx+ i 1)) ; cooked_location
-- 
2.40.1



signature.asc
Description: PGP signature