Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[counter] Fix port flex counter #1052

Merged
merged 5 commits into from
Jun 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove some debug logs
jimmyzhai committed Jun 3, 2022
commit 5628744c88a937dca095bf3d61cffd9e3404b0ea
19 changes: 4 additions & 15 deletions syncd/FlexCounter.cpp
Original file line number Diff line number Diff line change
@@ -2431,7 +2431,7 @@ void FlexCounter::endFlexCounterThread(void)
}

sai_status_t FlexCounter::querySupportedPortCounters(
_In_ sai_object_id_t portRid, PortCountersSet &supportedPortCounters)
_In_ sai_object_id_t portRid, _Out_ PortCountersSet &supportedPortCounters)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one parameter per line

{
SWSS_LOG_ENTER();

@@ -2445,10 +2445,6 @@ sai_status_t FlexCounter::querySupportedPortCounters(
SAI_OBJECT_TYPE_PORT,
&stats_capability);

SWSS_LOG_NOTICE("queryStatsCapability on port RID %s: %s",
sai_serialize_object_id(portRid).c_str(),
sai_serialize_status(status).c_str());

/* Second call is for query statistics capability */
if (status == SAI_STATUS_BUFFER_OVERFLOW)
{
@@ -2461,7 +2457,7 @@ sai_status_t FlexCounter::querySupportedPortCounters(

if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_NOTICE("Unable to get port supported counters for %s: %s",
SWSS_LOG_NOTICE("Unable to query port supported counters for %s: %s",
sai_serialize_object_id(portRid).c_str(),
sai_serialize_status(status).c_str());
}
@@ -2471,9 +2467,6 @@ sai_status_t FlexCounter::querySupportedPortCounters(
{
sai_port_stat_t counter = static_cast<sai_port_stat_t>(statCapability.stat_enum);
supportedPortCounters.insert(counter);
SWSS_LOG_NOTICE("queryStatsCapability counter %s on port RID %s",
sai_serialize_port_stat(counter).c_str(),
sai_serialize_object_id(portRid).c_str());
}
}
}
@@ -2482,7 +2475,7 @@ sai_status_t FlexCounter::querySupportedPortCounters(

void FlexCounter::getSupportedPortCounters(
_In_ sai_object_id_t portRid,
PortCountersSet &supportedPortCounters)
_Out_ PortCountersSet &supportedPortCounters)
{
SWSS_LOG_ENTER();

@@ -2504,17 +2497,13 @@ void FlexCounter::getSupportedPortCounters(
continue;
}

SWSS_LOG_NOTICE("Counter %s is supported on port RID %s: %s",
sai_serialize_port_stat(counter).c_str(),
sai_serialize_object_id(portRid).c_str(),
sai_serialize_status(status).c_str());
supportedPortCounters.insert(counter);
}
}

void FlexCounter::updateSupportedPortCounters(
_In_ sai_object_id_t portRid,
PortCountersSet &supportedPortCounters)
_Out_ PortCountersSet &supportedPortCounters)
{
SWSS_LOG_ENTER();

8 changes: 4 additions & 4 deletions syncd/FlexCounter.h
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ namespace syncd
{
private:

typedef std::set<sai_port_stat_t> PortCountersSet;
FlexCounter(const FlexCounter&) = delete;

public:
@@ -235,17 +234,18 @@ namespace syncd

private: // update supported counters

typedef std::set<sai_port_stat_t> PortCountersSet;
sai_status_t querySupportedPortCounters(
_In_ sai_object_id_t portRid,
PortCountersSet &supportedPortCounters);
_Out_ PortCountersSet &supportedPortCounters);

void getSupportedPortCounters(
_In_ sai_object_id_t portRid,
PortCountersSet &supportedPortCounters);
_Out_ PortCountersSet &supportedPortCounters);

void updateSupportedPortCounters(
_In_ sai_object_id_t portRid,
PortCountersSet &supportedPortCounters);
_Out_ PortCountersSet &supportedPortCounters);

std::vector<sai_port_stat_t> saiCheckSupportedPortDebugCounters(
_In_ sai_object_id_t portRid,