Skip to content

Instantly share code, notes, and snippets.

@simbuerg
Created June 8, 2017 12:43
Show Gist options
  • Save simbuerg/e5efd6633c1894f3893407fda21ed200 to your computer and use it in GitHub Desktop.
Save simbuerg/e5efd6633c1894f3893407fda21ed200 to your computer and use it in GitHub Desktop.
Example project for benchbuild
"""
PPROF Experiment.
"""
from benchbuild.experiment import Experiment
from benchbuild.project import Project
from benchbuild.utils.actions import (Build, Clean, Configure, Download,
MakeBuildDir, Prepare, Run)
from benchbuild.utils.run import track_execution
from functools import partial
from plumbum import local
def do_nothing(project, experiment, run_f, *args, **kwargs):
from benchbuild.utils.cmd import perf
project.name = kwargs.get("project_name", project.name)
cmd = local[run_f]
with track_execution(cmd, project, experiment) as run:
ri = run()
return ri
class PPROFExp(Experiment):
"""PPROF Experiment."""
NAME = "pprof"
def actions_for_project(self, project : Project):
"""Genau."""
project.runtime_extension = partial(do_nothing, project, self)
project.cflags = ["-O3"]
project.ldflags = ["-lpprof"]
actns = []
actns.extend([
MakeBuildDir(project),
Prepare(project),
Download(project),
Configure(project),
Build(project),
Run(project),
Clean(project)
])
return actns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment