From 6ee846e21a5582b23566dee8214629b12ee6cf13 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 22 Aug 2009 17:40:33 -0300 Subject: [PATCH] micro: Generate data to plot an allocation histogram The newly generated %.h.csv files has how many allocations has been requested for each object (cell) size. A histogram will be plotted based on this data in the future. --- micro/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/micro/Makefile b/micro/Makefile index a1b4734..322c748 100644 --- a/micro/Makefile +++ b/micro/Makefile @@ -17,10 +17,12 @@ sources := $(wildcard *.d) programs := $(addprefix $(BIN_DIR)/,$(sources:.d=)) stat_c := $(addprefix $(STAT_DIR)/,$(addsuffix .c.csv,$(sources:.d=))) stat_a := $(addprefix $(STAT_DIR)/,$(addsuffix .a.csv,$(sources:.d=))) -stat := $(stat_c) $(stat_a) +stat_h := $(addprefix $(STAT_DIR)/,$(addsuffix .h.csv,$(sources:.d=))) +stat := $(stat_c) $(stat_a) $(stat_h) graphs_c := $(addprefix $(PLOT_DIR)/,$(addsuffix .c.eps,$(sources:.d=))) graphs := $(graphs_c) + ifndef V P = @ P_DC = @echo ' DC $@'; @@ -29,6 +31,7 @@ P_CP = @echo ' CP $@'; P_PLOT = @echo ' PLOT $@'; P_MAKE = @echo ' MAKE $@'; P_RUN = @echo ' RUN $<'; +P_AWK = @echo ' AWK $@'; endif # create build directories if they don't already exist @@ -72,6 +75,10 @@ $(STAT_DIR)/split.c.csv $(STAT_DIR)/split.a.csv: $(BIN_DIR)/bible.txt $(BIN_DIR)/bible.txt: bible.txt $(P_CP) cp -l $< $@ +.PRECIOUS: $(STAT_DIR)/%.h.csv +$(STAT_DIR)/%.h.csv: $(STAT_DIR)/%.a.csv + $(P_AWK) awk -F, 'BEGIN { print "Size,Count" } NR > 1 { a[$$3]++ } \ + END { for (i in a) print i "," a[i] }' $< | sort > $@ .PHONY: plot plot: $(graphs) -- 2.43.0