Skip to content

Commit

Permalink
Add new sysfeatures module as experimental (#581)
Browse files Browse the repository at this point in the history
* First iteration of new hwfeatures module, mainly for Intel systems

* Finish Intel RAPL feature

* Update hwfeatures with AMD RAPL

* Limit string length in hwFeatures

* Rename hwfeatures to sysfeatures as it contains more than just hardware features

* Rename sysfeatures variables, move likwid_device types, exclude code when not configured, add meta info

* Fix sysfeatures test and add make target

* Delete empty sysFeature for transparent hugepages

* Fix merge error
  • Loading branch information
TomTheBear authored Nov 10, 2023
1 parent 141a59e commit 867313a
Show file tree
Hide file tree
Showing 47 changed files with 7,217 additions and 1,040 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ L_HELPER = likwid.lua
ifeq ($(BUILDFREQ),true)
L_APPS += likwid-setFrequencies
endif
ifeq ($(BUILD_SYSFEATURES),true)
L_APPS += likwid-sysfeatures
DEFINES += -DLIKWID_WITH_SYSFEATURES
else
SYSFEATURE_OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/sysFeatures*.c))
OBJ := $(filter-out $(SYSFEATURE_OBJ), $(OBJ))
OBJ := $(filter-out $(BUILD_DIR)/likwid_device.o,$(OBJ))
endif

CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(INCLUDES)

Expand Down
3 changes: 3 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ NVIDIA_INTERFACE = false#NO SPACE
# For configuring include paths, go to ROCm section
ROCM_INTERFACE = false#NO SPACE

# Build experimental sysfeatures interface and Lua CLI application
BUILD_SYSFEATURES = false#NO SPACE

#################################################################
#################################################################
# Advanced configuration options #
Expand Down
6 changes: 5 additions & 1 deletion src/access-daemon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ include ../../make/include_$(COMPILER).mk
DAEMON_TARGET = likwid-accessD
SETFREQ_TARGET = likwid-setFreq
APPDAEMON_TARGET = likwid-appDaemon.so
SYSFSDAEMON_TARGET = ../../likwid-sysD
GOTCHA_FOLDER = ../../ext/GOTCHA
Q ?= @

Expand Down Expand Up @@ -65,4 +66,7 @@ $(SETFREQ_TARGET): setFreqDaemon.c
$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o ../../$(SETFREQ_TARGET) setFreqDaemon.c

$(APPDAEMON_TARGET): $(GOTCHA_TARGET) appDaemon.c
$(Q)$(CC) -shared -fPIC $(CPPFLAGS) -Wl,-soname,$(APPDAEMON_TARGET).$(VERSION).$(RELEASE) -fstack-protector -I. ../bstrlib.c appDaemon.c -o ../../$(APPDAEMON_TARGET) -llikwid -L../../
$(Q)$(CC) -shared -fPIC $(CPPFLAGS) -Wl,-soname,$(APPDAEMON_TARGET).$(VERSION).$(RELEASE) -fstack-protector -I. -I$(GOTCHA_FOLDER)/include -L$(GOTCHA_FOLDER) appDaemon.c -o ../../$(APPDAEMON_TARGET) -llikwid-gotcha

$(SYSFSDAEMON_TARGET): sysfsDaemon.c
$(Q)$(CC) -g -fsanitize=address -fsanitize=leak -fomit-frame-pointer $(CFLAGS) $(CPPFLAGS) -o ../../sysfsD sysfsDaemon.c
1 change: 1 addition & 0 deletions src/access-daemon/accessDaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ allowed_intel(uint32_t reg)
((reg & 0xF00U) == 0xD00U) ||
((reg & 0xF00U) == 0xE00U) ||
((reg & 0xF00U) == 0xF00U) ||
(reg == 0x48) ||
(reg == 0x1A0) ||
(reg == 0x1A4) ||
(reg == 0x0CE) ||
Expand Down
Loading

0 comments on commit 867313a

Please sign in to comment.