From: Eugene Loh <eugene.loh@oracle.com>
To: Kris Van Hees <kris.van.hees@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 1/2] Unify the handling of stack traces in the consumer
Date: Sun, 28 Sep 2025 19:52:52 -0400 [thread overview]
Message-ID: <8711a6e3-d20f-d4df-91ab-7cc3d7e263b8@oracle.com> (raw)
In-Reply-To: <aNnEMAcUWAHHayGU@oracle.com>
On 9/28/25 19:26, Kris Van Hees wrote:
> On Sun, Sep 28, 2025 at 01:50:02AM -0400, Eugene Loh wrote:
>
>> For kernel stacks, I guess size is always 8. Could mention that? Also not a
>> big deal.
> I am not sure what you mean by this? The size of the data that is set aide to
> store the stack trace depends on the number of frames that is requested.
Right. I mean the size of a PC.
The code used to have a function
int
dt_print_stack(dtp, fp, format, addr, depth, size)
{
for (i = 0; i < depth; i++) {
switch (size) {
case sizeof(uint32_t):
/* LINTED - alignment */
pc = *((uint32_t *)addr);
break;
case sizeof(uint64_t):
/* LINTED - alignment */
pc = *((uint64_t *)addr);
break;
default:
return dt_set_errno(dtp, EDT_BADSTACKPC);
}
addr += size;
[...]
}
}
(Lots of code redacted.) Anyhow, we feed in a "size" argument. The
ported function is
int
dt_print_stack_kernel(dtp, fp, format, addr, indent, depth)
{
for (i = 0; i < depth; i++) {
pc = *((uint64_t *)addr);
if (pc == 0)
addr += sizeof(pc);
[...]
}
}
which assumes 8-byte values. Again, no big deal.
next prev parent reply other threads:[~2025-09-28 23:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 16:01 [PATCH 1/2] Unify the handling of stack traces in the consumer Kris Van Hees
2025-09-28 5:50 ` Eugene Loh
2025-09-28 23:26 ` Kris Van Hees
2025-09-28 23:52 ` Eugene Loh [this message]
2025-09-29 0:46 ` Kris Van Hees
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8711a6e3-d20f-d4df-91ab-7cc3d7e263b8@oracle.com \
--to=eugene.loh@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=kris.van.hees@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox