19 #include <unordered_map> 39 using ExceptionStatsHolderType =
40 std::unordered_map<ExceptionId, ExceptionStats>;
42 struct ExceptionStatsStorage {
44 ExceptionStatsHolderType tempHolder;
45 statsHolder->swap(tempHolder);
47 for (
const auto& myData : tempHolder) {
48 auto inserted = data.insert(myData);
49 if (!inserted.second) {
50 inserted.first->second.count += myData.second.count;
65 namespace exception_tracer {
68 ExceptionStatsHolderType accumulator;
69 for (
auto& threadStats : gExceptionStats.accessAllThreads()) {
70 threadStats.appendTo(accumulator);
73 std::vector<ExceptionStats> result;
74 result.reserve(accumulator.size());
75 for (
auto& item : accumulator) {
90 out <<
"Exception report: \n" 91 <<
"Exception count: " << stats.
count <<
"\n" 106 void throwHandler(
void*, std::type_info* exType,
void (*)(
void*))
noexcept {
110 frames[0] =
reinterpret_cast<uintptr_t
>(exType);
122 gExceptionStats->statsHolder.withWLock([&](
auto& holder) {
123 auto it = holder.find(exceptionId);
124 if (it != holder.end()) {
129 info.
frames.assign(frames + 1, frames + 1 + n);
141 Initializer initializer;
constexpr size_t kMaxFrames
void registerCxaThrowCallback(CxaThrowType callback)
const std::type_info * type
constexpr detail::Map< Move > move
std::vector< uintptr_t > frames
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
FOLLY_PUSH_WARNING RHS rhs
static uint64_t Hash64(const void *message, size_t length, uint64_t seed)
ssize_t getStackTrace(uintptr_t *addresses, size_t maxAddresses)
std::ostream & operator<<(std::ostream &out, const ExceptionStats &stats)
constexpr auto data(C &c) -> decltype(c.data())
Append appendTo(Collection &collection)
std::vector< ExceptionStats > getExceptionStatistics()