From aa8699c4a4dd65ee6842ba3eb5a1fb7a0f11450d Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Wed, 17 Oct 2012 00:55:53 +0300 Subject: [PATCH] reports.mk: diffable logs This is a mild generalization of what has been done by hand to figure out a problem with make-initrd-propagator-0.10-alt1: stripping anything intrinsically volatile off the build.log. The filter set isn't perfect, and the proper logging will involve mkimage tweaks as well (e.g., one generally isn't interested in instrumental chroots' population that much, so it should only be verbose at the higher debug levels). --- reports.mk | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/reports.mk b/reports.mk index 55275b1b..b3bf8160 100644 --- a/reports.mk +++ b/reports.mk @@ -17,7 +17,7 @@ ifneq (1,$(NUM_TARGETS)) SHORTEN := >/dev/null endif -all: reports/targets reports/scripts +all: reports/targets reports/scripts reports/cleanlog @if [ -n "$(IMAGE_OUTPATH)" ]; then \ cp -a "$(REPORTDIR)" "$(LOGDIR)/$(IMAGE_OUTFILE).reports"; \ fi @@ -25,6 +25,31 @@ all: reports/targets reports/scripts reports/prep: @mkdir -p "$(REPORTDIR)" +# try to drop common noise rendering diff(1) mostly useless +reports/cleanlog: reports/prep + @OUT="$(REPORTDIR)/$(@F).log"; \ + sed -r \ + -e 's,$(BUILDDIR),,g' \ + -e '/\/var\/lib\/apt\/lists/d' \ + -e 's/... .. ..:..:..//g' \ + -e 's/\[[0-9]+\]//g' \ + -e '/^(Reading Package Lists|Building Dependency Tree)/d' \ + -e '/^(Fetched|Need to get|After unpacking) /d' \ + -e '/^(Preparing packages for installation|Done\.)/d' \ + -e '/^hsh(|-(initroot|install|fakedev|(mk|rm)chroot|run)): /d' \ + -e '/^(hasher-priv|mkaptbox|(mk|rm)dir): /d' \ + -e '/^mki-((invalidate-|)cache|check-obsolete|prepare): /d' \ + -e '/^(mode of|changed (group|ownership)|removed) /d' \ + -e '/^chroot\/.in\//d' \ + -e '/ has started executing\.$$/d' \ + -e '/\/var\/log\/apt\.log$$/d' \ + -e '/\/usr\/share\/apt\/scripts\/log\.lua/d' \ + -e '/\.rpm$$/d' \ + -e "/' -> '/d" \ + < $(BUILDLOG) \ + > "$(REPORTDIR)/$(@F).log" \ + && echo "** diffable log: $$OUT" $(SHORTEN) + reports/scripts: reports/prep @OUT="$(REPORTDIR)/$(@F).log"; \ grep "^mki.*scripts: Run: " $(BUILDLOG) \