forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[syncd] Add event name to timer watchdog (sonic-net#868)
When watchdog thread will exceed 30sec it will print currently executing event like create/remove/get/set. This data can be also found in sairedis.rec, but this PR will also print this in syslog for convenience.
- Loading branch information
Showing
7 changed files
with
103 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "WatchdogScope.h" | ||
|
||
using namespace syncd; | ||
|
||
WatchdogScope::WatchdogScope( | ||
_In_ TimerWatchdog& tw, | ||
_In_ const std::string eventName): | ||
m_tw(tw) | ||
{ | ||
// SWSS_LOG_ENTER(); // disabled | ||
|
||
m_tw.setStartTime(); | ||
|
||
m_tw.setEventName(eventName); | ||
} | ||
|
||
WatchdogScope::~WatchdogScope() | ||
{ | ||
// SWSS_LOG_ENTER(); // disabled | ||
|
||
m_tw.setEndTime(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include "TimerWatchdog.h" | ||
|
||
namespace syncd | ||
{ | ||
class WatchdogScope | ||
{ | ||
public: | ||
|
||
WatchdogScope( | ||
_In_ TimerWatchdog& tw, | ||
_In_ const std::string eventName); | ||
|
||
~WatchdogScope(); | ||
|
||
private: | ||
|
||
TimerWatchdog& m_tw; | ||
}; | ||
} |