aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils
Commit message (Collapse)AuthorAgeFilesLines
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-0316-478/+479
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* thread: Fix formatting in thread utilitiesMartin Braun2020-02-101-132/+144
| | | | | - Apply clang-format - Remove unnecessary boost::format
* lib: utils: Don't use hard-coded path constantsRyan Volz2020-02-071-2/+24
| | | | | | | | | | | | | This replaces the package path constant with a runtime library path lookup. The package path is taken to be the parent directory of the library directory. When boost >= 1.61 is not available, this maintains the current behavior of using CMake to set path contants. Runtime path determination is preferable for making a relocatable library so that it is not necessary to do string substitution on relocated binaries (as with, for example, building a conda package).
* log: Remove LOG statement from _get_log_level()Martin Braun2020-01-291-2/+1
| | | | | | _get_log_level() is an internal function that only gets called during setup, so the logger isn't ready yet. It thus now logs to stderr instead of the logger.
* utils: log: Name all threadsMartin Braun2020-01-291-5/+16
| | | | | | Logging creates two threads, one for regular logging, and one for fastpath logging. Now these threads are named using uhd::set_thread_name()
* thread: Remove log messages for set_thread_name() when not supportedMartin Braun2020-01-291-10/+14
| | | | | | | | | | | On systems like Windows, set_thread_name() is not supported, and would previously log an error message telling the user that it can't set the thread name. However, that prevents set_thread_name() to be called before the logger is being set up, and the logger would like to use this function. Since it is obvious to the user if threads can be named or not, the log message is considered redundant and is removed.
* prefs: Output debug trace when config file cannot be located or loadedAaron Rossetto2019-12-172-8/+14
|
* prefs: Set init_done flag to true after loading config filesMartin Braun2019-12-051-0/+1
| | | | | | | The prefs API is supposed to load the config files once, and stash them away for the process to consume at will. Because the init_done is never set, it will read the config files every time it's asked for them. This is usually not a problem, but it causes the logging output to be messy.
* utils: tasks: Use uhd::set_thread_name()Martin Braun2019-11-261-3/+1
| | | | | This is a more portable option to set thread names. References to pthreads are now limited to thread.cpp, where they belong.
* docs: Change DPDK version to 18.11 and make args use underscoresAlex Williams2019-11-261-1/+1
| | | | | Swap out hyphens for underscores in the DPDK args. Also update list of distributions with the correct DPDK version in the repos.
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-264-13/+15
| | | | | | | | | | | | | | | | | | | | | Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
* rfnoc: Adding rfnoc_graph utilitiesBrent Stapleton2019-11-262-0/+134
| | | | | | | Adding graph_utils to keep rfnoc_graph utilities to contain helper function and commonly used algorithms for the rfnoc_graph. These functions aren't core to the rfnoc_graph's functionality, so we'll keep them out of its API.
* uhd: Replace boost::regex with std::regexMartin Braun2019-11-261-5/+5
| | | | | | | | boost::regex was a requirement until the minimum version of gcc was increased. Since it is at version 5.3 now, using Boost.Regex is no longer necessary. This change is a pure search-and-replace; Boost and std versions of regex are compatible and use the same syntax.
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-262-4/+4
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* lib: Simplify implementation of uhd::get_system_time() to use <chrono>Martin Braun2019-11-262-108/+8
| | | | | | | uhd::get_system_time() is currently only used in USRP1 code, and it turns out that our "optimized", platform-dependent implementation still is a little slower than straight-up chrono. We therefore remove all the special cases, and replace them with a single, standard solution.
* gain groups: FormattingBrent Stapleton2019-11-261-64/+77
| | | | Applying formatting in anticipation of upcoming changes.
* gain_groups: Add zero-value gain groupsBrent Stapleton2019-11-261-0/+11
| | | | | | | | | | | | | | | Add convenience factory for making a gain group that has a single zero-valued element. This factory requires a name, which should probably be ALL_GAINS, or something similar (these constants are device-specific). Using this new make_zero factory in the X300 radio control when we don't find any gain elements so that our gain groups aren't empty. This simplifies our later setters/getters because we know that we'll always have _something_ cached. Note that we only register this zero value gain group for TX, as our ADC is registered as a gain element, so our RX gain groups are never empty.
* uhd: Add thread affinity utility functionsAaron Rossetto2019-11-262-11/+117
|
* uhd: utils: Add compat check for 32-bit compat numbersMartin Braun2019-11-261-0/+18
|
* utils: cast: Add from_str() typecastMartin Braun2019-11-262-0/+40
| | | | | This is the inverse to std::to_string(), and we can overload it with UHD-internal types.
* utils: Added set_thread_name for std::threadAshish Chaudhari2019-11-261-0/+12
|
* cmake: Add UHD_COMPONENT variablemichael-west2019-10-151-1/+1
| | | | | | | | Added cmake variable to set the component (currently UHD or MPM). so the banner printed by the log_resource would reference the correct component. Added accessor function and appropriate calls in log.cpp. Signed-off-by: michael-west <michael.west@ettus.com>
* log: Honour log levels on session initMartin Braun2019-10-101-0/+3
| | | | | | | | | | The first log message of UHD is always something like this: [INFO] [UHD] linux; GNU C++ version [...] However, it was being printed regardless of the requested log level. This will disable all initial log messages if the requested log level is greater than INFO.
* logging: On POSIX, don't use logging colors on non-ttyMarcus Müller2019-10-091-1/+6
|
* log: Change logging coloursMartin Braun2019-05-071-3/+3
| | | | | | TRACE: Remains purple, but that's now no longer bright ERROR: Is now bright red (was non-bold red before) FATAL: Is now red-on-yellow
* log: Fix ANSI colour codesMartin Braun2019-05-071-7/+9
| | | | | | The colour codes used for console logging were incorrectly defined. Some colours would simply not rendered this way (e.g., red), others had the boldness flag wrong.
* log: fix deadlock issue on Windows machinesAbdo-Gaber2019-04-111-3/+32
| | | | | | | In log.cpp, a deadlock can occur while popping elements from the log queue. If the queue is empty, the call does not timeout, and waits infinitely. Replacing pop_with_wait() with pop_with_timed_wait() solves this issue.
* log: formatting log.cppBrent Stapleton2019-04-111-168/+133
| | | | `clang-format -i --style=file host/lib/utils/log.cpp`
* uhd: mpm: update all license header w/ "-or-later"Brent Stapleton2019-03-081-1/+1
| | | | Updating all SPDX license identifiers to include "-or-later"
* python: Replace Boost.Python with PyBind11Martin Braun2019-02-221-31/+0
| | | | | | This does not change the Python API itself, but it is still a significant change. Most importantly, it removes the dependency on Boost.Python.
* mpmd,transport,prefs: Add xport_mgr for dpdk_zero_copyAlex Williams2019-01-251-11/+34
| | | | | | | | | | | | | | | | | | | | | | | Add configuration sections to the UHD config file for NIC entries. Keys are based on MAC addresses, and the entries beneath the section describe which CPU and I/O thread to use for the NIC and its IPv4 address. Make ring sizes configurable for uhd-dpdk. Ring size is now an argument for packet buffers. Note that the maximum number of available buffers is still determined at init! Add ability to receive broadcasts to uhd-dpdk. This is controllable by a boolean in the sockarg during socket creation. dpdk_zero_copy will filter broadcast packets out. Add dpdk_simple transport (to mirror udp_simple). This transport allows receiving from broadcast addresses, but it only permits one outstanding buffer at a time. Fix IP checksum handling in UHD-DPDK. TX checksums were not being calculated in the NIC, and in RX, the check for IP checksums allowed values of zero (reported as none). Now packets with bad IP checksums will be dropped.
* cmake: Update coding style to use lowercase commandsMartin Braun2018-11-141-77/+77
| | | | | | | | | | | | | | | | | Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
* uhd: Remove usage of time_t (except when required)Martin Braun2018-08-201-1/+1
| | | | | | | | | | The C/C++ standards don't define what time_t is, only that it is arithmetic (and real for C11, and integral for C++). It should not be used in portable software and is only used as the return value for some libc calls. A common definition for time_t is int64_t, so we'll switch to that permanently in our own APIs. System APIs will of course stick with time_t.
* python: Separating exposed Python data structuresPaul David2018-06-201-0/+31
| | | | | | | | | - Separating exposed Python data structures into logical sections - Exposes all of the multi_usrp API - Adds a layer of Python for documentation and adding helper methods - Adds improvements and fixes to the MultiUSRP object - Includes additional exposed data structures (like time_spec_t, etc.) - Add code to release the Python GIL during long C++ calls
* Log: Handle Exceptions in DestructorVidush2018-06-061-1/+4
|
* log: Allow disabling of fastpath msgs at runtimeMartin Braun2018-04-261-13/+54
| | | | | | - Fixes an issue with compile time disabling as well - An UHD_LOG_FASTPATH_DISABLE=1 env var will make it that O/U/S/D won't be printed
* log: Add method for local generation of messages in log.cppMartin Braun2018-04-261-10/+18
|
* logging: Remove dead code from log.cppVidush2018-04-261-1/+0
|
* lib: update get_range of gain_groupTrung N Tran2018-04-181-2/+5
| | | | Need to skip zero gain step
* logging: Fix UHD_LOG_FILE cmake varMartin Braun2018-04-101-41/+54
| | | | | | | | | - Fixes: cmake -DUHD_LOG_FILE wasn't respected - Fixes: UHD_LOG_FILE and UHD_FILE_LOG_LEVEL had to both be set for either to take effect - Fixes: Use of unnecessary boost::make_shared<> - Also factored out setting up console- and file logger into their own locations in an attempt to improve readability
* lib: move atomic.hpp and system_time.hpp to uhdlibMartin Braun2018-04-061-1/+1
|
* lib: Fixing config file path for some Windows buildsAndrew Lynch2018-03-282-6/+1
|
* uhd: Move internal headers to uhdlib/Martin Braun2018-03-146-284/+2
| | | | | | | | | | | | | | | | To avoid the proliferation of additional include directories and multiple ways of including project-local headers, we now default to moving all headers that are used across UHD into the uhdlib/ subdirectory. Some #include statements were also reordered as they were modified for closer compliance with the coding guidelines. Internal cpp source files should now include files like this: #include <uhdlib/rfnoc/ctrl_iface.hpp> Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
* uhd: Moved get_system_time outside of public APIMartin Braun2018-03-052-0/+117
| | | | | | | uhd::get_system_time() is an abstracted way of reading back a time, and is not UHD-specific. As such, there's no reason to keep it in the public part of the API where we're contractually obligated not to touch it. Instead, moving it to the internal API space.
* lib: Add 'prefs' APIMartin Braun2018-02-202-0/+108
| | | | | | | | | | | | | This defines and reads configuration files that can be used to customize UHD's behaviour. On Unix systems, they default to: /etc/uhd/uhd.conf $APPDATA/.uhd/uhd.conf On Windows systems, it will look in: %ProgramData%/uhd/uhd.conf %AppData%/.uhd/uhd.conf
* lib: Add path_expandvars() internal API callMartin Braun2018-02-203-0/+48
|
* uhd: Update license headersMartin Braun2018-02-1919-18/+31
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* rfnoc: Factored out FPGA compat checkMartin Braun2018-02-192-0/+115
| | | | | - Applied changes to DUC and DDC blocks - Fixed minor formatting
* lib: Add config_parser classMartin Braun2018-02-012-0/+60
| | | | | | | This class is not publicly exported. It is meant to read config files in the INI format. Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
* logging: Minor refactoring, skip empty log messagesMartin Braun2018-01-231-75/+102
| | | | | | | Empty log messages are now skipped for faster processing. The 'terminating' log message is now also empty (and thus skipped). Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>