From a9496a7f8861c9bbe7994b110f89a93f2d6bfdd5 Mon Sep 17 00:00:00 2001 From: FlorealRISSO <floreal.risso@univ-tlse3.fr> Date: Tue, 28 Mar 2023 10:28:33 +0200 Subject: [PATCH] update: add in autoconf --- .gitignore | 2 +- configure.sh | 1 + makefile | 6 +++++- src/memory_counters.h | 2 +- src/{meminfo_option.sh => memory_option.sh} | 0 5 files changed, 8 insertions(+), 3 deletions(-) rename src/{meminfo_option.sh => memory_option.sh} (100%) mode change 100644 => 100755 diff --git a/.gitignore b/.gitignore index eb6940e..d652549 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ doc/info_reader_ex doc/mojitos.1 tests/run src/counters_option.h -src/meminfo_option.h +src/memory_option.h src/sensors.h sensors.mk bin diff --git a/configure.sh b/configure.sh index 7e10ec3..56abf93 100755 --- a/configure.sh +++ b/configure.sh @@ -117,6 +117,7 @@ detect_caps() { [ -r /usr/include/linux/perf_event.h ] && hdr_whitelist=counters [ -d /sys/class/infiniband ] && hdr_whitelist="${hdr_whitelist}|infiniband" [ -r /proc/stat ] && hdr_whitelist="${hdr_whitelist}|load" + [ -r /proc/meminfo ] && hdr_whitelist="${hdr_whitelist}|memory_counters" if [ "$(uname -r | cut -d "." -f 1)" -gt "2" ]; then hdr_whitelist="${hdr_whitelist}|memory" diff --git a/makefile b/makefile index f25d563..63fa983 100644 --- a/makefile +++ b/makefile @@ -40,8 +40,9 @@ $(BIN): $(BIN_DIR) $(OBJ) $(OBJ_DIR)/$(BIN).o $(OBJ): $(OBJ_DIR) $(OBJ_DIR)/counters.o: $(SRC_DIR)/counters_option.h +$(OBJ_DIR)/memory_counters.o: $(SRC_DIR)/memory_option.h -$(OBJ_DIR)/$(BIN).o: $(SRC_DIR)/$(BIN).c $(SRC_DIR)/counters_option.h +$(OBJ_DIR)/$(BIN).o: $(SRC_DIR)/$(BIN).c $(SRC_DIR)/counters_option.h $(SRC_DIR)/memory_counters.h $(CC) $(CFLAGS) -c $< -o $@ $(OBJ_DIR)/util.o: $(SRC_DIR)/util.c $(SRC_DIR)/util.h @@ -50,6 +51,9 @@ $(OBJ_DIR)/util.o: $(SRC_DIR)/util.c $(SRC_DIR)/util.h $(SRC_DIR)/counters_option.h: $(SRC_DIR)/counters_option.sh sh ./$(SRC_DIR)/counters_option.sh > $(SRC_DIR)/counters_option.h +$(SRC_DIR)/memory_option.h: $(SRC_DIR)/memory_option.sh + sh ./$(SRC_DIR)/memory_option.sh > $(SRC_DIR)/memory_option.h + $(OBJ_DIR): mkdir -p $(OBJ_DIR) diff --git a/src/memory_counters.h b/src/memory_counters.h index a066c42..a0b9613 100644 --- a/src/memory_counters.h +++ b/src/memory_counters.h @@ -24,7 +24,7 @@ void label_memory_counters(char **labels, void *ptr); void clean_memory_counters(void *ptr); void *show_all_memory_counters(void *, size_t); -sensor memory_counters = { +Sensor memory_counters = { .init = init_memory_counters, .get = get_memory_counters, .clean = clean_memory_counters, diff --git a/src/meminfo_option.sh b/src/memory_option.sh old mode 100644 new mode 100755 similarity index 100% rename from src/meminfo_option.sh rename to src/memory_option.sh -- GitLab