Skip to content

Commit

Permalink
Add support for debug counters (sonic-net#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
daall authored and lguohan committed Sep 20, 2019
1 parent 1ed09e0 commit 59e530a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/inc/sai_redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ extern const sai_udf_api_t redis_udf_api;
extern const sai_virtual_router_api_t redis_virtual_router_api;
extern const sai_vlan_api_t redis_vlan_api;
extern const sai_wred_api_t redis_wred_api;
extern const sai_debug_counter_api_t redis_debug_counter_api;

#define UNREFERENCED_PARAMETER(X)

Expand Down
1 change: 1 addition & 0 deletions lib/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ libsairedis_la_SOURCES = \
sai_redis_bmtor.cpp \
sai_redis_bridge.cpp \
sai_redis_buffer.cpp \
sai_redis_debug_counter.cpp \
sai_redis_dtel.cpp \
sai_redis_fdb.cpp \
sai_redis_hash.cpp \
Expand Down
7 changes: 7 additions & 0 deletions lib/src/sai_redis_debug_counter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "sai_redis.h"

REDIS_GENERIC_QUAD(DEBUG_COUNTER,debug_counter);

const sai_debug_counter_api_t redis_debug_counter_api = {
REDIS_GENERIC_QUAD_API(debug_counter)
};
1 change: 1 addition & 0 deletions lib/src/sai_redis_interfacequery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ sai_status_t sai_api_query(
API_CASE(VIRTUAL_ROUTER,virtual_router);
API_CASE(VLAN,vlan);
API_CASE(WRED,wred);
API_CASE(DEBUG_COUNTER,debug_counter);

default:
SWSS_LOG_ERROR("Invalid API type %d", sai_api_id);
Expand Down
1 change: 1 addition & 0 deletions vslib/inc/sai_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ extern const sai_udf_api_t vs_udf_api;
extern const sai_virtual_router_api_t vs_virtual_router_api;
extern const sai_vlan_api_t vs_vlan_api;
extern const sai_wred_api_t vs_wred_api;
extern const sai_debug_counter_api_t vs_debug_counter_api;

// OID QUAD

Expand Down
3 changes: 2 additions & 1 deletion vslib/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ lib_LTLIBRARIES = libsaivs.la
libsaivs_la_SOURCES = \
sai_vs_acl.cpp \
sai_vs_bfd.cpp \
sai_vs_bmtor.cpp \
sai_vs_bmtor.cpp \
sai_vs_bridge.cpp \
sai_vs_buffer.cpp \
sai_vs_debug_counter.cpp\
sai_vs_dtel.cpp \
sai_vs_fdb.cpp \
sai_vs_hash.cpp \
Expand Down
8 changes: 8 additions & 0 deletions vslib/src/sai_vs_debug_counter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "sai_vs.h"
#include "sai_vs_internal.h"

VS_GENERIC_QUAD(DEBUG_COUNTER,debug_counter);

const sai_debug_counter_api_t vs_debug_counter_api = {
VS_GENERIC_QUAD_API(debug_counter)
};

0 comments on commit 59e530a

Please sign in to comment.