Skip to content

Commit

Permalink
using PRI instead of %l to support 32 bit arch (sonic-net#1162)
Browse files Browse the repository at this point in the history
* using PRI instead of %l to support 32 bit arch
  • Loading branch information
banagiri authored Mar 7, 2020
1 parent fb8b6a0 commit 0acf65d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions orchagent/copporch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ bool CoppOrch::removeGenetlinkHostIf(string trap_group_name)
sai_status = sai_hostif_api->remove_hostif_table_entry(hostTableEntry->second);
if(sai_status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to delete hostif table entry %ld \
SWSS_LOG_ERROR("Failed to delete hostif table entry %" PRId64 " \
on trap group %s. rc=%d", hostTableEntry->second,
trap_group_name.c_str(), sai_status);
return false;
Expand All @@ -441,7 +441,7 @@ bool CoppOrch::removeGenetlinkHostIf(string trap_group_name)
sai_status = sai_hostif_api->remove_hostif(hostInfo->second);
if(sai_status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to delete host info %ld on trap group %s. rc=%d",
SWSS_LOG_ERROR("Failed to delete host info %" PRId64 " on trap group %s. rc=%d",
hostInfo->second, trap_group_name.c_str(), sai_status);
return false;
}
Expand Down Expand Up @@ -735,7 +735,7 @@ task_process_status CoppOrch::processCoppRule(Consumer& consumer)
sai_status = sai_hostif_api->remove_hostif_trap(it.second.trap_obj);
if (sai_status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to remove trap object %ld", it.second.trap_obj);
SWSS_LOG_ERROR("Failed to remove trap object %" PRId64 "", it.second.trap_obj);
return task_process_status::task_failed;
}
}
Expand Down
2 changes: 1 addition & 1 deletion orchagent/debug_counter/debug_counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void DebugCounter::addDebugCounterToSAI(const int num_attributes, const sai_attr
throw std::runtime_error("Failed to create debug counter");
}

SWSS_LOG_DEBUG("Created debug counter '%s' with OID=%lu", name.c_str(), debug_counter_id);
SWSS_LOG_DEBUG("Created debug counter '%s' with OID=%" PRIu64 "" , name.c_str(), debug_counter_id);
counter_id = debug_counter_id;
}

Expand Down
2 changes: 2 additions & 0 deletions orchagent/debug_counter/debug_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <inttypes.h>


extern "C" {
#include "sai.h"
Expand Down
6 changes: 3 additions & 3 deletions orchagent/flex_counter/flex_counter_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void FlexCounterManager::setCounterIdList(
flex_counter_table->set(getFlexCounterTableKey(group_name, object_id), field_values);
installed_counters.insert(object_id);

SWSS_LOG_DEBUG("Updated flex counter id list for object '%lu' in group '%s'.",
SWSS_LOG_DEBUG("Updated flex counter id list for object '%" PRIu64 "' in group '%s'.",
object_id,
group_name.c_str());
}
Expand All @@ -183,7 +183,7 @@ void FlexCounterManager::clearCounterIdList(const sai_object_id_t object_id)
auto counter_it = installed_counters.find(object_id);
if (counter_it == installed_counters.end())
{
SWSS_LOG_WARN("No counters found on object '%lu' in group '%s'.",
SWSS_LOG_WARN("No counters found on object '%" PRIu64 "' in group '%s'.",
object_id,
group_name.c_str());
return;
Expand All @@ -192,7 +192,7 @@ void FlexCounterManager::clearCounterIdList(const sai_object_id_t object_id)
flex_counter_table->del(getFlexCounterTableKey(group_name, object_id));
installed_counters.erase(counter_it);

SWSS_LOG_DEBUG("Cleared flex counter id list for object '%lu' in group '%s'.",
SWSS_LOG_DEBUG("Cleared flex counter id list for object '%" PRIu64 "' in group '%s'.",
object_id,
group_name.c_str());
}
Expand Down
1 change: 1 addition & 0 deletions orchagent/flex_counter/flex_counter_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <unordered_map>
#include "dbconnector.h"
#include "producertable.h"
#include <inttypes.h>

extern "C" {
#include "sai.h"
Expand Down
4 changes: 2 additions & 2 deletions orchagent/routeorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,14 +1081,14 @@ bool RouteOrch::removeRoute(sai_object_id_t vrf_id, const IpPrefix &ipPrefix)
auto it_route_table = m_syncdRoutes.find(vrf_id);
if (it_route_table == m_syncdRoutes.end())
{
SWSS_LOG_INFO("Failed to find route table, vrf_id 0x%lx\n", vrf_id);
SWSS_LOG_INFO("Failed to find route table, vrf_id 0x%" PRIx64 "\n", vrf_id);
return true;
}

auto it_route = it_route_table->second.find(ipPrefix);
if (it_route == it_route_table->second.end())
{
SWSS_LOG_INFO("Failed to find route entry, vrf_id 0x%lx, prefix %s\n", vrf_id,
SWSS_LOG_INFO("Failed to find route entry, vrf_id 0x%" PRIx64 ", prefix %s\n", vrf_id,
ipPrefix.to_string().c_str());
return true;
}
Expand Down
8 changes: 4 additions & 4 deletions orchagent/sfloworch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bool SflowOrch::sflowDestroySession(SflowSession &session)
sai_rc = sai_samplepacket_api->remove_samplepacket(session.m_sample_id);
if (sai_rc != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to destroy sample packet session with id %lx",
SWSS_LOG_ERROR("Failed to destroy sample packet session with id %" PRIx64 "",
session.m_sample_id);
return false;
}
Expand Down Expand Up @@ -88,7 +88,7 @@ bool SflowOrch::sflowUpdateRate(sai_object_id_t port_id, uint32_t rate)
{
if (!sflowDestroySession(m_sflowRateSampleMap[old_rate]))
{
SWSS_LOG_ERROR("Failed to clean old session %lx with rate %d",
SWSS_LOG_ERROR("Failed to clean old session %" PRIx64 " with rate %d",
m_sflowRateSampleMap[old_rate].m_sample_id, old_rate);
}
else
Expand All @@ -110,7 +110,7 @@ bool SflowOrch::sflowAddPort(sai_object_id_t sample_id, sai_object_id_t port_id)

if (sai_rc != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to set session %lx on port %lx", sample_id, port_id);
SWSS_LOG_ERROR("Failed to set session %" PRIx64 " on port %" PRIx64 , sample_id, port_id);
return false;
}
return true;
Expand All @@ -127,7 +127,7 @@ bool SflowOrch::sflowDelPort(sai_object_id_t port_id)

if (sai_rc != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to delete session on port %lx", port_id);
SWSS_LOG_ERROR("Failed to delete session on port %" PRIx64 , port_id);
return false;
}
return true;
Expand Down
1 change: 1 addition & 0 deletions orchagent/sfloworch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <map>
#include <string>
#include <inttypes.h>

#include "orch.h"
#include "portsorch.h"
Expand Down

0 comments on commit 0acf65d

Please sign in to comment.