Introduced the Build ID in INFO and --version output.

The idea is to be able to identify a build in a unique way, so for
instance after a bug report we can recognize that the build is the one
of a popular Linux distribution and perform the debugging in the same
environment.
This commit is contained in:
antirez
2012-11-29 14:20:08 +01:00
parent cd99c14e38
commit 3b71404d70
9 changed files with 30 additions and 9 deletions

View File

@ -1868,6 +1868,7 @@ sds genRedisInfoString(char *section) {
"redis_version:%s\r\n"
"redis_git_sha1:%s\r\n"
"redis_git_dirty:%d\r\n"
"redis_build_id:%llx\r\n"
"redis_mode:%s\r\n"
"os:%s %s %s\r\n"
"arch_bits:%d\r\n"
@ -1882,6 +1883,7 @@ sds genRedisInfoString(char *section) {
REDIS_VERSION,
redisGitSHA1(),
strtol(redisGitDirty(),NULL,10) > 0,
redisBuildId(),
mode,
name.sysname, name.release, name.machine,
server.arch_bits,
@ -2417,12 +2419,13 @@ void daemonize(void) {
}
void version() {
printf("Redis server v=%s sha=%s:%d malloc=%s bits=%d\n",
printf("Redis server v=%s sha=%s:%d malloc=%s bits=%d build=%llx\n",
REDIS_VERSION,
redisGitSHA1(),
atoi(redisGitDirty()) > 0,
ZMALLOC_LIB,
sizeof(long) == 4 ? 32 : 64);
sizeof(long) == 4 ? 32 : 64,
redisBuildId());
exit(0);
}