Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions config/pwrapi_msr.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

AC_DEFUN([PWRAPI_CHECK_MSR], [
AC_ARG_WITH([msr], [AS_HELP_STRING([--with-msr@<:@=DIR@:>@], [Use the msr binding in directory specified (DIR).])])

pwrapi_check_msr_happy="yes"

CPPFLAGS_saved="$CPPFLAGS"
LDFLAGS_saved="$LDFLAGS"
LIBS_saved="$LIBS"
MSR_LIBS=""

AS_IF([test -z "$with_msr"],
[MSR_CPPFLAGS=
MSR_LDFLAGS=
MSR_LIBS="-lmsr -lpthread"
LIBS="$LIBS $MSR_LIBS"],
[ AS_IF([test "x$with_msr" = "xyes"],
[MSR_CPPFLAGS=
MSR_LDFLAGS=
MSR_LIBS="-lmsr -lpthread"
LIBS="$LIBS $MSR_LIBS"],
[MSR_CPPFLAGS="-I$with_msr/include"
CPPFLAGS="$MSR_CPPFLAGS $CPPFLAGS"
MSR_LDFLAGS="-L$with_msr/lib"
LDFLAGS="$MSR_LDFLAGS $LDFLAGS"
MSR_LIBS="-lmsr -lpthread"
LIBS="$LIBS $MSR_LIBS"]
)]
)

AC_LANG_SAVE
AC_LANG_CPLUSPLUS


AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
int a;
])], [pwrapi_check_msr_lib_happy="yes"],
[pwrapi_check_msr_lib_happy="no"])

AS_IF([test "x$pwrapi_check_msr_lib_happy" = "xno"],
[pwrapi_check_msr_happy="no"])

AC_LANG_RESTORE

CPPFLAGS="$CPPFLAGS_saved"
LDFLAGS="$LDFLAGS_saved"
LIBS="$LIBS_saved"

AC_SUBST([MSR_CPPFLAGS])
AC_SUBST([MSR_LDFLAGS])
AC_SUBST([MSR_LIBS])

AM_CONDITIONAL([HAVE_MSR], [test "x$pwrapi_check_msr_happy" = "xyes"])
AS_IF([test "x$pwrapi_check_msr_happy" = "xyes"],
[AC_DEFINE([HAVE_MSR], [1], [Set to 1 if msr is found during configuration])])

AS_IF([test "x$pwrapi_check_msr_happy" = "xyes"], [$1], [$2])
])
5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ m4_include([config/acx_mpi.m4])
m4_include([config/pwrapi_mpi.m4])
m4_include([config/pwrapi_hwloc.m4])
m4_include([config/pwrapi_mic.m4])
m4_include([config/pwrapi_msr.m4])
m4_include([config/pwrapi_tx2mon.m4])

PWRAPI_CHECK_HWLOC([pwrapi_have_hwloc="yes"], [pwrapi_have_hwloc="no"])
Expand All @@ -49,9 +50,8 @@ PWRAPI_CHECK_POWERINSIGHT([pwrapi_have_powerinsight="yes"], [pwrapi_have_powerin
PWRAPI_CHECK_POWERGADGET([pwrapi_have_powergadget="yes"], [pwrapi_have_powergadget="no"])

PWRAPI_CHECK_MPI([pwrapi_have_mpi="yes"], [pwrapi_have_mpi="no"])

PWRAPI_CHECK_MIC([pwrapi_have_mic="yes"], [pwrapi_have_mic="no"])

PWRAPI_CHECK_MSR([pwrapi_have_msr="yes"], [pwrapi_have_msr="no"])
PWRAPI_CHECK_TX2MON([pwrapi_have_tx2mon="yes"], [pwrapi_have_tx2mon="no"])

PWRAPI_CHECK_DEBUG()
Expand All @@ -62,6 +62,7 @@ AC_CONFIG_FILES([Makefile
tools/script/hwloc_cpu_profile
tools/script/hwloc_rapl_profile
tools/script/hwloc_multi_profile
tools/script/hwloc_msr_profile
tools/script/hwloc_astra_profile
tools/script/hwloc_xt40_profile
examples/script/xml_profile
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ libpwr_micdev_la_CFLAGS = -I$(top_srcdir)/src/pwr $(MIC_INCLUDE)
libpwr_micdev_la_LDFLAGS = -version-info 1:0:1 $(MIC_LDFLAGS) $(MIC_LIBS)
endif

if HAVE_MSR
lib_LTLIBRARIES += libpwr_msrdev.la

libpwr_msrdev_la_SOURCES = pwr_dev.c pwr_msrdev.c
libpwr_msrdev_la_CFLAGS = -I$(top_srcdir)/src/pwr $(MSR_CFLAGS)
libpwr_msrdev_la_LDFLAGS = -version-info 1:0:1 $(MSR_LDFLAGS) $(MSR_LIBS)
endif

if HAVE_TX2MON
lib_LTLIBRARIES += libpwr_tx2mon.la

Expand Down
11 changes: 6 additions & 5 deletions src/plugins/README
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ Currently supported:
libpwr_cpudev System level CPU adjustments
libpwr_apmdev AMD Average Power Management
libpwr_pmcdev IBM Power8 Power Management (INCOMPLETE)
libpwr_msrdev LIBMSR

Attributes PIAPI PI RAPL WU XTPM CPU APM PMC
---------- ----- -- ---- -- ---- --- --- ---
power G G G G G G
energy G G G G
Attributes PIAPI PI RAPL WU XTPM CPU APM PMC MSR
---------- ----- -- ---- -- ---- --- --- --- ---
power G G G G G G
energy G G G G G
voltage G G G
current G G G
min_power G/S G/S
max_power G/S G/S
max_power G/S G/S G/S
freq G/S
temp G
pstate G/S
Expand Down
Loading