From: Claudio Jeker Subject: Re: stacktrace_save_utrace() should be more robust To: Alexandr Nedvedicky Cc: Ted Unangst , Mark Kettenis , tech@openbsd.org Date: Thu, 22 May 2025 10:21:19 +0200 On Thu, May 22, 2025 at 09:00:53AM +0200, Alexandr Nedvedicky wrote: > On Thu, May 22, 2025 at 07:17:07AM +0200, Claudio Jeker wrote: > > On Thu, May 22, 2025 at 05:09:17AM +0200, Alexandr Nedvedicky wrote: > > > Hello, > > > > > > On Wed, May 21, 2025 at 08:15:48PM -0400, Ted Unangst wrote: > > > > > > > > > > > Is it possible to use two loops here? One loop to get out of the kernel, > > > > and then the second that does the copyin? I think there is not so much > > > > code in common that duplicating is a problem, and it will be more clear > > > > what we're trying to do in each loop. > > > > > > > > > > I like this idea. it makes code lot more clear. > > > updated diff follows. > > > > I never looked into this proper but instead of walking the full kernel > > stack, can't we start with the information in the trapframe? > > Don't remember if there is a pointer to it somewhere in the pcb. > > > > I assume you mean 'struct intrframe' because this is currently > running on behalf of clock interrupt it is profiling probe. Hmmm. This code should work in all cases (both interupt and trap). While the profiling probe works in interrupt context you can use utrace information also on e.g. sycall entry. -- :wq Claudio