Skip to content

Commit

Permalink
Move instrumentation to beast, minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Jul 11, 2024
1 parent 3cf1c00 commit a5fcbde
Show file tree
Hide file tree
Showing 89 changed files with 92 additions and 137 deletions.
3 changes: 0 additions & 3 deletions Builds/levelization/results/loops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ Loop: test.jtx test.toplevel
Loop: test.jtx test.unit_test
test.unit_test == test.jtx

Loop: xrpl.basics xrpl.beast
xrpl.basics > xrpl.beast

Loop: xrpl.basics xrpl.json
xrpl.json ~= xrpl.basics

Expand Down
41 changes: 0 additions & 41 deletions Builds/levelization/results/ordering.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
libxrpl.basics > xrpl.basics
libxrpl.basics > xrpl.beast
libxrpl.basics > xrpl.protocol
libxrpl.beast > xrpl.basics
libxrpl.beast > xrpl.beast
libxrpl.crypto > xrpl.basics
libxrpl.json > xrpl.basics
libxrpl.json > xrpl.beast
libxrpl.json > xrpl.json
libxrpl.protocol > xrpl.basics
libxrpl.protocol > xrpl.beast
libxrpl.protocol > xrpl.json
libxrpl.protocol > xrpl.protocol
libxrpl.resource > xrpl.basics
libxrpl.resource > xrpl.beast
libxrpl.resource > xrpl.resource
libxrpl.server > xrpl.basics
libxrpl.server > xrpl.beast
libxrpl.server > xrpl.json
libxrpl.server > xrpl.protocol
libxrpl.server > xrpl.server
Expand All @@ -24,7 +17,6 @@ test.app > test.rpc
test.app > test.toplevel
test.app > test.unit_test
test.app > xrpl.basics
test.app > xrpl.beast
test.app > xrpld.app
test.app > xrpld.core
test.app > xrpld.ledger
Expand All @@ -36,43 +28,35 @@ test.app > xrpl.resource
test.basics > test.jtx
test.basics > test.unit_test
test.basics > xrpl.basics
test.basics > xrpl.beast
test.basics > xrpld.perflog
test.basics > xrpld.rpc
test.basics > xrpl.json
test.basics > xrpl.protocol
test.beast > xrpl.basics
test.beast > xrpl.beast
test.conditions > xrpl.basics
test.conditions > xrpl.beast
test.conditions > xrpld.conditions
test.consensus > test.csf
test.consensus > test.toplevel
test.consensus > test.unit_test
test.consensus > xrpl.basics
test.consensus > xrpl.beast
test.consensus > xrpld.app
test.consensus > xrpld.consensus
test.consensus > xrpld.ledger
test.core > test.jtx
test.core > test.toplevel
test.core > test.unit_test
test.core > xrpl.basics
test.core > xrpl.beast
test.core > xrpld.core
test.core > xrpld.perflog
test.core > xrpl.json
test.core > xrpl.server
test.csf > xrpl.basics
test.csf > xrpl.beast
test.csf > xrpld.consensus
test.csf > xrpl.json
test.csf > xrpl.protocol
test.json > test.jtx
test.json > xrpl.beast
test.json > xrpl.json
test.jtx > xrpl.basics
test.jtx > xrpl.beast
test.jtx > xrpld.app
test.jtx > xrpld.consensus
test.jtx > xrpld.core
Expand All @@ -86,7 +70,6 @@ test.jtx > xrpl.server
test.ledger > test.jtx
test.ledger > test.toplevel
test.ledger > xrpl.basics
test.ledger > xrpl.beast
test.ledger > xrpld.app
test.ledger > xrpld.core
test.ledger > xrpld.ledger
Expand All @@ -99,7 +82,6 @@ test.nodestore > test.jtx
test.nodestore > test.toplevel
test.nodestore > test.unit_test
test.nodestore > xrpl.basics
test.nodestore > xrpl.beast
test.nodestore > xrpld.app
test.nodestore > xrpld.core
test.nodestore > xrpld.nodestore
Expand All @@ -108,7 +90,6 @@ test.nodestore > xrpl.protocol
test.overlay > test.jtx
test.overlay > test.unit_test
test.overlay > xrpl.basics
test.overlay > xrpl.beast
test.overlay > xrpld.app
test.overlay > xrpld.overlay
test.overlay > xrpld.peerfinder
Expand All @@ -117,24 +98,20 @@ test.overlay > xrpl.protocol
test.peerfinder > test.beast
test.peerfinder > test.unit_test
test.peerfinder > xrpl.basics
test.peerfinder > xrpl.beast
test.peerfinder > xrpld.core
test.peerfinder > xrpld.peerfinder
test.peerfinder > xrpl.protocol
test.protocol > test.toplevel
test.protocol > xrpl.basics
test.protocol > xrpl.beast
test.protocol > xrpl.json
test.protocol > xrpl.protocol
test.resource > test.unit_test
test.resource > xrpl.basics
test.resource > xrpl.beast
test.resource > xrpl.resource
test.rpc > test.jtx
test.rpc > test.nodestore
test.rpc > test.toplevel
test.rpc > xrpl.basics
test.rpc > xrpl.beast
test.rpc > xrpld.app
test.rpc > xrpld.core
test.rpc > xrpld.net
Expand All @@ -148,37 +125,29 @@ test.server > test.jtx
test.server > test.toplevel
test.server > test.unit_test
test.server > xrpl.basics
test.server > xrpl.beast
test.server > xrpld.app
test.server > xrpld.core
test.server > xrpld.rpc
test.server > xrpl.json
test.server > xrpl.server
test.shamap > test.unit_test
test.shamap > xrpl.basics
test.shamap > xrpl.beast
test.shamap > xrpld.nodestore
test.shamap > xrpld.shamap
test.shamap > xrpl.protocol
test.toplevel > test.csf
test.toplevel > xrpl.json
test.unit_test > xrpl.basics
test.unit_test > xrpl.beast
xrpl.json > xrpl.beast
xrpl.protocol > xrpl.basics
xrpl.protocol > xrpl.beast
xrpl.protocol > xrpl.json
xrpl.resource > xrpl.basics
xrpl.resource > xrpl.beast
xrpl.resource > xrpl.json
xrpl.resource > xrpl.protocol
xrpl.server > xrpl.basics
xrpl.server > xrpl.beast
xrpl.server > xrpl.json
xrpl.server > xrpl.protocol
xrpld.app > test.unit_test
xrpld.app > xrpl.basics
xrpld.app > xrpl.beast
xrpld.app > xrpld.conditions
xrpld.app > xrpld.consensus
xrpld.app > xrpld.perflog
Expand All @@ -188,48 +157,39 @@ xrpld.app > xrpl.resource
xrpld.conditions > xrpl.basics
xrpld.conditions > xrpl.protocol
xrpld.consensus > xrpl.basics
xrpld.consensus > xrpl.beast
xrpld.consensus > xrpl.json
xrpld.consensus > xrpl.protocol
xrpld.core > xrpl.basics
xrpld.core > xrpl.beast
xrpld.core > xrpl.json
xrpld.core > xrpl.protocol
xrpld.ledger > xrpl.basics
xrpld.ledger > xrpl.beast
xrpld.ledger > xrpld.core
xrpld.ledger > xrpl.json
xrpld.ledger > xrpl.protocol
xrpld.net > xrpl.basics
xrpld.net > xrpl.beast
xrpld.net > xrpl.json
xrpld.net > xrpl.protocol
xrpld.net > xrpl.resource
xrpld.nodestore > xrpl.basics
xrpld.nodestore > xrpl.beast
xrpld.nodestore > xrpld.core
xrpld.nodestore > xrpld.unity
xrpld.nodestore > xrpl.json
xrpld.nodestore > xrpl.protocol
xrpld.overlay > xrpl.basics
xrpld.overlay > xrpl.beast
xrpld.overlay > xrpld.core
xrpld.overlay > xrpld.peerfinder
xrpld.overlay > xrpl.json
xrpld.overlay > xrpl.protocol
xrpld.overlay > xrpl.resource
xrpld.overlay > xrpl.server
xrpld.peerfinder > xrpl.basics
xrpld.peerfinder > xrpl.beast
xrpld.peerfinder > xrpld.core
xrpld.peerfinder > xrpl.protocol
xrpld.perflog > xrpl.basics
xrpld.perflog > xrpl.beast
xrpld.perflog > xrpld.nodestore
xrpld.perflog > xrpl.json
xrpld.perflog > xrpl.protocol
xrpld.rpc > xrpl.basics
xrpld.rpc > xrpl.beast
xrpld.rpc > xrpld.core
xrpld.rpc > xrpld.ledger
xrpld.rpc > xrpld.nodestore
Expand All @@ -239,6 +199,5 @@ xrpld.rpc > xrpl.protocol
xrpld.rpc > xrpl.resource
xrpld.rpc > xrpl.server
xrpld.shamap > xrpl.basics
xrpld.shamap > xrpl.beast
xrpld.shamap > xrpld.nodestore
xrpld.shamap > xrpl.protocol
2 changes: 1 addition & 1 deletion include/xrpl/basics/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define RIPPLE_BASICS_BUFFER_H_INCLUDED

#include <xrpl/basics/Slice.h>
#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <cstdint>
#include <cstring>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/basics/FeeUnits.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define BASICS_FEES_H_INCLUDED

#include <xrpl/basics/XRPAmount.h>
#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <boost/multiprecision/cpp_int.hpp>

#include <cmath>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/basics/MathUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace ripple {
constexpr std::size_t
calculatePercent(std::size_t count, std::size_t total)
{
assert(total != 0);
assert(total != 0); // NOTE No XRPL_ASSERT here, because constexpr
return ((std::min(count, total) * 100) + total - 1) / total;
}

Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/basics/SlabAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#ifndef RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED
#define RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/type_name.h>
#include <xrpl/beast/utility/instrumentation.h>

#include <boost/align.hpp>
#include <boost/container/static_vector.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/basics/Slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#define RIPPLE_BASICS_SLICE_H_INCLUDED

#include <xrpl/basics/contract.h>
#include <xrpl/basics/instrumentation.h>
#include <xrpl/basics/strHex.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <algorithm>
#include <array>
#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/basics/base_uint.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <xrpl/basics/Slice.h>
#include <xrpl/basics/contract.h>
#include <xrpl/basics/hardened_hash.h>
#include <xrpl/basics/instrumentation.h>
#include <xrpl/basics/strHex.h>
#include <xrpl/beast/utility/Zero.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <boost/endian/conversion.hpp>
#include <boost/functional/hash.hpp>
#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/basics/partitioned_unordered_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef RIPPLE_BASICS_PARTITIONED_UNORDERED_MAP_H
#define RIPPLE_BASICS_PARTITIONED_UNORDERED_MAP_H

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <functional>
#include <optional>
#include <thread>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/basics/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef RIPPLE_BASICS_RANDOM_H_INCLUDED
#define RIPPLE_BASICS_RANDOM_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <xrpl/beast/xor_shift_engine.h>
#include <cstddef>
#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/basics/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef RIPPLE_BASICS_SPINLOCK_H_INCLUDED
#define RIPPLE_BASICS_SPINLOCK_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <atomic>
#include <limits>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/beast/asio/io_latency_probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED
#define BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <boost/asio/basic_waitable_timer.hpp>
#include <boost/asio/io_service.hpp>

Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/beast/clock/manual_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#ifndef BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED
#define BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/clock/abstract_clock.h>
#include <xrpl/beast/utility/instrumentation.h>

