Skip to content

Commit 3b40a11

Browse files
committed
added manpages
1 parent 5d0649d commit 3b40a11

File tree

5 files changed

+103
-17
lines changed

5 files changed

+103
-17
lines changed

ChangeLog

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

2+
0.3.0 Sun Nov 23 21:12:54 CET 2014
3+
- add manpages
4+
- release
5+
26
0.3.0b2 Thu Nov 20 23:10:47 CET 2014
3-
- backtrace2line.pl support for decoding native lib backtraces
7+
- backtrace2line.pl support for decoding native glibc backtraces
48
- add log-malloc2_util.h inline only helper functions
59

610
0.3.0b Mon Nov 10 00:00:00 CET 2014

Makefile.am

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ dist_libexec_SCRIPTS = scripts/backtrace2line.pl scripts/log-malloc.pl \
2323
libexec_SCRIPTS = scripts/log-malloc.pm
2424

2525
install-exec-hook:
26-
for i in $(dist_libexec_SCRIPTS); do bn=`basename $${i}`; $(LN_S) -f "${libexecdir}/$${bn}" "$(bindir)/$${bn%.pl}"; done;
26+
for i in $(dist_libexec_SCRIPTS); do bn=`basename $${i}`;\
27+
$(LN_S) -f "${libexecdir}/$${bn}" "$(bindir)/$${bn%.pl}"; done;
2728

2829
## pkconfig
2930
pkgconfigdir = $(libdir)/pkgconfig
@@ -35,5 +36,13 @@ dist_noinst_SCRIPTS = autogen.sh
3536
## examples
3637
dist_noinst_DATA = examples/Makefile examples/*.c
3738

39+
# manpages
40+
scripts_man_MANS = $(dist_libexec_SCRIPTS:.pl=.1)
41+
man_MANS = $(scripts_man_MANS)
42+
%.1: %.pl
43+
pod2man --release='$(PACKAGE_VERSION)' --center='$(PACKAGE_NAME)' \
44+
--section=1 $< > $@
45+
CLEANFILES = $(man_MANS)
46+
3847
## test
3948
.PHONY: test

Makefile.in

Lines changed: 84 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ am__uninstall_files_from_dir = { \
101101
$(am__cd) "$$dir" && rm -f $$files; }; \
102102
}
103103
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" \
104-
"$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(pkgconfigdir)" \
105-
"$(DESTDIR)$(pkgincludedir)"
104+
"$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man1dir)" \
105+
"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"
106106
LTLIBRARIES = $(lib_LTLIBRARIES)
107107
liblog_malloc2_la_LIBADD =
108108
am__dirstamp = $(am__leading_dot)dirstamp
@@ -134,6 +134,9 @@ am__can_run_installinfo = \
134134
n|no|NO) false;; \
135135
*) (install-info --version) >/dev/null 2>&1;; \
136136
esac
137+
man1dir = $(mandir)/man1
138+
NROFF = nroff
139+
MANS = $(man_MANS)
137140
DATA = $(dist_noinst_DATA) $(pkgconfig_DATA)
138141
HEADERS = $(pkginclude_HEADERS)
139142
ETAGS = etags
@@ -290,6 +293,11 @@ pkgconfigdir = $(libdir)/pkgconfig
290293
pkgconfig_DATA = log-malloc2.pc
291294
dist_noinst_SCRIPTS = autogen.sh
292295
dist_noinst_DATA = examples/Makefile examples/*.c
296+
297+
# manpages
298+
scripts_man_MANS = $(dist_libexec_SCRIPTS:.pl=.1)
299+
man_MANS = $(scripts_man_MANS)
300+
CLEANFILES = $(man_MANS)
293301
all: config.h
294302
$(MAKE) $(AM_MAKEFLAGS) all-am
295303

@@ -508,6 +516,49 @@ clean-libtool:
508516

509517
distclean-libtool:
510518
-rm -f libtool config.lt
519+
install-man1: $(man_MANS)
520+
@$(NORMAL_INSTALL)
521+
@list1=''; \
522+
list2='$(man_MANS)'; \
523+
test -n "$(man1dir)" \
524+
&& test -n "`echo $$list1$$list2`" \
525+
|| exit 0; \
526+
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
527+
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
528+
{ for i in $$list1; do echo "$$i"; done; \
529+
if test -n "$$list2"; then \
530+
for i in $$list2; do echo "$$i"; done \
531+
| sed -n '/\.1[a-z]*$$/p'; \
532+
fi; \
533+
} | while read p; do \
534+
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
535+
echo "$$d$$p"; echo "$$p"; \
536+
done | \
537+
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
538+
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
539+
sed 'N;N;s,\n, ,g' | { \
540+
list=; while read file base inst; do \
541+
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
542+
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
543+
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
544+
fi; \
545+
done; \
546+
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
547+
while read files; do \
548+
test -z "$$files" || { \
549+
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
550+
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
551+
done; }
552+
553+
uninstall-man1:
554+
@$(NORMAL_UNINSTALL)
555+
@list=''; test -n "$(man1dir)" || exit 0; \
556+
files=`{ for i in $$list; do echo "$$i"; done; \
557+
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
558+
sed -n '/\.1[a-z]*$$/p'; \
559+
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
560+
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
561+
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
511562
install-pkgconfigDATA: $(pkgconfig_DATA)
512563
@$(NORMAL_INSTALL)
513564
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
@@ -604,6 +655,19 @@ distclean-tags:
604655
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
605656

606657
distdir: $(DISTFILES)
658+
@list='$(MANS)'; if test -n "$$list"; then \
659+
list=`for p in $$list; do \
660+
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
661+
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
662+
if test -n "$$list" && \
663+
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
664+
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
665+
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
666+
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
667+
echo " typically \`make maintainer-clean' will remove them" >&2; \
668+
exit 1; \
669+
else :; fi; \
670+
else :; fi
607671
$(am__remove_distdir)
608672
test -d "$(distdir)" || mkdir "$(distdir)"
609673
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -767,9 +831,10 @@ distcleancheck: distclean
767831
exit 1; } >&2
768832
check-am: all-am
769833
check: check-am
770-
all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(DATA) $(HEADERS) config.h
834+
all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) $(HEADERS) \
835+
config.h
771836
installdirs:
772-
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \
837+
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \
773838
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
774839
done
775840
install: install-am
@@ -794,6 +859,7 @@ install-strip:
794859
mostlyclean-generic:
795860

796861
clean-generic:
862+
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
797863

798864
distclean-generic:
799865
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -828,7 +894,8 @@ info: info-am
828894

829895
info-am:
830896

831-
install-data-am: install-pkgconfigDATA install-pkgincludeHEADERS
897+
install-data-am: install-man install-pkgconfigDATA \
898+
install-pkgincludeHEADERS
832899

833900
install-dvi: install-dvi-am
834901

@@ -846,7 +913,7 @@ install-info: install-info-am
846913

847914
install-info-am:
848915

849-
install-man:
916+
install-man: install-man1
850917

851918
install-pdf: install-pdf-am
852919

@@ -879,9 +946,11 @@ ps: ps-am
879946
ps-am:
880947

881948
uninstall-am: uninstall-dist_libexecSCRIPTS uninstall-libLTLIBRARIES \
882-
uninstall-libexecSCRIPTS uninstall-pkgconfigDATA \
949+
uninstall-libexecSCRIPTS uninstall-man uninstall-pkgconfigDATA \
883950
uninstall-pkgincludeHEADERS
884951

952+
uninstall-man: uninstall-man1
953+
885954
.MAKE: all install-am install-exec-am install-strip
886955

887956
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
@@ -896,19 +965,23 @@ uninstall-am: uninstall-dist_libexecSCRIPTS uninstall-libLTLIBRARIES \
896965
install-exec install-exec-am install-exec-hook install-html \
897966
install-html-am install-info install-info-am \
898967
install-libLTLIBRARIES install-libexecSCRIPTS install-man \
899-
install-pdf install-pdf-am install-pkgconfigDATA \
968+
install-man1 install-pdf install-pdf-am install-pkgconfigDATA \
900969
install-pkgincludeHEADERS install-ps install-ps-am \
901970
install-strip installcheck installcheck-am installdirs \
902971
maintainer-clean maintainer-clean-generic mostlyclean \
903972
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
904973
pdf pdf-am ps ps-am tags uninstall uninstall-am \
905974
uninstall-dist_libexecSCRIPTS uninstall-libLTLIBRARIES \
906-
uninstall-libexecSCRIPTS uninstall-pkgconfigDATA \
907-
uninstall-pkgincludeHEADERS
975+
uninstall-libexecSCRIPTS uninstall-man uninstall-man1 \
976+
uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS
908977

909978

910979
install-exec-hook:
911-
for i in $(dist_libexec_SCRIPTS); do bn=`basename $${i}`; $(LN_S) -f "${libexecdir}/$${bn}" "$(bindir)/$${bn%.pl}"; done;
980+
for i in $(dist_libexec_SCRIPTS); do bn=`basename $${i}`;\
981+
$(LN_S) -f "${libexecdir}/$${bn}" "$(bindir)/$${bn%.pl}"; done;
982+
%.1: %.pl
983+
pod2man --release='$(PACKAGE_VERSION)' --center='$(PACKAGE_NAME)' \
984+
--section=1 $< > $@
912985

913986
.PHONY: test
914987

scripts/log-malloc-findleak.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ =head1 DESCRIPTION
306306
This script analyzes input trace file (or part of it) produced by log-malloc2 library, and prints out
307307
suspected memory leaks along with translated backtrace path to code allocating that memory.
308308
309-
NOTE: This script can be also usesd as perl module.
309+
NOTE: This script can be also used as perl module.
310310
311311
=head1 ARGUMENTS
312312

src/log-malloc2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ static void *__init_lib(void)
150150

151151
LOCK_INIT();
152152

153-
fprintf(stderr, "\n *** log-malloc trace-fd = %d *** \n\n",
154-
g_ctx.memlog_fd);
155-
156153
/* open statm */
157154
if(g_statm_path[0] != '\0' && (g_ctx.statm_fd = open(g_statm_path, 0)) == -1)
158155
fprintf(stderr, "\n*** log-malloc: could not open %s\n\n", g_statm_path);
@@ -205,6 +202,9 @@ static void *__init_lib(void)
205202
/* auto-disable trace if file is not open */
206203
if(w == -1 && errno == EBADF)
207204
g_ctx.memlog_disabled = true;
205+
206+
fprintf(stderr, "\n *** log-malloc trace-fd = %d *** \n\n",
207+
g_ctx.memlog_fd);
208208
}
209209

210210
return (void *)0x01;

0 commit comments

Comments
 (0)