diff options
Diffstat (limited to 'host/lib/transport')
-rw-r--r-- | host/lib/transport/libusb1_base.cpp | 16 | ||||
-rw-r--r-- | host/lib/transport/libusb1_zero_copy.cpp | 2 | ||||
-rw-r--r-- | host/lib/transport/nirio/rpc/rpc_client.cpp | 22 | ||||
-rw-r--r-- | host/lib/transport/nirio_zero_copy.cpp | 8 | ||||
-rw-r--r-- | host/lib/transport/super_recv_packet_handler.hpp | 22 | ||||
-rw-r--r-- | host/lib/transport/super_send_packet_handler.hpp | 2 | ||||
-rw-r--r-- | host/lib/transport/tcp_zero_copy.cpp | 4 | ||||
-rw-r--r-- | host/lib/transport/udp_simple.cpp | 2 | ||||
-rw-r--r-- | host/lib/transport/udp_wsa_zero_copy.cpp | 14 | ||||
-rw-r--r-- | host/lib/transport/udp_zero_copy.cpp | 14 | ||||
-rw-r--r-- | host/lib/transport/xport_benchmarker.hpp | 2 | ||||
-rw-r--r-- | host/lib/transport/zero_copy_recv_offload.cpp | 4 |
12 files changed, 56 insertions, 56 deletions
diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp index 720e54e4d..2a6fc2b8a 100644 --- a/host/lib/transport/libusb1_base.cpp +++ b/host/lib/transport/libusb1_base.cpp @@ -17,7 +17,7 @@ #include "libusb1_base.hpp" #include <uhd/exception.hpp> -#include <uhd/utils/msg.hpp> + #include <uhd/utils/log.hpp> #include <uhd/utils/tasks.hpp> #include <uhd/types/dict.hpp> @@ -76,7 +76,7 @@ private: case LIBUSB_ERROR_NO_DEVICE: throw uhd::io_error(libusb_strerror(LIBUSB_ERROR_NO_DEVICE)); default: - UHD_MSG(error) << __FUNCTION__ << ": " << libusb_strerror((libusb_error)ret) << std::endl; + UHD_LOGGER_ERROR("USB") << __FUNCTION__ << ": " << libusb_strerror((libusb_error)ret) ; break; } } @@ -275,15 +275,15 @@ public: { int ret; ret = libusb_clear_halt(this->get(), recv_endpoint | 0x80); - UHD_LOG << "usb device handle: recv endpoint clear: " << libusb_error_name(ret) << std::endl; + UHD_LOGGER_DEBUG("USB") << "usb device handle: recv endpoint clear: " << libusb_error_name(ret) ; ret = libusb_clear_halt(this->get(), send_endpoint | 0x00); - UHD_LOG << "usb device handle: send endpoint clear: " << libusb_error_name(ret) << std::endl; + UHD_LOGGER_DEBUG("USB") << "usb device handle: send endpoint clear: " << libusb_error_name(ret) ; } void reset_device(void) { int ret = libusb_reset_device(this->get()); - UHD_LOG << "usb device handle: dev Reset: " << libusb_error_name(ret) << std::endl; + UHD_LOGGER_DEBUG("USB") << "usb device handle: dev Reset: " << libusb_error_name(ret) ; } private: @@ -320,12 +320,12 @@ libusb::device_handle::sptr libusb::device_handle::get_cached_handle(device::spt } catch(const uhd::exception &){ #ifdef UHD_PLATFORM_LINUX - UHD_MSG(error) << + UHD_LOGGER_ERROR("USB") << "USB open failed: insufficient permissions.\n" "See the application notes for your device.\n" - << std::endl; + ; #else - UHD_LOG << "USB open failed: device already claimed." << std::endl; + UHD_LOGGER_DEBUG("USB") << "USB open failed: device already claimed." ; #endif throw; } diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index 719893bcd..39666af94 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -19,7 +19,7 @@ #include <uhd/transport/usb_zero_copy.hpp> #include <uhd/transport/buffer_pool.hpp> #include <uhd/transport/bounded_buffer.hpp> -#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp> #include <uhd/exception.hpp> #include <boost/format.hpp> #include <boost/function.hpp> diff --git a/host/lib/transport/nirio/rpc/rpc_client.cpp b/host/lib/transport/nirio/rpc/rpc_client.cpp index 7beaf9974..4dfcd29e0 100644 --- a/host/lib/transport/nirio/rpc/rpc_client.cpp +++ b/host/lib/transport/nirio/rpc/rpc_client.cpp @@ -25,7 +25,7 @@ if (status) { \ status = (static_cast<size_t>((func)) == exp); \ } else { \ - UHD_LOG << "rpc_client operation skipped: " #func "\n"; \ + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client operation skipped: " #func "\n"; \ } \ namespace uhd { namespace usrprio_rpc { @@ -57,7 +57,7 @@ rpc_client::rpc_client ( tcp::resolver::iterator iterator = resolver.resolve(query); boost::asio::connect(_socket, iterator); - UHD_LOG << "rpc_client connected to server." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client connected to server." ; try { //Perform handshake @@ -75,24 +75,24 @@ rpc_client::rpc_client ( _hshake_args_client.version >= _hshake_args_server.oldest_comp_version && status) { - UHD_LOG << "rpc_client bound to server." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client bound to server." ; _wait_for_next_response_header(); //Spawn a thread for the io_service callback handler. This thread will run until rpc_client is destroyed. _io_service_thread.reset(new boost::thread(boost::bind(&boost::asio::io_service::run, &_io_service))); } else { - UHD_LOG << "rpc_client handshake failed." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client handshake failed." ; _exec_err.assign(boost::asio::error::connection_refused, boost::asio::error::get_system_category()); } - UHD_LOG << boost::format("rpc_client archive = %d, rpc_server archive = %d\n.") % + UHD_LOGGER_DEBUG("NIRIO") << boost::format("rpc_client archive = %d, rpc_server archive = %d\n.") % _hshake_args_client.boost_archive_version % _hshake_args_server.boost_archive_version; } catch (boost::exception&) { - UHD_LOG << "rpc_client handshake aborted." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client handshake aborted." ; _exec_err.assign(boost::asio::error::connection_refused, boost::asio::error::get_system_category()); } } catch (boost::exception&) { - UHD_LOG << "rpc_client connection request cancelled/aborted." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client connection request cancelled/aborted." ; _exec_err.assign(boost::asio::error::connection_aborted, boost::asio::error::get_system_category()); } } @@ -136,18 +136,18 @@ const boost::system::error_code& rpc_client::call( //Wait for response using condition variable if (status) { if (!_exec_gate.timed_wait(lock, timeout)) { - UHD_LOG << "rpc_client function timed out." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client function timed out." ; _exec_err.assign(boost::asio::error::timed_out, boost::asio::error::get_system_category()); } } else { - UHD_LOG << "rpc_client connection dropped." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client connection dropped." ; _exec_err.assign(boost::asio::error::connection_aborted, boost::asio::error::get_system_category()); _stop_io_service(); } //Verify that we are talking to the correct endpoint if ((_request.header.client_id != _response.header.client_id) && !_exec_err) { - UHD_LOG << "rpc_client confused about who its talking to." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client confused about who its talking to." ; _exec_err.assign(boost::asio::error::operation_aborted, boost::asio::error::get_system_category()); } @@ -180,7 +180,7 @@ void rpc_client::_handle_response_hdr(const boost::system::error_code& err, size } } else { //Unexpected response. Ignore it. - UHD_LOG << "rpc_client received garbage responses." << std::endl; + UHD_LOGGER_DEBUG("NIRIO") << "rpc_client received garbage responses." ; _exec_err.assign(boost::asio::error::operation_aborted, boost::asio::error::get_system_category()); _wait_for_next_response_header(); diff --git a/host/lib/transport/nirio_zero_copy.cpp b/host/lib/transport/nirio_zero_copy.cpp index 8bec49a5f..e7a37eb08 100644 --- a/host/lib/transport/nirio_zero_copy.cpp +++ b/host/lib/transport/nirio_zero_copy.cpp @@ -19,7 +19,7 @@ #include <stdio.h> #include <uhd/transport/nirio/nirio_fifo.h> #include <uhd/transport/buffer_pool.hpp> -#include <uhd/utils/msg.hpp> + #include <uhd/utils/log.hpp> #include <uhd/utils/atomic.hpp> #include <boost/format.hpp> @@ -131,11 +131,11 @@ public: _xport_params(xport_params), _next_recv_buff_index(0), _next_send_buff_index(0) { - UHD_LOG << boost::format("Creating PCIe transport for channel %d") % instance << std::endl; - UHD_LOG << boost::format("nirio zero-copy RX transport configured with frame size = %u, #frames = %u, buffer size = %u\n") + UHD_LOGGER_DEBUG("NIRIO") << boost::format("Creating PCIe transport for channel %d") % instance ; + UHD_LOGGER_DEBUG("NIRIO") << boost::format("nirio zero-copy RX transport configured with frame size = %u, #frames = %u, buffer size = %u\n") % _xport_params.recv_frame_size % _xport_params.num_recv_frames % (_xport_params.recv_frame_size * _xport_params.num_recv_frames); - UHD_LOG << boost::format("nirio zero-copy TX transport configured with frame size = %u, #frames = %u, buffer size = %u\n") + UHD_LOGGER_DEBUG("NIRIO") << boost::format("nirio zero-copy TX transport configured with frame size = %u, #frames = %u, buffer size = %u\n") % _xport_params.send_frame_size % _xport_params.num_send_frames % (_xport_params.send_frame_size * _xport_params.num_send_frames); _recv_buffer_pool = buffer_pool::make(_xport_params.num_recv_frames, _xport_params.recv_frame_size); diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index b6b4fb937..4abc73398 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -23,7 +23,7 @@ #include <uhd/exception.hpp> #include <uhd/convert.hpp> #include <uhd/stream.hpp> -#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp> #include <uhd/utils/tasks.hpp> #include <uhd/utils/byteswap.hpp> #include <uhd/types/metadata.hpp> @@ -460,7 +460,7 @@ private: const size_t expected_packet_count = _props[index].packet_count; _props[index].packet_count = (info.ifpi.packet_count + 1) & seq_mask; if (expected_packet_count != info.ifpi.packet_count){ - //UHD_MSG(status) << "expected: " << expected_packet_count << " got: " << info.ifpi.packet_count << std::endl; + //UHD_LOGGER_INFO("STREAMER") << "expected: " << expected_packet_count << " got: " << info.ifpi.packet_count; if (_props[index].handle_flowctrl) { // Always update flow control in this case, because we don't // know which packet was dropped and what state the upstream @@ -573,9 +573,9 @@ private: //handle the case where a bad header exists catch(const uhd::value_error &e){ - UHD_MSG(error) << boost::format( + UHD_LOGGER_ERROR("STREAMER") << boost::format( "The receive packet handler caught a value exception.\n%s" - ) % e.what() << std::endl; + ) % e.what(); std::swap(curr_info, next_info); //save progress from curr -> next curr_info.metadata.error_code = rx_metadata_t::ERROR_CODE_BAD_PACKET; return; @@ -613,7 +613,7 @@ private: rx_metadata_t metadata = curr_info.metadata; _props[index].handle_overflow(); curr_info.metadata = metadata; - UHD_MSG(fastpath) << "O"; + UHD_LOG_FASTPATH("O") } curr_info[index].buff.reset(); curr_info[index].copy_buff = nullptr; @@ -635,18 +635,18 @@ private: prev_info[index].ifpi.num_payload_words32*sizeof(uint32_t)/_bytes_per_otw_item, _samp_rate); curr_info.metadata.out_of_sequence = true; curr_info.metadata.error_code = rx_metadata_t::ERROR_CODE_OVERFLOW; - UHD_MSG(fastpath) << "D"; + UHD_LOG_FASTPATH("D") return; } //too many iterations: detect alignment failure if (iterations++ > _alignment_failure_threshold){ - UHD_MSG(error) << boost::format( - "The receive packet handler failed to time-align packets.\n" - "%u received packets were processed by the handler.\n" - "However, a timestamp match could not be determined.\n" - ) % iterations << std::endl; + UHD_LOGGER_ERROR("STREAMER") << boost::format( + "The receive packet handler failed to time-align packets. " + "%u received packets were processed by the handler. " + "However, a timestamp match could not be determined." + ) % iterations; std::swap(curr_info, next_info); //save progress from curr -> next curr_info.metadata.error_code = rx_metadata_t::ERROR_CODE_ALIGNMENT; _props[index].handle_overflow(); diff --git a/host/lib/transport/super_send_packet_handler.hpp b/host/lib/transport/super_send_packet_handler.hpp index 09ae0c882..8ad76fa39 100644 --- a/host/lib/transport/super_send_packet_handler.hpp +++ b/host/lib/transport/super_send_packet_handler.hpp @@ -23,7 +23,7 @@ #include <uhd/exception.hpp> #include <uhd/convert.hpp> #include <uhd/stream.hpp> -#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp> #include <uhd/utils/tasks.hpp> #include <uhd/utils/byteswap.hpp> #include <uhd/types/metadata.hpp> diff --git a/host/lib/transport/tcp_zero_copy.cpp b/host/lib/transport/tcp_zero_copy.cpp index f2ae51695..6cb5906de 100644 --- a/host/lib/transport/tcp_zero_copy.cpp +++ b/host/lib/transport/tcp_zero_copy.cpp @@ -18,7 +18,7 @@ #include "udp_common.hpp" #include <uhd/transport/tcp_zero_copy.hpp> #include <uhd/transport/buffer_pool.hpp> -#include <uhd/utils/msg.hpp> + #include <uhd/utils/log.hpp> #include <uhd/utils/atomic.hpp> #include <boost/format.hpp> @@ -144,7 +144,7 @@ public: _send_buffer_pool(buffer_pool::make(_num_send_frames, _send_frame_size)), _next_recv_buff_index(0), _next_send_buff_index(0) { - UHD_LOG << boost::format("Creating tcp transport for %s %s") % addr % port << std::endl; + UHD_LOGGER_DEBUG("TCP") << boost::format("Creating tcp transport for %s %s") % addr % port ; //resolve the address asio::ip::tcp::resolver resolver(_io_service); diff --git a/host/lib/transport/udp_simple.cpp b/host/lib/transport/udp_simple.cpp index 0a93941b8..735c199a2 100644 --- a/host/lib/transport/udp_simple.cpp +++ b/host/lib/transport/udp_simple.cpp @@ -31,7 +31,7 @@ public: udp_simple_impl( const std::string &addr, const std::string &port, bool bcast, bool connect ):_connected(connect){ - UHD_LOG << boost::format("Creating udp transport for %s %s") % addr % port << std::endl; + UHD_LOGGER_DEBUG("UDP") << boost::format("Creating udp transport for %s %s") % addr % port ; //resolve the address asio::ip::udp::resolver resolver(_io_service); diff --git a/host/lib/transport/udp_wsa_zero_copy.cpp b/host/lib/transport/udp_wsa_zero_copy.cpp index 52382f84d..c1a4f4db6 100644 --- a/host/lib/transport/udp_wsa_zero_copy.cpp +++ b/host/lib/transport/udp_wsa_zero_copy.cpp @@ -19,7 +19,7 @@ #include <uhd/transport/udp_zero_copy.hpp> #include <uhd/transport/udp_simple.hpp> //mtu #include <uhd/transport/buffer_pool.hpp> -#include <uhd/utils/msg.hpp> + #include <uhd/utils/log.hpp> #include <boost/format.hpp> #include <vector> @@ -47,11 +47,11 @@ static void check_registry_for_fast_send_threshold(const size_t mtu){ reg_key.Open(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Services\\AFD\\Parameters", KEY_READ) != ERROR_SUCCESS or reg_key.QueryDWORDValue("FastSendDatagramThreshold", threshold) != ERROR_SUCCESS or threshold < mtu ){ - UHD_MSG(warning) << boost::format( + UHD_LOGGER_WARNING("UDP") << boost::format( "The MTU (%d) is larger than the FastSendDatagramThreshold (%d)!\n" "This will negatively affect the transmit performance.\n" "See the transport application notes for more detail.\n" - ) % mtu % threshold << std::endl; + ) % mtu % threshold ; warned = true; } reg_key.Close(); @@ -197,7 +197,7 @@ public: check_registry_for_fast_send_threshold(this->get_send_frame_size()); #endif /*CHECK_REG_SEND_THRESH*/ - UHD_MSG(status) << boost::format("Creating WSA UDP transport for %s:%s") % addr % port << std::endl; + UHD_LOGGER_INFO("UDP") << boost::format("Creating WSA UDP transport for %s:%s") % addr % port ; static uhd_wsa_control uhd_wsa; //makes wsa start happen via lazy initialization UHD_ASSERT_THROW(_num_send_frames <= WSA_MAXIMUM_WAIT_EVENTS); @@ -327,11 +327,11 @@ void check_usr_buff_size( size_t user_buff_size, // Set this to zero for no user-defined preference const std::string tx_rx ){ - UHD_LOG << boost::format( + UHD_LOGGER_DEBUG("UDP") << boost::format( "Target %s sock buff size: %d bytes\n" "Actual %s sock buff size: %d bytes" - ) % tx_rx % user_buff_size % tx_rx % actual_buff_size << std::endl; - if ((user_buff_size != 0.0) and (actual_buff_size < user_buff_size)) UHD_MSG(warning) << boost::format( + ) % tx_rx % user_buff_size % tx_rx % actual_buff_size ; + if ((user_buff_size != 0.0) and (actual_buff_size < user_buff_size)) UHD_LOGGER_WARNING("UDP") << boost::format( "The %s buffer could not be resized sufficiently.\n" "Target sock buff size: %d bytes.\n" "Actual sock buff size: %d bytes.\n" diff --git a/host/lib/transport/udp_zero_copy.cpp b/host/lib/transport/udp_zero_copy.cpp index 036a84a05..121bb9b64 100644 --- a/host/lib/transport/udp_zero_copy.cpp +++ b/host/lib/transport/udp_zero_copy.cpp @@ -19,7 +19,7 @@ #include <uhd/transport/udp_zero_copy.hpp> #include <uhd/transport/udp_simple.hpp> //mtu #include <uhd/transport/buffer_pool.hpp> -#include <uhd/utils/msg.hpp> + #include <uhd/utils/log.hpp> #include <uhd/utils/atomic.hpp> #include <boost/format.hpp> @@ -50,11 +50,11 @@ static void check_registry_for_fast_send_threshold(const size_t mtu){ reg_key.Open(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Services\\AFD\\Parameters", KEY_READ) != ERROR_SUCCESS or reg_key.QueryDWORDValue("FastSendDatagramThreshold", threshold) != ERROR_SUCCESS or threshold < mtu ){ - UHD_MSG(warning) << boost::format( + UHD_LOGGER_WARNING("UDP") << boost::format( "The MTU (%d) is larger than the FastSendDatagramThreshold (%d)!\n" "This will negatively affect the transmit performance.\n" "See the transport application notes for more detail.\n" - ) % mtu % threshold << std::endl; + ) % mtu % threshold ; warned = true; } reg_key.Close(); @@ -175,7 +175,7 @@ public: _send_buffer_pool(buffer_pool::make(xport_params.num_send_frames, xport_params.send_frame_size)), _next_recv_buff_index(0), _next_send_buff_index(0) { - UHD_LOG << boost::format("Creating udp transport for %s %s") % addr % port << std::endl; + UHD_LOGGER_DEBUG("UDP") << boost::format("Creating udp transport for %s %s") % addr % port ; #ifdef CHECK_REG_SEND_THRESH check_registry_for_fast_send_threshold(this->get_send_frame_size()); @@ -279,11 +279,11 @@ template<typename Opt> static size_t resize_buff_helper( //resize the buffer if size was provided if (target_size > 0){ actual_size = udp_trans->resize_buff<Opt>(target_size); - UHD_LOG << boost::format( + UHD_LOGGER_DEBUG("UDP") << boost::format( "Target %s sock buff size: %d bytes\n" "Actual %s sock buff size: %d bytes" - ) % name % target_size % name % actual_size << std::endl; - if (actual_size < target_size) UHD_MSG(warning) << boost::format( + ) % name % target_size % name % actual_size ; + if (actual_size < target_size) UHD_LOGGER_WARNING("UDP") << boost::format( "The %s buffer could not be resized sufficiently.\n" "Target sock buff size: %d bytes.\n" "Actual sock buff size: %d bytes.\n" diff --git a/host/lib/transport/xport_benchmarker.hpp b/host/lib/transport/xport_benchmarker.hpp index 7383d34f1..ffafbea5a 100644 --- a/host/lib/transport/xport_benchmarker.hpp +++ b/host/lib/transport/xport_benchmarker.hpp @@ -20,7 +20,7 @@ #include <uhd/transport/zero_copy.hpp> #include <uhd/types/device_addr.hpp> -#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp> #include <boost/shared_ptr.hpp> #include <boost/thread/thread.hpp> #include <uhd/transport/vrt_if_packet.hpp> diff --git a/host/lib/transport/zero_copy_recv_offload.cpp b/host/lib/transport/zero_copy_recv_offload.cpp index e8b013abc..d2c4d2991 100644 --- a/host/lib/transport/zero_copy_recv_offload.cpp +++ b/host/lib/transport/zero_copy_recv_offload.cpp @@ -18,7 +18,7 @@ #include <uhd/transport/zero_copy_recv_offload.hpp> #include <uhd/transport/bounded_buffer.hpp> #include <uhd/transport/buffer_pool.hpp> -#include <uhd/utils/msg.hpp> + #include <uhd/utils/log.hpp> #include <uhd/utils/safe_call.hpp> #include <boost/format.hpp> @@ -47,7 +47,7 @@ public: _inbox(transport->get_num_recv_frames()), _recv_done(false) { - UHD_LOG << "Created threaded transport" << std::endl; + UHD_LOGGER_DEBUG("XPORT") << "Created threaded transport" ; // Create the receive and send threads to offload // the system calls onto other threads |