namespace beast {

Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/beast/core/LexicalCast.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef BEAST_MODULE_CORE_TEXT_LEXICALCAST_H_INCLUDED
#define BEAST_MODULE_CORE_TEXT_LEXICALCAST_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>

#include <boost/core/detail/string_view.hpp>
#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/beast/net/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#ifndef BEAST_NET_IPADDRESS_H_INCLUDED
#define BEAST_NET_IPADDRESS_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/hash/hash_append.h>
#include <xrpl/beast/hash/uhash.h>
#include <xrpl/beast/net/IPAddressV4.h>
#include <xrpl/beast/net/IPAddressV6.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <boost/asio/ip/address.hpp>
#include <boost/functional/hash.hpp>
#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/beast/net/IPAddressV6.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef BEAST_NET_IPADDRESSV6_H_INCLUDED
#define BEAST_NET_IPADDRESSV6_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <boost/asio/ip/address_v6.hpp>
#include <cstdint>
#include <functional>
Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/beast/utility/Journal.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef BEAST_UTILITY_JOURNAL_H_INCLUDED
#define BEAST_UTILITY_JOURNAL_H_INCLUDED

#include <xrpl/basics/instrumentation.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <sstream>

namespace beast {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================

#ifndef RIPPLE_BASICS_INSTRUMENTATION_H_INCLUDED
#define RIPPLE_BASICS_INSTRUMENTATION_H_INCLUDED
#ifndef BEAST_UTILITY_INSTRUMENTATION_H_INCLUDED
#define BEAST_UTILITY_INSTRUMENTATION_H_INCLUDED

#include <cassert>

#ifdef ENABLE_VOIDSTAR
#ifndef NDEBUG
#include <antithesis_sdk.h>
#else
#pragma GCC error "Antithesis instrumentation requires Debug build"
#ifdef NDEBUG
#error "Antithesis instrumentation requires Debug build"
#endif
#include <antithesis_sdk.h>
#else
#define ALWAYS(cond, message, ...)
#define ALWAYS_OR_UNREACHABLE(cond, message, ...) assert(message&& cond)
#define ALWAYS_OR_UNREACHABLE(cond, message, ...) assert(message && (cond))
#define SOMETIMES(cond, message, ...)
#define REACHABLE(message, ...)
#define UNREACHABLE(message, ...) assert(message && false)
Expand Down
Loading

0 comments on commit a5fcbde

Please sign in to comment.