diff options
author | Jason Evans <je@facebook.com> | 2010-03-02 21:01:16 (GMT) |
---|---|---|
committer | Jason Evans <je@facebook.com> | 2010-03-02 21:01:16 (GMT) |
commit | a40bc7afe8ae71b05eba81805c87d92e9bf6ce27 (patch) | |
tree | 1d4debec1893cc5e69b5c7b4774db1948f46951f | |
parent | 22ca855e8fbf4c592f5e46aaec381b68de60c71a (diff) | |
download | jemalloc-a40bc7afe8ae71b05eba81805c87d92e9bf6ce27.zip jemalloc-a40bc7afe8ae71b05eba81805c87d92e9bf6ce27.tar.gz jemalloc-a40bc7afe8ae71b05eba81805c87d92e9bf6ce27.tar.bz2 |
Add release versioning support.0.0.0
Base version string on 'git describe --long', and provide cpp
macros in jemalloc.h.
Add the version mallctl.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | jemalloc/Makefile.in | 1 | ||||
-rw-r--r-- | jemalloc/VERSION | 1 | ||||
-rw-r--r-- | jemalloc/configure.ac | 16 | ||||
-rw-r--r-- | jemalloc/doc/jemalloc.3.in | 5 | ||||
-rw-r--r-- | jemalloc/include/jemalloc/jemalloc.h.in | 7 | ||||
-rw-r--r-- | jemalloc/src/ctl.c | 4 |
7 files changed, 33 insertions, 2 deletions
@@ -14,3 +14,4 @@ /jemalloc/src/jemalloc\.h /jemalloc/src/jemalloc_defs\.h /jemalloc/src/*.[od] +/jemalloc/VERSION diff --git a/jemalloc/Makefile.in b/jemalloc/Makefile.in index 788fedc..96f1e74 100644 --- a/jemalloc/Makefile.in +++ b/jemalloc/Makefile.in @@ -100,6 +100,7 @@ distclean: clean relclean: distclean rm -rf @objroot@autom4te.cache rm -f @objroot@configure + rm -f @srcroot@VERSION #=============================================================================== # Re-configuration rules. diff --git a/jemalloc/VERSION b/jemalloc/VERSION deleted file mode 100644 index 77d6f4c..0000000 --- a/jemalloc/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.0 diff --git a/jemalloc/configure.ac b/jemalloc/configure.ac index 918be8b..4d2d66a 100644 --- a/jemalloc/configure.ac +++ b/jemalloc/configure.ac @@ -563,9 +563,23 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM( dnl ============================================================================ dnl jemalloc configuration. dnl + +dnl Set VERSION if source directory has an embedded git repository. +if test -d "${srcroot}../.git" ; then + git describe --long > ${srcroot}VERSION +fi jemalloc_version=`cat ${srcroot}VERSION` -AC_DEFINE_UNQUOTED([JEMALLOC_VERSION], ["$jemalloc_version"]) +jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'` +jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'` +jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'` +jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'` +jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'` AC_SUBST([jemalloc_version]) +AC_SUBST([jemalloc_version_major]) +AC_SUBST([jemalloc_version_minor]) +AC_SUBST([jemalloc_version_bugfix]) +AC_SUBST([jemalloc_version_nrev]) +AC_SUBST([jemalloc_version_gid]) dnl ============================================================================ dnl Configure pthreads. diff --git a/jemalloc/doc/jemalloc.3.in b/jemalloc/doc/jemalloc.3.in index 306b569..fca1106 100644 --- a/jemalloc/doc/jemalloc.3.in +++ b/jemalloc/doc/jemalloc.3.in @@ -640,6 +640,11 @@ introspection. @roff_stats@can be used to access the summation of statistics from all arenas. .Bl -ohang .\"----------------------------------------------------------------------------- +.It Sy "version (const char *) r-" +.Bd -ragged -offset indent -compact +Return the jemalloc version string. +.Ed +.\"----------------------------------------------------------------------------- .It Sy "epoch (uint64_t) rw" .Bd -ragged -offset indent -compact If a value is passed in, refresh the data from which the diff --git a/jemalloc/include/jemalloc/jemalloc.h.in b/jemalloc/include/jemalloc/jemalloc.h.in index baa8459..537d766 100644 --- a/jemalloc/include/jemalloc/jemalloc.h.in +++ b/jemalloc/include/jemalloc/jemalloc.h.in @@ -4,6 +4,13 @@ extern "C" { #endif +#define JEMALLOC_VERSION "@jemalloc_version@" +#define JEMALLOC_VERSION_MAJOR @jemalloc_version_major@ +#define JEMALLOC_VERSION_MINOR @jemalloc_version_minor@ +#define JEMALLOC_VERSION_BUGFIX @jemalloc_version_bugfix@ +#define JEMALLOC_VERSION_NREV @jemalloc_version_nrev@ +#define JEMALLOC_VERSION_GID "@jemalloc_version_gid@" + #include "jemalloc_defs@install_suffix@.h" #ifndef JEMALLOC_P # define JEMALLOC_P(s) s diff --git a/jemalloc/src/ctl.c b/jemalloc/src/ctl.c index aa7e53d..33ddbb5 100644 --- a/jemalloc/src/ctl.c +++ b/jemalloc/src/ctl.c @@ -30,6 +30,7 @@ static bool ctl_init(void); static int ctl_lookup(const char *name, ctl_node_t const **nodesp, size_t *mibp, size_t *depthp); +CTL_PROTO(version) CTL_PROTO(epoch) #ifdef JEMALLOC_TCACHE CTL_PROTO(tcache_flush) @@ -426,6 +427,7 @@ static const ctl_node_t swap_node[] = { #endif static const ctl_node_t root_node[] = { + {NAME("version"), CTL(version)}, {NAME("epoch"), CTL(epoch)}, #ifdef JEMALLOC_TCACHE {NAME("tcache"), CHILD(tcache)}, @@ -916,6 +918,8 @@ RETURN: \ return (ret); \ } +CTL_RO_GEN(version, JEMALLOC_VERSION, const char *) + static int epoch_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) |