Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ustack call yield enexpected result #19

Open
benoitgillet opened this issue Oct 26, 2021 · 4 comments
Open

Ustack call yield enexpected result #19

benoitgillet opened this issue Oct 26, 2021 · 4 comments

Comments

@benoitgillet
Copy link

Trying to use a prob with a ustack() call, i encounter the following behavior :

  • windows functions calls on the user stack are printed
  • only one line of the user function is printed
  • some standalone numbers appear

I would expect a stack trace with multiple lines

Following, i put the prob i use

$dtrace -s this_file -c your_program

#pragma D option quiet

BEGIN {
 printf("\n======================================================================\n");
 printf("                    Function Stack Count Statistics\n");
 printf("======================================================================\n");
}
pid$target:::entry
{
 @all_calls[stack(100)] = count();
}

END {
 printa(@all_calls);
}

syscall::NtTerminateProcess:return
/pid == $target/
{
 exit(0)
}
@OlivierLi
Copy link

Hello,

If anyone sees this I'd like to try and understand if we could ever expect something here.

I'm a very frequent user of DTrace on macOS and bringing my scripts that rely on ustack() over is completely impossible since 99% of the stacks end up not displaying.

Some of them do so I know that pdb downloading and loading is wired correctly which makes it all the more frustrating.

Thanks for your time.

@CodeMaxx
Copy link
Member

@benoitgillet Looks like you're using stack() in that script instead of ustack()

@OlivierLi Could you give me a sample script and what possible output you see?

@CodeMaxx
Copy link
Member

The issue has been recognized. I will start working on a fix soon.

@OlivierLi
Copy link

Great to hear! Thanks for looking into this.

For reference for now the two scripts I'm looking to adapt are here with one more to come that I haven't pushed.

https://source.chromium.org/chromium/chromium/src/+/main:tools/mac/power/dtrace_scripts/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants