@@ -14,6 +14,8 @@ using json = nlohmann::json;
14
14
int char_to_int (
15
15
_In_ const char c)
16
16
{
17
+ SWSS_LOG_ENTER ();
18
+
17
19
if (c >= ' 0' && c <= ' 9' )
18
20
return c - ' 0' ;
19
21
@@ -29,6 +31,8 @@ int char_to_int(
29
31
template <class T , typename U>
30
32
T* sai_alloc_n_of_ptr_type (U count, T*)
31
33
{
34
+ SWSS_LOG_ENTER ();
35
+
32
36
return new T[count];
33
37
}
34
38
@@ -37,6 +41,8 @@ void sai_alloc_list(
37
41
_In_ T count,
38
42
_In_ U &element)
39
43
{
44
+ SWSS_LOG_ENTER ();
45
+
40
46
element.count = count;
41
47
element.list = sai_alloc_n_of_ptr_type (count, element.list );
42
48
}
@@ -45,6 +51,8 @@ template<typename T>
45
51
void sai_free_list (
46
52
_In_ T &element)
47
53
{
54
+ SWSS_LOG_ENTER ();
55
+
48
56
delete[] element.list ;
49
57
element.list = NULL ;
50
58
}
@@ -54,6 +62,8 @@ void transfer_primitive(
54
62
_In_ const T &src_element,
55
63
_In_ T &dst_element)
56
64
{
65
+ SWSS_LOG_ENTER ();
66
+
57
67
const unsigned char * src_mem = reinterpret_cast <const unsigned char *>(&src_element);
58
68
unsigned char * dst_mem = reinterpret_cast <unsigned char *>(&dst_element);
59
69
@@ -66,6 +76,8 @@ sai_status_t transfer_list(
66
76
_In_ T &dst_element,
67
77
_In_ bool countOnly)
68
78
{
79
+ SWSS_LOG_ENTER ();
80
+
69
81
if (countOnly || dst_element.count == 0 )
70
82
{
71
83
transfer_primitive (src_element.count , dst_element.count );
@@ -115,6 +127,8 @@ sai_status_t transfer_attribute(
115
127
_In_ sai_attribute_t &dst_attr,
116
128
_In_ bool countOnly)
117
129
{
130
+ SWSS_LOG_ENTER ();
131
+
118
132
switch (serialization_type)
119
133
{
120
134
case SAI_ATTR_VALUE_TYPE_BOOL:
@@ -378,6 +392,8 @@ sai_status_t transfer_attributes(
378
392
_In_ sai_attribute_t *dst_attr_list,
379
393
_In_ bool countOnly)
380
394
{
395
+ SWSS_LOG_ENTER ();
396
+
381
397
for (uint32_t i = 0 ; i < attr_count; i++)
382
398
{
383
399
const sai_attribute_t &src_attr = src_attr_list[i];
@@ -571,6 +587,8 @@ std::string sai_serialize_enum(
571
587
_In_ const int32_t value,
572
588
_In_ const sai_enum_metadata_t * meta)
573
589
{
590
+ SWSS_LOG_ENTER ();
591
+
574
592
if (meta == NULL )
575
593
{
576
594
return sai_serialize_number (value);
@@ -593,6 +611,8 @@ std::string sai_serialize_number(
593
611
_In_ const uint32_t number,
594
612
_In_ bool hex)
595
613
{
614
+ SWSS_LOG_ENTER ();
615
+
596
616
return sai_serialize_number<uint32_t >(number, hex);
597
617
}
598
618
@@ -623,12 +643,16 @@ std::string sai_serialize_common_api(
623
643
std::string sai_serialize_object_type (
624
644
_In_ const sai_object_type_t object_type)
625
645
{
646
+ SWSS_LOG_ENTER ();
647
+
626
648
return sai_serialize_enum (object_type, &sai_metadata_enum_sai_object_type_t );
627
649
}
628
650
629
651
std::string sai_serialize_attr_value_type (
630
652
_In_ const sai_attr_value_type_t attr_value_type)
631
653
{
654
+ SWSS_LOG_ENTER ();
655
+
632
656
return sai_serialize_enum (attr_value_type, &sai_metadata_enum_sai_attr_value_type_t );
633
657
}
634
658
@@ -824,6 +848,8 @@ std::string sai_serialize_ip_address(
824
848
std::string sai_serialize_object_id (
825
849
_In_ sai_object_id_t oid)
826
850
{
851
+ SWSS_LOG_ENTER ();
852
+
827
853
char buf[32 ];
828
854
829
855
snprintf (buf, sizeof (buf), " oid:0x%lx" , oid);
@@ -900,6 +926,8 @@ std::string sai_serialize_number_list(
900
926
json sai_serialize_qos_map_params (
901
927
_In_ const sai_qos_map_params_t & params)
902
928
{
929
+ SWSS_LOG_ENTER ();
930
+
903
931
json j;
904
932
905
933
j[" tc" ] = params.tc ;
@@ -916,6 +944,8 @@ json sai_serialize_qos_map_params(
916
944
json sai_serialize_qos_map (
917
945
_In_ const sai_qos_map_t & qosmap)
918
946
{
947
+ SWSS_LOG_ENTER ();
948
+
919
949
json j;
920
950
921
951
j[" key" ] = sai_serialize_qos_map_params (qosmap.key );
@@ -958,6 +988,8 @@ std::string sai_serialize_qos_map_list(
958
988
json sai_serialize_tunnel_map_params (
959
989
_In_ const sai_tunnel_map_params_t & params)
960
990
{
991
+ SWSS_LOG_ENTER ();
992
+
961
993
json j;
962
994
963
995
j[" oecn" ] = params.oecn ;
@@ -971,6 +1003,8 @@ json sai_serialize_tunnel_map_params(
971
1003
json sai_serialize_tunnel_map (
972
1004
_In_ const sai_tunnel_map_t & tunnelmap)
973
1005
{
1006
+ SWSS_LOG_ENTER ();
1007
+
974
1008
json j;
975
1009
976
1010
j[" key" ] = sai_serialize_tunnel_map_params (tunnelmap.key );
@@ -1574,6 +1608,8 @@ void sai_deserialize_number(
1574
1608
_Out_ T& number,
1575
1609
_In_ bool hex = false )
1576
1610
{
1611
+ SWSS_LOG_ENTER ();
1612
+
1577
1613
errno = 0 ;
1578
1614
1579
1615
char *endptr = NULL ;
@@ -1591,6 +1627,8 @@ void sai_deserialize_number(
1591
1627
_Out_ uint32_t & number,
1592
1628
_In_ bool hex)
1593
1629
{
1630
+ SWSS_LOG_ENTER ();
1631
+
1594
1632
sai_deserialize_number<uint32_t >(s, number, hex);
1595
1633
}
1596
1634
@@ -1599,6 +1637,8 @@ void sai_deserialize_enum(
1599
1637
_In_ const sai_enum_metadata_t *meta,
1600
1638
_Out_ int32_t & value)
1601
1639
{
1640
+ SWSS_LOG_ENTER ();
1641
+
1602
1642
if (meta == NULL )
1603
1643
{
1604
1644
return sai_deserialize_number (s, value);
@@ -1646,6 +1686,8 @@ void sai_deserialize_object_id(
1646
1686
_In_ const std::string& s,
1647
1687
_Out_ sai_object_id_t & oid)
1648
1688
{
1689
+ SWSS_LOG_ENTER ();
1690
+
1649
1691
if (s.find (" oid:0x" ) != 0 )
1650
1692
{
1651
1693
SWSS_LOG_THROW (" invalid oid %s" , s.c_str ());
@@ -2340,6 +2382,8 @@ void sai_deserialize_object_type(
2340
2382
_In_ const std::string& s,
2341
2383
_Out_ sai_object_type_t & object_type)
2342
2384
{
2385
+ SWSS_LOG_ENTER ();
2386
+
2343
2387
sai_deserialize_enum (s, &sai_metadata_enum_sai_object_type_t , (int32_t &)object_type);
2344
2388
}
2345
2389
@@ -2357,6 +2401,8 @@ void sai_deserialize_fdb_entry_bridge_type(
2357
2401
_In_ const std::string& s,
2358
2402
_Out_ sai_fdb_entry_bridge_type_t & fdb_entry_bridge_type)
2359
2403
{
2404
+ SWSS_LOG_ENTER ();
2405
+
2360
2406
sai_deserialize_enum (s, &sai_metadata_enum_sai_fdb_entry_bridge_type_t , (int32_t &)fdb_entry_bridge_type);
2361
2407
}
2362
2408
#endif
0 commit comments