git: 9front

Download patch

ref: b186c97282dd8a750b8f43d8079edd6edaf0c425
parent: 38d5f395c08c65469bdab53cbcdb7d7f06a237d1
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Dec 17 19:42:47 EST 2023

qlock: keep the caller pc in the qlock for debugging

Keeping the PC for the qlock call isn't very useful,
since it's always going to be the same PC. Instead,
set the Lock's pc to the pc of the QLock locker.

--- a/sys/src/9/port/qlock.c
+++ b/sys/src/9/port/qlock.c
@@ -79,6 +79,7 @@
 	lock(&q->use);
 	rwstats.qlock++;
 	if(!q->locked) {
+		q->use.pc = getcallerpc(&q);
 		q->locked = 1;
 		unlock(&q->use);
 		return;
--