                       maxRSS: UInt64(sampler.measureMemoryUsage()))
 }
 
-func printRunInfo(_ c: TestConfig) {
-  if c.verbose {
-    print("--- CONFIG ---")
-    print("NumSamples: \(c.numSamples)")
-    print("Verbose: \(c.verbose)")
-    print("IterScale: \(c.iterationScale)")
-    if c.fixedNumIters != 0 {
-      print("FixedIters: \(c.fixedNumIters)")
-    }
-    print("Tests Filter: \(c.filters)")
-    print("Tests to run: ", terminator: "")
-    print(c.tests.map({ $0.1.name }).joined(separator: ", "))
-    print("")
-    print("--- DATA ---")
-  }
-}
-
 /// Execute benchmarks and continuously report the measurement results.
 func runBenchmarks(_ c: TestConfig) {
   let withUnit = {$0 + "(us)"}

    try optionalArg("--list", \.action, defaultValue: .listTests)
    try optionalArg("--help", \.action, defaultValue: .help(validOptions))

    // Configure from the command line arguments, filling in the defaults.
    delim = c.delim ?? ","
    self.tags = c.tags ?? []
    skipTags = c.skipTags ?? [.unstable, .skip]
    iterationScale = c.iterationScale ?? 1
    fixedNumIters = c.fixedNumIters ?? 0
    numSamples = c.numSamples ?? 1
    verbose = c.verbose ?? false
    afterRunSleep = c.afterRunSleep
    action = c.action ?? .run
    // TODO: filters, tests
  }

  mutating func findTestsToRun() {
    registeredBenchmarks.sort()
    let indices = Dictionary(uniqueKeysWithValues:
      zip(registeredBenchmarks.map{ $0.name },
          (1...).lazy.map { String($0) } ))
    let benchmarkNamesOrIndices = Set(filters)
    // needed so we don't capture an ivar of a mutable inout self.
    let (_tags, _skipTags) = (tags, skipTags)

    tests = registeredBenchmarks.filter { benchmark in
      if benchmarkNamesOrIndices.isEmpty {
        return benchmark.tags.isSuperset(of: _tags) &&
          benchmark.tags.isDisjoint(with: _skipTags)
      } else {
        return benchmarkNamesOrIndices.contains(benchmark.name) ||
          benchmarkNamesOrIndices.contains(indices[benchmark.name]!)

          try checked({ BenchmarkCategory(rawValue: $0) }, $0) })
    }

    // Parse command line arguments
    try optionalArg("--iter-scale", \.iterationScale) { Int($0) }
    try optionalArg("--num-iters", \.fixedNumIters) { UInt($0) }
    try optionalArg("--num-samples", \.numSamples)  { Int($0) }
