Merge pull request #3865 from Sonicadvance1/telemetry_atexit

Telemetry: Change how visibility of telemetry values work
This commit is contained in:
Ryan Houdek 2024-07-15 09:53:37 -07:00 committed by GitHub
commit b8e864ffdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View File

@ -16,7 +16,7 @@
namespace FEXCore::Telemetry {
#ifndef FEX_DISABLE_TELEMETRY
static std::array<Value, FEXCore::Telemetry::TelemetryType::TYPE_LAST> TelemetryValues = {{}};
std::array<Value, FEXCore::Telemetry::TelemetryType::TYPE_LAST> TelemetryValues = {{}};
const std::array<std::string_view, FEXCore::Telemetry::TelemetryType::TYPE_LAST> TelemetryNames {
"64byte Split Locks",
"16byte Split atomics",
@ -80,8 +80,5 @@ void Shutdown(const fextl::string& ApplicationName) {
}
}
Value& GetTelemetryValue(TelemetryType Type) {
return TelemetryValues.at(Type);
}
#endif
} // namespace FEXCore::Telemetry

View File

@ -4,10 +4,9 @@
#include <FEXCore/Utils/CompilerDefs.h>
#include <FEXCore/fextl/string.h>
#include <array>
#include <atomic>
#include <stdint.h>
#include <type_traits>
#include <filesystem>
namespace FEXCore::Telemetry {
enum TelemetryType {
@ -64,7 +63,10 @@ private:
std::atomic<uint64_t> Data;
};
FEX_DEFAULT_VISIBILITY Value& GetTelemetryValue(TelemetryType Type);
FEX_DEFAULT_VISIBILITY extern std::array<Value, FEXCore::Telemetry::TelemetryType::TYPE_LAST> TelemetryValues;
inline Value& GetTelemetryValue(TelemetryType Type) {
return FEXCore::Telemetry::TelemetryValues[Type];
}
FEX_DEFAULT_VISIBILITY void Initialize();
FEX_DEFAULT_VISIBILITY void Shutdown(const fextl::string& ApplicationName);