public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Eugene Loh <eugene.loh@oracle.com>
Cc: Kris Van Hees <kris.van.hees@oracle.com>,
	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 20:46:04 -0400	[thread overview]
Message-ID: <aNnWzNX+DsK0YynC@oracle.com> (raw)
In-Reply-To: <8711a6e3-d20f-d4df-91ab-7cc3d7e263b8@oracle.com>

On Sun, Sep 28, 2025 at 07:52:52PM -0400, Eugene Loh wrote:
> 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.

Oh, that....  Well, since we no longer support 32-bit anyway, it seems hardly
relevant to keep code around that handles 32-bit PCs.  If we were to bring
back tracing of 32-bit apps on a 64-bit system, we can re-introduce code for
it, hopefully in a more clean manner, but that will require additional code in
various other places I believe.

      reply	other threads:[~2025-09-29  0:46 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
2025-09-29  0:46       ` Kris Van Hees [this message]

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=aNnWzNX+DsK0YynC@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=eugene.loh@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