21 Commits
Author SHA1 Message Date
David Evans b0effbcfd9 Make Swift 5.2 the minimum requirement (#1860)
Make Swift 5.2 the minimum requirement, dropping support for Swift 5.0 and 5.1.

Motivation:

Whenever we have problems, Swift 5.0 and 5.1 seem to be the culprits. Dropping support for these very old versions will require less maintenance and free up our time to work on new features.

Modifications:

Set the tools version in Package.swift to 5.2
Remove CI configurations for 5.0 and 5.1
Update the various readmes to reflect that this change will be rolled out in NIO 2.30.0
Result:

Swift 5.2 is the minimum version of Swift required to use NIO.
2021-06-18 21:02:41 +01:00
Johannes Weiss b23f40b4fa add Swift 5.5 job (#1845) 2021-06-01 18:58:56 +01:00
Johannes Weiss 06195d2f46 dev/scripts: add missing license headers (#1852)
Motivation:

We need license headers but the soundness script couldn't check if the
scripts don't have a `.sh` extension.

Modification:

- Add missing license headers.
- Better license checking (search for shell shebangs too)

Result:

Proper license attribution.
2021-05-07 10:28:07 +01:00
Johannes Weiss c51907f551 alloc limit updater: allow other repos (#1844)
Motivation:

The allocation limit updater script is handy but so far only worked for
the SwiftNIO core repo.

Modifications:

- allow the user to pass other URL prefixes and repos

Result:

Can be used for other repos
2021-05-04 19:15:38 +01:00
Johannes Weiss 0504ff04dd dev/lldb-smoker: LLDB smoke test using NIO (#1840)
Motivation:

We often hit a bunch of problems with LLDB, especially on Linux. So
maybe it would be cool if we could smoke test LLDB using SwiftNIO.

Modifications:

Add script `dev/lldb-smoker` which does the following things:

- takes 2000 random picks amongst all the files in the package
- for each of those files, pick a random line number
- write an LLDB script which sets break points for each of the file/line
  pairs (one-shot breakpoints)
- runs the program
- for each breakpoint hit, run `frame variable` to list all the
  variables

Result:

LLDB smoke test
2021-05-04 11:05:40 +01:00
Cory Benfield 8369411d6f Stop measuring alloc counts on 5.0 (#1826)
Motivation:

5.0 is several years old now, and while we still support it there is
beginning to be some conflict with performance optimizations for newer
Swift versions. We should stop counting the allocation counts on this
version now: we no longer care as much about regressions.

Modifications:

- Stop setting alloc counter limits on 5.0
- Remove the script that tries to add them back.

Result:

No longer measure allocs on 5.0
2021-04-28 14:02:13 +01:00
Johannes Weiss eb1590a48a script to download & apply alloc limits from Jenkins (#1817)
Motivation:

When doing bigger alloc count changes, it's really tedious to apply them
manually given that the CI has the right numbers already.

Modifications:

Add a script to download and update them automatically.

Result:

Less toil.
2021-04-23 17:54:52 +01:00
Johannes Weiss 4d1a72c712 alloc-limits-from-test-output: support more formats (#1812)
Motivation:

The dev/alloc-limits-from-test-output script is handy to get correctly
formatted (and sorted) alloc counter limits from test output.

Modifications:

When running the alloc counter script itself, it outputs suggested
`export MAX_ALLOCS_ALLOWED` lines. We're now also parsing those, so you
can easily go from `export ...*` to the docker-compose form :).

Result:

Even easier alloc counter limits.
2021-04-21 14:39:55 +01:00
Johannes Weiss 2d27890eb8 normalise alloc counter slack (#1789)
Motivation:

Usually, we add a more or less random number of slack allocations to
make sure the tests don't spuriously fail. This makes it quite costly to
support new Swift versions.

Modifications:

Add a script which can spit you out the right allocation limits
including slack.

Result:

Easier to support new Swift versions
2021-03-30 14:42:33 +01:00
George Barnett 990b82d698 Make stackdiff-dtrace.py a little more tolerant (#1771)
Motivation:

Some of the output from 'malloc-aggregation.d' trips up the
'stackdiff-dtrace.py' script -- especially when used with the output
from recent 5.4 builds. The regex for numbers includes hex which trips
us up when we try to convert that match to an int. Since we only use
this pattern for matching allocation counts, where we don't expect hex,
we can just modify the pattern.

Also the input parsing is a little tricky to follow without context so I
tidied it up little.

Modifications:

- relax the number regex (we don't expect counts to be in hex)
- drop the stack regex (it wasn't used)
- aggregate the current stack in a list (instead of a string)
- filter out non-stack lines (which were erroneously used to key the
  first stack!)
- a few comments

Result:

stackdiff-dtrace.py doesn't blow up on output from newer builds
2021-03-02 12:26:52 +00:00
Johannes WeissandCory Benfield 3a2fc0d39b alloc tests: implement malloc_zone_* (#1569)
Motivation:

The Swift runtime is now using malloc_zone_*, we need to implement
replacements for these too. This is just a first pass, eventually, we
should implement _all_ replacements as `malloc_zone_memalign` which is
powerful enough to implement all others.

Modifications:

Provide new replacements.

Result:

Alloc tests work again on macOS.

Co-authored-by: Cory Benfield <lukasa@apple.com>
2020-06-26 11:04:37 +01:00
Peter Adams c5fa0b4565 Allocation diffing script no longer drops data. (#1513)
Allocation diffing script no longer drops data.

Motivation:

Looking at allocations is hard enough without the script getting the allocation counts wrong.

Modifications:

Where multiple allocations resolved to the same "key" only the last allocation was accounted for. I have changed the script to store all allocations - still keyed in the same way. When diffing the total number of allocations is used - if they are different the total and all contributing stack traces are output.

Added a total for all allocations everywhere at the end together with a difference number.

Output all stack traces before and after contributing to a detected diff.

Update the documentation to reflect changes.

Change the threshold for reporting diffs from > 1000 to >= 1000. This means if allocations go from 1000 to 2000 they are reported as a difference rather than a new allocation.

Result:

It is now easier - if somewhat more verbose to compare allocations.
2020-05-12 09:11:56 +01:00
Johannes Weiss ad0c671acf make-single-file-spm: better directory name (#1446)
Motivation:

The make-single-file-spm script used to use a hidden folder in /tmp
which isn't very helpful when tar'ing up the result for a bug report.

Modifications:

Switch to a non-hidden folder.

Result:

Easier bugs.swift.org reports.
2020-03-13 17:01:37 +00:00
George BarnettandJohannes Weiss ddb7109142 Include stackdiff-ing in the debugging-allocations doc (#1384)
Motivation:

We recently grew a script to diff the output of `malloc-aggregation.d`,
we should document how this can be used when debugging allocation
regressions.

Modifications:

- Update the doc to include an example of using the script to debug an
  allocation regression
- Fix a bug in the script where before/after were mixed up
- Fix a bug in the script where usage would print '()\n' instead of '\n'

Result:

- Better info on debugging allocations

Co-authored-by: Johannes Weiss <johannesweiss@apple.com>
2020-02-06 16:10:04 +00:00
Johannes Weiss a76a98eb00 dev/stackdiff-dtrace: stack aggregation diffing script (#1373)
Motivation:

NIO has allocation counter tests, NIO also has dev/malloc-aggregation.d
which can give you aggregated stacks that allocated alongside how many
times they allocated. What's missing is a script that can diff two
aggregated stack traces.

Modifications:

Add dev/stacktrace-dtrace which allows aggregated stack trace diffing.

Result:

Easier to track performance regressions.
2020-02-03 09:09:20 +00:00
Johannes Weiss 9dd9f36bfd make-single-file-spm: support lines ending in n (#1251)
Motivation:

make-single-file-spm has a weird bug where it would chop off trailing
`n` characters in all lines due to a badly set `IFS` bash variable.

Modifications:

Set `IFS=""` which is correct.

Result:

make-single-file-spm will not chop off trailing `n`s.
2019-11-18 15:24:18 +01:00
Johannes Weiss 1c160afa95 add make-single-file-spm (#1236)
Motivation:

make-single-file-spm is a simple bash script that can turn a single file
into a SwiftPM project with multiple modules (all defined in a single
file with special markers such as `// MODULE: Foo`. This is mostly
useful for performance evaluation of Swift becuase in almost all cases,
you'll need multiple modules which is quite a bit of work to set up.

Modifications:

Add make-single-file-spm

Result:

More useful scripts in the NIO repo.
2019-11-12 19:07:01 +00:00
Johannes Weiss 9480c27148 malloc-aggregation.d: don't forget posix_memalign (#785)
Motivation:

When counting the number of allocations it's important not to forget an
allocation function that Swift uses.

Modifications:

add posix_memalign to dev/malloc-aggregation.d

Result:

malloc aggregations accurate with recent Swift versions
2019-01-29 11:23:42 +00:00
Johannes Weiß ec47847b4b add other memory allocation functions (#366)
Motivation:

The dtrace scripts dev/malloc-aggregation.d was missing a bunch of more
rarely used memory allocation functions.

Modifications:

Added the more rarely used functions.

Result:

Better output when using dev/malloc-aggregation.d
2018-04-27 10:29:25 +01:00
Johannes Weiß 5599bfe4c8 add useful dtrace scripts to debug allocations (#352)
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
2018-04-25 15:23:09 +01:00
Norman Maurer 3bfdd3f55b Adapt git template that is also used by Netty 2018-02-09 12:19:12 +01:00