Skip to content
Snippets Groups Projects
Commit a9496a7f authored by floreal.risso's avatar floreal.risso
Browse files

update: add in autoconf

parent f1348876
No related branches found
No related tags found
2 merge requests!9fix sensor example (doc),!7Add memory counters and fix makefile
......@@ -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
......
......@@ -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"
......
......@@ -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)
......
......@@ -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,
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment