def METHOD_NAME(benchmark_spec):
  """Runs Coremark on the target vm.
  Args:
    benchmark_spec: The benchmark specification.
  Returns:
    A list of sample.Sample objects with the performance results.
  Raises:
    Benchmarks.RunError: If correct operation is not validated.
  """
  vm = benchmark_spec.vms[0]
  output_samples = []
  for thread_count in FLAGS.coremark_thread_counts:
    thread_count_arg = vm.NumCpusForBenchmark() if (thread_count
                                                    == 0) else thread_count
    output_samples += RunCoremark(vm.RemoteCommand, thread_count_arg)
  return output_samples