Skip to content

Commit

Permalink
Add log for git revision (#1293)
Browse files Browse the repository at this point in the history
Will help debugging and identification of specific version
  • Loading branch information
kcudnik committed Sep 21, 2023
1 parent edf6597 commit 31bd92a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ AC_CHECK_FUNCS(sai_bulk_object_clear_stats sai_bulk_object_get_stats)
CXXFLAGS="$SAVED_FLAGS"
])

AC_DEFINE([SAIREDIS_GIT_REVISION],
"[m4_esyscmd([echo -n $(git rev-parse --short HEAD || echo 0000000)])]",
[sairedis git revision information])

AC_DEFINE([SAI_GIT_REVISION],
"[m4_esyscmd([echo -n $(cd SAI && git rev-parse --short HEAD || echo 0000000)])]",
[SAI git revision information])

AC_OUTPUT(Makefile
meta/Makefile
lib/Makefile
Expand Down
4 changes: 4 additions & 0 deletions lib/RedisRemoteSaiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "meta/PerformanceIntervalTimer.h"
#include "meta/Globals.h"

#include "config.h"

#include <inttypes.h>

using namespace sairedis;
Expand All @@ -37,6 +39,8 @@ RedisRemoteSaiInterface::RedisRemoteSaiInterface(
{
SWSS_LOG_ENTER();

SWSS_LOG_NOTICE("sairedis git revision %s, SAI git revision: %s", SAIREDIS_GIT_REVISION, SAI_GIT_REVISION);

m_initialized = false;

initialize(0, nullptr);
Expand Down
4 changes: 4 additions & 0 deletions syncd/Syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

#include "vslib/saivs.h"

#include "config.h"

#include <unistd.h>
#include <inttypes.h>

Expand Down Expand Up @@ -63,6 +65,8 @@ Syncd::Syncd(
{
SWSS_LOG_ENTER();

SWSS_LOG_NOTICE("sairedis git revision %s, SAI git revision: %s", SAIREDIS_GIT_REVISION, SAI_GIT_REVISION);

setSaiApiLogLevel();

SWSS_LOG_NOTICE("command line: %s", m_commandLineOptions->getCommandLineString().c_str());
Expand Down

0 comments on commit 31bd92a

Please sign in to comment.