#!/usr/bin/env python3 # Copyright 2017 The Australian National University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Functions to configure callback settings from pathlib import Path from mubench import CALLBACKS_DIR from mubench.util import expandenv def configure_cb_perfevent(cb_d, env): assert 'libpfm4_dir' in cb_d, "libpfm4 install directory not specified" libpfm4 = Path(expandenv(cb_d['libpfm4_dir'], env)) if not libpfm4.is_absolute(): libpfm4 = CALLBACKS_DIR / libpfm4 # default relative to CALLBACKS_DIR cb_d['include_dirs'].extend([ str(libpfm4 / 'include'), str(libpfm4 / 'util') ]) cb_d['library_dirs'].append(str(libpfm4 / 'lib')) cb_d['libraries'].append('pfm') cb_d['extra_srcs'].append(str(libpfm4 / 'util' / 'perf_util.c')) cb_d['flags'].append('-pthread') def configure_cb_clock(cb_d, env): pass def configure_cb_print(cb_d, env): pass