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

add useful dtrace scripts to debug allocations #352

Merged
merged 1 commit into from
Apr 25, 2018

Conversation

weissi
Copy link
Member

@weissi weissi commented Apr 24, 2018

Motivation:

dtrace is extrmely useful when debugging allocation related issues. This
adds two scripts that have helped me many times.

Modifications:

  • dev/malloc-aggregation.d which prints an aggregation of all
    stacks that have allocated
  • dev/boxed-existentials.d which live prints all allocations of boxed
    existentials

Result:

sharing debugging tools is great

@weissi weissi requested review from normanmaurer and Lukasa April 24, 2018 18:42
@tomerd
Copy link
Member

tomerd commented Apr 24, 2018

@swift-nio-bot test this please

@weissi
Copy link
Member Author

weissi commented Apr 24, 2018

the failure in 4.1 was

21:12:47 Test Case 'ChannelTests.testGeneralConnectTimeout' started at 2018-04-24 20:12:47.228
21:12:47 <EXPR>:0: error: ChannelTests.testGeneralConnectTimeout : threw error "connection reset (error set): Network is unreachable (errno: 101) "
21:12:47 Test Case 'ChannelTests.testGeneralConnectTimeout' failed (0.005 seconds)

guess we can just retry that

@tomerd
Copy link
Member

tomerd commented Apr 25, 2018

@swift-nio-bot test this please

@normanmaurer
Copy link
Member

@swift-nio-bot test this please

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit

printf("This will collect stack shots of allocations and print it when ");
printf("you exit dtrace.\n");
printf("So go ahead, run your tests and then press Ctrl+C in this window ");
printf("to see the aggreated result\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "aggregated"

@weissi weissi force-pushed the jw-useful-dtrace branch from def28f9 to ffcd471 Compare April 25, 2018 13:29
Motivation:

dtrace is extrmely useful when debugging allocation related issues. This
adds two scripts that have helped me many times.

Modifications:

- `dev/malloc-aggregation.d` which prints an aggregation of all
  stacks that have allocated
- `dev/boxed-existentials.d` which live prints all allocations of boxed
  existentials

Result:

sharing debugging tools is great
@weissi weissi force-pushed the jw-useful-dtrace branch from ffcd471 to f7b9acf Compare April 25, 2018 14:10
@Lukasa Lukasa merged commit 5599bfe into apple:master Apr 25, 2018
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Apr 25, 2018
@Lukasa Lukasa added this to the 1.6.0 milestone Apr 25, 2018
@weissi weissi deleted the jw-useful-dtrace branch April 25, 2018 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants