Home

Awesome

Swift Coz (Linux Only)

Coz profiler Swift wrapper/bindings.

This is a Swift wrapper around the Coz profiler here: https://github.com/plasma-umass/coz inspired from https://github.com/urjitbhatia/cozgo (method names, example and this README.md)

Code Usage

Coz CallEquivalent Swift Coz CallDescription
COZ_BEGIN("name")cozBegin("name")Begin a latency profiling block identified by the name
COZ_END("name")cozEnd("name")End a latency profiling block identified by the name
COZ_PROGRESS()cozProgress()Specify a progress point within a block of work
COZ_PROGRESS()cozProgressNamed("name")Specify a named progress point within a block of work

For background on causal profiling, see

Paper: http://www.sigops.org/s/conferences/sosp/2015/current/2015-Monterey/printable/090-curtsinger.pdf

Blog: https://morsmachine.dk/causalprof

Running/Usage - Coz works only on Linux

let package = Package(
  name: "SomePackage",
  dependencies: [
    .package(
      url: "https://github.com/funcmike/swift-coz.git", .branch("main")
    )
  ],
  targets: [
    .executableTarget(
      name: "SomeTarget",
      dependencies: [
        .product(name: "Coz", package: "swift-coz"),
      ]
    ),
  ]