chromium/tools/perf/list_benchmarks

#!/usr/bin/env vpython3
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from __future__ import print_function

import argparse
import sys

from core import path_util
path_util.AddTelemetryToPath()

from core import benchmark_finders
from telemetry import decorators


def _CreateParser():
  parser = argparse.ArgumentParser()
  parser.add_argument('--include-contrib', action='store_true', default=False,
                      help='Also list contrib (non-waterfall) benchmarks')
  return parser

def main():
  parser = _CreateParser()
  args = parser.parse_args()

  if args.include_contrib:
    benchmarks = benchmark_finders.GetAllBenchmarks()
  else:
    benchmarks = benchmark_finders.GetOfficialBenchmarks()

  for b in benchmarks:
    print('{:<60}'.format(b.Name()))


if __name__ == '__main__':
  sys.exit(main())