Files
swift-nio/dev/stackdiff/Package.swift
George Barnett e84b2ce05a Add internals for stackdiff tool (#3286)
Motivation:

Our alloc regression workflows are somewhat disparate: on macOS we have
dtrace and a script to diff two ouputs. On Linux we have heaptrack and
bpftrace but no way to analyze their outputs.

Diffing output from these tools can be quite tedious if the stacks vary
even a little (because the compiler decided to not inline a function,
for example).

Most of the tedium in this workflow is from pairing up equivalent stacks
across the two inputs. We can make this easier to do by ranking
suggestions based on how similar they are and letting the user decide
whether to accept the match or not.

Modifications:

- Add a subpackage with some internals for parsing heaptrack,
aggregating stacks, and measuring the similarity between them
- The CLI took is currently a no-op, it'll be added in subsequent PRs

Result:

Easier to diagnose alloc regressions
2025-07-07 14:04:55 +00:00

47 lines
1.3 KiB
Swift

// swift-tools-version: 6.1
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2025 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import PackageDescription
let package = Package(
name: "stackdiff",
// Required for Regex support
platforms: [.macOS(.v13)],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0")
],
targets: [
.executableTarget(
name: "stackdiff",
dependencies: [
.target(name: "Stacks"),
.product(
name: "ArgumentParser",
package: "swift-argument-parser"
),
]
),
.target(
name: "Stacks"
),
.testTarget(
name: "StacksTests",
dependencies: [
.target(name: "Stacks")
]
),
]
)