path: root/Makefile
diff options
authorArne Jansen <>2011-11-28 17:12:30 +0100
committerDavid Sterba <>2013-03-19 18:24:51 +0100
commit6d37fbfc1f83c34f00df7c9d8e5b60e49d9db48d (patch)
treea0c2b1b2959a61f5ae0680ceb83a86d9f3c5aae1 /Makefile
parent4739e7332cd70c18cdd783f37246d3cdcabff98b (diff)
Btrfs-progs: tool to visualize fragmentation
This tool draws per-chunk pngs representing the allocation map. A black or colored dot means the block is allocated. The output is written to a subdirectory, together with an index.html to be viewed in a browser. There are options to control whether color should be used and which block group types should be printed. To build, you need to have libpng and libgd installed. It is not part of the 'all' target, so please build it explicitely with make btrfs-fragments. A (rather untypical) example can be seen at Please regard this as a first scratch version and feel free to improve it :) Signed-off-by: Arne Jansen <>
Diffstat (limited to 'Makefile')
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 2648d374..a270e9ca 100644
--- a/Makefile
+++ b/Makefile
@@ -186,6 +186,10 @@ btrfs-convert: $(objects) $(libs) convert.o
@echo " [LD] $@"
$(Q)$(CC) $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs -lcom_err $(LDFLAGS) $(LIBS)
+btrfs-fragments: $(objects) $(libs) fragments.o
+ @echo " [LD] $@"
+ $(Q)$(CC) $(CFLAGS) -o btrfs-fragments $(objects) fragments.o $(LDFLAGS) $(LIBS) -lgd -lpng -ljpeg -lfreetype
ioctl-test: $(objects) $(libs) ioctl-test.o
@echo " [LD] $@"
$(Q)$(CC) $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS)