ports/99052: [NEW PORT] devel/google-perftools: high-performance memory libary and profiler

Yuri Victorovich yuri at tsoft.com
Fri Jun 16 18:40:17 UTC 2006


>Number:         99052
>Category:       ports
>Synopsis:       [NEW PORT] devel/google-perftools: high-performance memory libary and profiler
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 16 18:40:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Yuri Victorovich
>Release:        6.1
>Organization:
N/A
>Environment:
>Description:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	.
#	./pkg-plist
#	./pkg-descr
#	./distinfo
#	./Makefile
#	./files
#	./files/patch-configure
#	./files/patch-heap-profiler.cc
#	./files/patch-system-alloc.cc
#	./files/patch-tcmalloc.cc
#	./files/patch-t-test1.c
#	./files/patch-t-test2.c
#	./files/patch-ltmain.sh
#	./files/patch-t-test.h
#	./files/patch-maybe_threads.cc
#	./files/patch-thread_lister.c
#	./files/patch-malloc-machine.h
#	./files/patch-Makefile.in
#
echo c - .
mkdir -p . > /dev/null 2>&1
echo x - ./pkg-plist
sed 's/^X//' >./pkg-plist << 'END-of-./pkg-plist'
Xbin/pprof
Xinclude/google/stacktrace.h
Xinclude/google/malloc_hook.h
Xinclude/google/malloc_extension.h
Xinclude/google/heap-profiler.h
Xinclude/google/heap-checker.h
Xinclude/google/profiler.h
Xinclude/google/perftools/config.h
Xinclude/google/perftools/hash_set.h
Xinclude/google/perftools/stacktrace_generic-inl.h
Xinclude/google/perftools/stacktrace_libunwind-inl.h
Xinclude/google/perftools/stacktrace_x86-inl.h
Xinclude/google/perftools/stacktrace_x86_64-inl.h
Xlib/libstacktrace.so.0
Xlib/libstacktrace.so
Xlib/libstacktrace.la
Xlib/libstacktrace.a
Xlib/libtcmalloc_minimal.so.0
Xlib/libtcmalloc_minimal.so
Xlib/libtcmalloc_minimal.la
Xlib/libtcmalloc_minimal.a
Xlib/libtcmalloc.so.0
Xlib/libtcmalloc.so
Xlib/libtcmalloc.la
Xlib/libtcmalloc.a
Xlib/libprofiler.so.0
Xlib/libprofiler.so
Xlib/libprofiler.la
Xlib/libprofiler.a
Xman/man1/pprof.1
X%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
X%%PORTDOCS%%%%DOCSDIR%%/COPYING
X%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
X%%PORTDOCS%%%%DOCSDIR%%/INSTALL
X%%PORTDOCS%%%%DOCSDIR%%/NEWS
X%%PORTDOCS%%%%DOCSDIR%%/README
X%%PORTDOCS%%%%DOCSDIR%%/TODO
X%%PORTDOCS%%%%DOCSDIR%%/index.html
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc.html
X%%PORTDOCS%%%%DOCSDIR%%/overview.gif
X%%PORTDOCS%%%%DOCSDIR%%/pageheap.gif
X%%PORTDOCS%%%%DOCSDIR%%/spanmap.gif
X%%PORTDOCS%%%%DOCSDIR%%/threadheap.gif
X%%PORTDOCS%%%%DOCSDIR%%/t-test1.times.txt
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.1024.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.128.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.131072.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/overview.dot
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.16384.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.2048.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.256.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.32768.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.4096.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.512.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.64.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.65536.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.1.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspercpusec.vs.threads.8192.bytes.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.12.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.16.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.2.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.20.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.3.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.4.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.5.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/tcmalloc-opspersec.vs.size.8.threads.png
X%%PORTDOCS%%%%DOCSDIR%%/pageheap.dot
X%%PORTDOCS%%%%DOCSDIR%%/spanmap.dot
X%%PORTDOCS%%%%DOCSDIR%%/threadheap.dot
X%%PORTDOCS%%%%DOCSDIR%%/heap_profiler.html
X%%PORTDOCS%%%%DOCSDIR%%/heap-example1.png
X%%PORTDOCS%%%%DOCSDIR%%/heap_checker.html
X%%PORTDOCS%%%%DOCSDIR%%/cpu_profiler.html
X%%PORTDOCS%%%%DOCSDIR%%/pprof-test-big.gif
X%%PORTDOCS%%%%DOCSDIR%%/pprof-test.gif
X%%PORTDOCS%%%%DOCSDIR%%/pprof-vsnprintf-big.gif
X%%PORTDOCS%%%%DOCSDIR%%/pprof-vsnprintf.gif
X at dirrm include/google/perftools
X at dirrm include/google
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
END-of-./pkg-plist
echo x - ./pkg-descr
sed 's/^X//' >./pkg-descr << 'END-of-./pkg-descr'
XAn extremely memory-efficient hash_map implementation. 2 bits/entry overhead!
XThe Google SparseHash project contains several hash-map implementations in use
Xat Google, with different performance characteristics, including an
Ximplementation that optimizes for space and one that optimizes for speed.
X
XWWW: http://goog-sparsehash.sourceforge.net
X
X- Vasil Dimov
Xvd at datamax.bg
END-of-./pkg-descr
echo x - ./distinfo
sed 's/^X//' >./distinfo << 'END-of-./distinfo'
XMD5 (google-perftools-0.7.tar.gz) = d569032920a5a10158b0d01e28f54b0d
XSIZE (google-perftools-0.7.tar.gz) = 750015
END-of-./distinfo
echo x - ./Makefile
sed 's/^X//' >./Makefile << 'END-of-./Makefile'
X# New ports collection makefile for:	google-sparsehash
X# Date created:				07 January 2006
X# Whom:					Yuri Victorovich <yuri at tsoft.com>
X#
X# $FreeBSD: ports/devel/google-perftools/Makefile,v 1.0 2006/01/01 00:00:00 xxx Exp $
X#
X
XPORTNAME=	google-perftools
XPORTVERSION=	0.7
XCATEGORIES=	devel
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	goog-perftools
XDISTNAME=	google-perftools-${PORTVERSION}
X
XMAINTAINER=	yuri at tsoft.com
XCOMMENT=	Google's memory management and performance monitoring tools
X
XBUILD_DEPENDS=  ${PORTSDIR}/devel/libexecinfo
X
XGNU_CONFIGURE=	yes
XCONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
XUSE_REINPLACE=	yes
X
Xpost-patch:
X.if !defined(NOPORTDOCS)
X	@${REINPLACE_CMD} -e \
X		's|$$(prefix)/doc/$$(PACKAGE)-$$(VERSION)|${DOCSDIR}|' \
X		${WRKSRC}/Makefile.in
X.else
X	@${REINPLACE_CMD} -e \
X		'/install-data-am/ s|install-dist_docDATA||' \
X		${WRKSRC}/Makefile.in
X.endif
X
Xtests: build
X	@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} check)
X
X.include <bsd.port.mk>
END-of-./Makefile
echo c - ./files
mkdir -p ./files > /dev/null 2>&1
echo x - ./files/patch-configure
sed 's/^X//' >./files/patch-configure << 'END-of-./files/patch-configure'
X--- configure.orig	Mon Nov 14 21:31:37 2005
X+++ configure	        Sat Jan  7 01:49:10 2006
X@@ -19274,8 +19274,8 @@
X #include <$ac_header>
X _ACEOF
X rm -f conftest.$ac_objext
X-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X-  (eval $ac_compile) 2>&5
X+if { (eval echo "$as_me:$LINENO: \"$ac_compile -I/usr/local/include\"") >&5
X+  (eval "$ac_compile -I/usr/local/include") 2>&5
X   ac_status=$?
X   echo "$as_me:$LINENO: \$? = $ac_status" >&5
X   (exit $ac_status); } &&
X@@ -19308,8 +19308,8 @@
X /* end confdefs.h.  */
X #include <$ac_header>
X _ACEOF
X-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\" -I/usr/local/include") >&5
X+  (eval $ac_cpp -I/usr/local/include conftest.$ac_ext) 2>conftest.er1
X   ac_status=$?
X   grep -v '^ *+' conftest.er1 >conftest.err
X   rm -f conftest.er1
END-of-./files/patch-configure
echo x - ./files/patch-heap-profiler.cc
sed 's/^X//' >./files/patch-heap-profiler.cc << 'END-of-./files/patch-heap-profiler.cc'
X--- src/heap-profiler.cc.orig	Wed Oct 26 15:40:17 2005
X+++ src/heap-profiler.cc	Sat Jan  7 01:58:19 2006
X@@ -34,7 +34,7 @@
X 
X #include "config.h"
X 
X-#include <malloc.h>
X+//#include <malloc.h>
X #include <unistd.h>
X #include <fcntl.h>
X #include <glob.h>
X@@ -182,7 +182,7 @@
X     MallocHook::MmapHook saved = MallocHook::SetMmapHook(NULL);
X     void* ptr = mmap(NULL, size,
X                      PROT_READ|PROT_WRITE,
X-                     MAP_PRIVATE|MAP_ANONYMOUS,
X+                     MAP_PRIVATE|MAP_ANON,
X                      -1, 0);
X     MallocHook::SetMmapHook(saved);
X 
END-of-./files/patch-heap-profiler.cc
echo x - ./files/patch-system-alloc.cc
sed 's/^X//' >./files/patch-system-alloc.cc << 'END-of-./files/patch-system-alloc.cc'
X--- src/system-alloc.cc.orig	Sat Jan  7 01:53:30 2006
X+++ src/system-alloc.cc	Sat Jan  7 01:53:43 2006
X@@ -142,7 +142,7 @@
X   // therefore  size + extra < (1<<NBITS)
X   void* result = mmap(NULL, size + extra,
X                       PROT_READ|PROT_WRITE,
X-                      MAP_PRIVATE|MAP_ANONYMOUS,
X+                      MAP_PRIVATE|MAP_ANON,
X                       -1, 0);
X   if (result == reinterpret_cast<void*>(MAP_FAILED)) {
X     mmap_failure = true;
END-of-./files/patch-system-alloc.cc
echo x - ./files/patch-tcmalloc.cc
sed 's/^X//' >./files/patch-tcmalloc.cc << 'END-of-./files/patch-tcmalloc.cc'
X--- src/tcmalloc.cc.orig	Wed Oct 26 15:40:18 2005
X+++ src/tcmalloc.cc	Sat Jan  7 02:09:03 2006
X@@ -73,7 +73,7 @@
X #else
X #include <sys/types.h>
X #endif
X-#include <malloc.h>
X+//#include <malloc.h>
X #include <string.h>
X #include <pthread.h>
X #include <unistd.h>
X@@ -95,6 +95,21 @@
X #else
X #define LLU   "llu"              // hope for the best
X #endif
X+
X+// FreeBSD doesn't have this structure, but here it's only returned, so just bring it in from Linux headers
X+struct mallinfo {
X+  int arena;    /* non-mmapped space allocated from system */
X+  int ordblks;  /* number of free chunks */
X+  int smblks;   /* number of fastbin blocks */
X+  int hblks;    /* number of mmapped regions */
X+  int hblkhd;   /* space in mmapped regions */
X+  int usmblks;  /* maximum total allocated space */
X+  int fsmblks;  /* space available in freed fastbin blocks */
X+  int uordblks; /* total allocated space */
X+  int fordblks; /* total free space */
X+  int keepcost; /* top-most, releasable (via malloc_trim) space */
X+};
X+
X 
X //-------------------------------------------------------------------
X // Configuration
END-of-./files/patch-tcmalloc.cc
echo x - ./files/patch-t-test1.c
sed 's/^X//' >./files/patch-t-test1.c << 'END-of-./files/patch-t-test1.c'
X--- src/tests/ptmalloc/t-test1.c.orig	Sat Jan  7 02:00:19 2006
X+++ src/tests/ptmalloc/t-test1.c	Sat Jan  7 02:00:32 2006
X@@ -17,7 +17,7 @@
X #include <sys/mman.h>
X 
X #if !USE_MALLOC
X-#include <malloc.h>
X+//#include <malloc.h>
X #else
X #include "malloc.h"
X #endif
END-of-./files/patch-t-test1.c
echo x - ./files/patch-t-test2.c
sed 's/^X//' >./files/patch-t-test2.c << 'END-of-./files/patch-t-test2.c'
X--- src/tests/ptmalloc/t-test2.c.orig	Sat Jan  7 02:01:18 2006
X+++ src/tests/ptmalloc/t-test2.c	Sat Jan  7 02:01:27 2006
X@@ -16,7 +16,7 @@
X #include <sys/wait.h>
X 
X #if !USE_MALLOC
X-#include <malloc.h>
X+//#include <malloc.h>
X #else
X #include "malloc.h"
X #endif
END-of-./files/patch-t-test2.c
echo x - ./files/patch-ltmain.sh
sed 's/^X//' >./files/patch-ltmain.sh << 'END-of-./files/patch-ltmain.sh'
X--- ltmain.sh.orig	Thu Jun 16 12:41:16 2005
X+++ ltmain.sh	Sat Jan  7 03:42:17 2006
X@@ -4039,6 +4039,7 @@
X 
X       compile_command="$compile_command $compile_deplibs"
X       finalize_command="$finalize_command $finalize_deplibs"
X+      compile_command="$compile_command -L/usr/local/lib -lexecinfo"
X 
X       if test -n "$rpath$xrpath"; then
X 	# If the user specified any rpath flags, then add them.
X@@ -4509,7 +4510,7 @@
X #include <stdio.h>
X #include <stdlib.h>
X #include <unistd.h>
X-#include <malloc.h>
X+//#include <malloc.h>
X #include <stdarg.h>
X #include <assert.h>
X 
END-of-./files/patch-ltmain.sh
echo x - ./files/patch-t-test.h
sed 's/^X//' >./files/patch-t-test.h << 'END-of-./files/patch-t-test.h'
X--- src/tests/ptmalloc/t-test.h.orig	Sat Jan  7 03:46:59 2006
X+++ src/tests/ptmalloc/t-test.h	Sat Jan  7 03:47:21 2006
X@@ -87,9 +87,9 @@
X #endif
X 	r %= 1024;
X 	/*printf("%d ", r);*/
X-	if(r < 4) { /* memalign */
X-		if(m->size > 0) free(m->ptr);
X-		m->ptr = (unsigned char *)memalign(sizeof(int) << r, size);
X+	if(0) { /* memalign */
X+		//if(m->size > 0) free(m->ptr);
X+		//m->ptr = (unsigned char *)memalign(sizeof(int) << r, size);
X 	} else if(r < 20) { /* calloc */
X 		if(m->size > 0) free(m->ptr);
X 		m->ptr = (unsigned char *)calloc(size, 1);
END-of-./files/patch-t-test.h
echo x - ./files/patch-maybe_threads.cc
sed 's/^X//' >./files/patch-maybe_threads.cc << 'END-of-./files/patch-maybe_threads.cc'
X--- src/maybe_threads.cc.orig	Thu Jun 16 12:41:24 2005
X+++ src/maybe_threads.cc	Sat Jan  7 02:14:20 2006
X@@ -85,9 +85,9 @@
X   if (pthread_once) {
X     return pthread_once(ctl, init_routine);
X   } else {
X-    if (*ctl == PTHREAD_ONCE_INIT) {
X+    if (ctl->state == PTHREAD_NEEDS_INIT) {
X       init_routine();
X-      *ctl = 1;
X+      ctl->state = 1;
X     }
X     return 0;
X   }
END-of-./files/patch-maybe_threads.cc
echo x - ./files/patch-thread_lister.c
sed 's/^X//' >./files/patch-thread_lister.c << 'END-of-./files/patch-thread_lister.c'
X--- src/base/thread_lister.c.orig	Tue Jan 24 13:36:36 2006
X+++ src/base/thread_lister.c	        Fri Jun 16 10:32:12 2006
X@@ -50,12 +50,13 @@
X   va_list ap;
X 
X   va_start(ap, callback);
X-  rc = callback(parameter, 0, NULL, ap);
X+  rc = callback(parameter, 0, 0, ap);
X   va_end(ap);
X   return rc;
X }
X 
X-void ResumeAllProcessThreads(int num_threads, pid_t *thread_pids) {
X+int ResumeAllProcessThreads(int num_threads, pid_t *thread_pids) {
X+  return (0);
X }
X 
X #endif
END-of-./files/patch-thread_lister.c
echo x - ./files/patch-malloc-machine.h
sed 's/^X//' >./files/patch-malloc-machine.h << 'END-of-./files/patch-malloc-machine.h'
X--- src/tests/ptmalloc/malloc-machine.h.orig	Sat Jan  7 03:52:13 2006
X+++ src/tests/ptmalloc/malloc-machine.h	Sat Jan  7 03:52:21 2006
X@@ -78,7 +78,7 @@
X }
X static inline int mutex_unlock(mutex_t *m) {
X   m->lock = 0;
X-  __asm __volatile ("" : "=m" (m->lock) : "0" (m->lock));
X+  //__asm __volatile ("" : "=m" (m->lock) : "0" (m->lock));
X   return 0;
X }
X 
END-of-./files/patch-malloc-machine.h
echo x - ./files/patch-Makefile.in
sed 's/^X//' >./files/patch-Makefile.in << 'END-of-./files/patch-Makefile.in'
X--- Makefile.in.orig	Tue Apr 18 15:48:33 2006
X+++ Makefile.in	        Fri Jun 16 11:11:44 2006
X@@ -119,7 +119,7 @@
X # We'll add to this later, on a library-by-library basis
X perftoolsinclude_HEADERS = $(SGP_STACKTRACE_INCLUDES) $(SGP_TCMALLOC_MINIMAL_INCLUDES) $(SGP_TCMALLOC_INCLUDES) $(SGP_CPU_PROFILER_INCLUDES)
X 
X-docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
X+docdir = $(prefix)/share/doc/$(PACKAGE)
X # This is for HTML and other documentation you want to install.
X # Add your documentation files (in doc/) in addition to these
X # top-level boilerplate files.  Also add a TODO file if you have one.
X@@ -618,7 +618,7 @@
X 	$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
X CCLD = $(CC)
X LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
X-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
X+	$(AM_LDFLAGS) $(LDFLAGS) -L/usr/local/lib -o $@
X CFLAGS = @CFLAGS@
X CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
X 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
X@@ -627,7 +627,7 @@
X 	$(AM_CXXFLAGS) $(CXXFLAGS)
X CXXLD = $(CXX)
X CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
X-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
X+	$(AM_LDFLAGS) $(LDFLAGS) -L/usr/local/lib -o $@
X CXXFLAGS = @CXXFLAGS@
X DIST_SOURCES = $(libprofiler_la_SOURCES) $(libstacktrace_la_SOURCES) \
X 	$(libtcmalloc_la_SOURCES) $(libtcmalloc_minimal_la_SOURCES) \
END-of-./files/patch-Makefile.in
exit


>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list