mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-10 21:00:06 +00:00
Remove the telemetry (#45)
* remove the telemetry except from the renderers as I'm not being capable to remove it from there * remove the telemetry except from the renderers as I'm not being capable to remove it from there * Remove remainder of non-functional Telemetry and Citra Web Services Squashed commit of the following: commit f6dd4d4579c91db323877f0d08b9c01c82e1bb32 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 14:02:26 2024 -0600 gl_driver.h: add back missing functions commit 8f14384e7a7b763c3f2ccb3af6b5a59df641d9ee Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 13:56:16 2024 -0600 gl_driver.cpp: add back missing functions commit 5c802524b01a6eb05952d88ccf9dd78d63baee0a Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 13:39:46 2024 -0600 apply clang-format commit e8f62a7d3ee8a3da885a28bce21bcfcb84f13a84 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 13:16:22 2024 -0600 remove web_tab commit ced7f1e4909ae7b2714a96e3c3fa0500e8c62968 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 13:13:47 2024 -0600 remove unused call? commit f10e05da887e4570853fae2bd55a71087b4bcc77 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 13:03:47 2024 -0600 fix build errors commit 0489c1770b4b48d51f626145ae9235d3c81029fc Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 12:54:35 2024 -0600 Remove deleted files commit b2eb56f5a1f01663cc9874d99fe77ee64b48622b Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 12:43:17 2024 -0600 Remove ConfigureWeb commit b96f7c724006b2c5ee2272becaa70584fe90d012 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 11:49:51 2024 -0600 remove unused DebugHandler commit 91ddf16f63f9ae07b0cb2768171728dc878d1653 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 11:41:31 2024 -0600 remove CollectToolingInfo() reference commit 3909ac0502f23f8fb54944b53d5072b6986f8ffd Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 11:33:39 2024 -0600 Fix "clean renderer_vulkan.cpp" This reverts commit 8a882658da9fabca40d71d73bfaf3bb5702acd72. commit f4a10c4e4f27471b0a263ac363a6fa2abc9d6dc9 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 11:25:12 2024 -0600 remove Core() references commit 5593b8484e7c9f525ea218902dd2c13148d86b37 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 11:09:26 2024 -0600 clean core/core.cpp commit 55bbd8ad283297ef79db11e19ca6303fdfba6626 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 11:03:45 2024 -0600 apply clang-format commit 3707a0b2705dd415876130c9c90b0916bdea11db Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 11:02:16 2024 -0600 citra_qt/main.h commit ddbdea9be4d8179a333e04e7c302e215868715a9 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 11:01:30 2024 -0600 clean common/detached_tasks.h commit b513ba3b91ebc81bddd634b5690b6434824e1c7a Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:58:51 2024 -0600 clean android/app/src/main/jni/default_ini.h commit b6ba7d7cd730393883fdca294c651a4186727b55 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:58:14 2024 -0600 clean android/app/src/main/jni/native.cpp commit 2351305bb24b005920af0f3f7bb6bbb5bb3124bd Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:56:59 2024 -0600 network/network_settings.h commit 5b4c1ebb97c7fad5daf7789e1d3640041c2412fb Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:55:53 2024 -0600 clean citra_qt/configuration/configure_web.ui commit 9526d5122995c2e9c52b4d93b6e836a2ea4c80ef Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:54:53 2024 -0600 citra_qt/configuration/config.cpp commit ec6fe57412ce97e06096fc07f8b86dd080b7b944 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:53:50 2024 -0600 clean citra/default_ini.h commit acba1cf7e94de2fa87174e9f6d7c7c4554146352 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:52:47 2024 -0600 clean citra/config.cpp commit 02888777590d4e4bf1423e168a672ca0c5e140e5 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:50:42 2024 -0600 clean vk_instance.cpp commit eae451d5825b3601382c3a6dd08a3bde5c7a9460 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:48:53 2024 -0600 clean vk_instanch.h commit 8a882658da9fabca40d71d73bfaf3bb5702acd72 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:47:11 2024 -0600 clean renderer_vulkan.cpp commit ea6df111bc447913d2999acd86de984acced7eeb Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:45:51 2024 -0600 clean renderer_opengl.cpp commit 6b1bea0ef8cf8831c520d1c4e90b9d73d421c764 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:44:17 2024 -0600 clean pica_to_gl.h commit c12e984045a430cb10500241ada68701f73c85ac Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:42:48 2024 -0600 clean gl_driver.h commit ca3fe7801fff125a1ab8706bfc3998ca2928bded Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:40:14 2024 -0600 clean gl_driver.cpp commit d57381c38b217a423a7039bc7b413d79f59c2ff1 Author: Reg Tiangha <rtiangha@users.noreply.github.com> Date: Fri Mar 29 10:38:44 2024 -0600 delete telemetry files commit 1af826d1a045c5568a0d9ef4ca423514f298aee2 Author: Miguel <81558772+Miguel-hrvs@users.noreply.github.com> Date: Wed Mar 27 16:17:58 2024 +0100 remove the telemetry except from the renderers as I'm not being capable to remove it from there * rebase renderer_vulkan * clean up renderer_vulkan * bring back vulkan gpu logging * clang-format vk_instance.h * fix-formatting --------- Co-authored-by: Reg Tiangha <rtiangha@users.noreply.github.com>
This commit is contained in:
parent
a442389a60
commit
8e35df1a6c
62 changed files with 49 additions and 4395 deletions
|
@ -130,8 +130,6 @@ add_library(citra_common STATIC
|
|||
string_util.cpp
|
||||
string_util.h
|
||||
swap.h
|
||||
telemetry.cpp
|
||||
telemetry.h
|
||||
texture.cpp
|
||||
texture.h
|
||||
thread.cpp
|
||||
|
|
|
@ -12,10 +12,10 @@ namespace Common {
|
|||
/**
|
||||
* A background manager which ensures that all detached task is finished before program exits.
|
||||
*
|
||||
* Some tasks, telemetry submission for example, prefer executing asynchronously and don't care
|
||||
* about the result. These tasks are suitable for std::thread::detach(). However, this is unsafe if
|
||||
* the task is launched just before the program exits (which is a common case for telemetry), so we
|
||||
* need to block on these tasks on program exit.
|
||||
* Some tasks prefer executing asynchronously and don't care
|
||||
* about the result. These tasks are suitable for std::thread::detach().
|
||||
* However, this is unsafe if the task is launched just before the program exits
|
||||
* so we need to block on these tasks on program exit.
|
||||
*
|
||||
* To make detached task safe, a single DetachedTasks object should be placed in the main(), and
|
||||
* call WaitForAllTasks() after all program execution but before global/static variable destruction.
|
||||
|
|
|
@ -1,92 +1 @@
|
|||
// Copyright 2017 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include "common/arch.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/scm_rev.h"
|
||||
#include "common/telemetry.h"
|
||||
|
||||
#if CITRA_ARCH(x86_64)
|
||||
#include "common/x64/cpu_detect.h"
|
||||
#endif
|
||||
|
||||
namespace Common::Telemetry {
|
||||
|
||||
void FieldCollection::Accept(VisitorInterface& visitor) const {
|
||||
for (const auto& field : fields) {
|
||||
field.second->Accept(visitor);
|
||||
}
|
||||
}
|
||||
|
||||
void FieldCollection::AddField(std::unique_ptr<FieldInterface> field) {
|
||||
fields[field->GetName()] = std::move(field);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Field<T>::Accept(VisitorInterface& visitor) const {
|
||||
visitor.Visit(*this);
|
||||
}
|
||||
|
||||
template class Field<bool>;
|
||||
template class Field<double>;
|
||||
template class Field<float>;
|
||||
template class Field<u8>;
|
||||
template class Field<u16>;
|
||||
template class Field<u32>;
|
||||
template class Field<u64>;
|
||||
template class Field<s8>;
|
||||
template class Field<s16>;
|
||||
template class Field<s32>;
|
||||
template class Field<s64>;
|
||||
template class Field<std::string>;
|
||||
template class Field<const char*>;
|
||||
template class Field<std::chrono::microseconds>;
|
||||
|
||||
void AppendBuildInfo(FieldCollection& fc) {
|
||||
const bool is_git_dirty{std::strstr(Common::g_scm_desc, "dirty") != nullptr};
|
||||
fc.AddField(FieldType::App, "Git_IsDirty", is_git_dirty);
|
||||
fc.AddField(FieldType::App, "Git_Branch", Common::g_scm_branch);
|
||||
fc.AddField(FieldType::App, "Git_Revision", Common::g_scm_rev);
|
||||
fc.AddField(FieldType::App, "BuildDate", Common::g_build_date);
|
||||
fc.AddField(FieldType::App, "BuildName", Common::g_build_name);
|
||||
}
|
||||
|
||||
void AppendCPUInfo(FieldCollection& fc) {
|
||||
#if CITRA_ARCH(x86_64)
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Model", Common::GetCPUCaps().cpu_string);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_BrandString", Common::GetCPUCaps().brand_string);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_AES", Common::GetCPUCaps().aes);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_AVX", Common::GetCPUCaps().avx);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_AVX2", Common::GetCPUCaps().avx2);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_AVX512", Common::GetCPUCaps().avx512);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_BMI1", Common::GetCPUCaps().bmi1);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_BMI2", Common::GetCPUCaps().bmi2);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_FMA", Common::GetCPUCaps().fma);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_FMA4", Common::GetCPUCaps().fma4);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_SSE", Common::GetCPUCaps().sse);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_SSE2", Common::GetCPUCaps().sse2);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_SSE3", Common::GetCPUCaps().sse3);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_SSSE3", Common::GetCPUCaps().ssse3);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_SSE41", Common::GetCPUCaps().sse4_1);
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Extension_x64_SSE42", Common::GetCPUCaps().sse4_2);
|
||||
#else
|
||||
fc.AddField(FieldType::UserSystem, "CPU_Model", "Other");
|
||||
#endif
|
||||
}
|
||||
|
||||
void AppendOSInfo(FieldCollection& fc) {
|
||||
#ifdef __APPLE__
|
||||
fc.AddField(FieldType::UserSystem, "OsPlatform", "Apple");
|
||||
#elif defined(_WIN32)
|
||||
fc.AddField(FieldType::UserSystem, "OsPlatform", "Windows");
|
||||
#elif defined(__linux__) || defined(linux) || defined(__linux)
|
||||
fc.AddField(FieldType::UserSystem, "OsPlatform", "Linux");
|
||||
#else
|
||||
fc.AddField(FieldType::UserSystem, "OsPlatform", "Unknown");
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Common::Telemetry
|
||||
|
|
|
@ -1,199 +1 @@
|
|||
// Copyright 2017 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Common::Telemetry {
|
||||
|
||||
/// Field type, used for grouping fields together in the final submitted telemetry log
|
||||
enum class FieldType : u8 {
|
||||
None = 0, ///< No specified field group
|
||||
App, ///< Citra application fields (e.g. version, branch, etc.)
|
||||
Session, ///< Emulated session fields (e.g. title ID, log, etc.)
|
||||
Performance, ///< Emulated performance (e.g. fps, emulated CPU speed, etc.)
|
||||
UserFeedback, ///< User submitted feedback (e.g. star rating, user notes, etc.)
|
||||
UserConfig, ///< User configuration fields (e.g. emulated CPU core, renderer, etc.)
|
||||
UserSystem, ///< User system information (e.g. host CPU type, RAM, etc.)
|
||||
};
|
||||
|
||||
struct VisitorInterface;
|
||||
|
||||
/**
|
||||
* Interface class for telemetry data fields.
|
||||
*/
|
||||
class FieldInterface : NonCopyable {
|
||||
public:
|
||||
virtual ~FieldInterface() = default;
|
||||
|
||||
/**
|
||||
* Accept method for the visitor pattern.
|
||||
* @param visitor Reference to the visitor that will visit this field.
|
||||
*/
|
||||
virtual void Accept(VisitorInterface& visitor) const = 0;
|
||||
|
||||
/**
|
||||
* Gets the name of this field.
|
||||
* @returns Name of this field as a string.
|
||||
*/
|
||||
virtual const std::string& GetName() const = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents a telemetry data field, i.e. a unit of data that gets logged and submitted to our
|
||||
* telemetry web service.
|
||||
*/
|
||||
template <typename T>
|
||||
class Field : public FieldInterface {
|
||||
public:
|
||||
Field(FieldType type, std::string name, T value)
|
||||
: name(std::move(name)), type(type), value(std::move(value)) {}
|
||||
|
||||
Field(const Field&) = default;
|
||||
Field& operator=(const Field&) = default;
|
||||
|
||||
Field(Field&&) = default;
|
||||
Field& operator=(Field&& other) = default;
|
||||
|
||||
void Accept(VisitorInterface& visitor) const override;
|
||||
|
||||
[[nodiscard]] const std::string& GetName() const override {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of the field.
|
||||
*/
|
||||
[[nodiscard]] FieldType GetType() const {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the field.
|
||||
*/
|
||||
[[nodiscard]] const T& GetValue() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool operator==(const Field& other) const {
|
||||
return (type == other.type) && (name == other.name) && (value == other.value);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool operator!=(const Field& other) const {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string name; ///< Field name, must be unique
|
||||
FieldType type{}; ///< Field type, used for grouping fields together
|
||||
T value; ///< Field value
|
||||
};
|
||||
|
||||
/**
|
||||
* Collection of data fields that have been logged.
|
||||
*/
|
||||
class FieldCollection final : NonCopyable {
|
||||
public:
|
||||
FieldCollection() = default;
|
||||
|
||||
/**
|
||||
* Accept method for the visitor pattern, visits each field in the collection.
|
||||
* @param visitor Reference to the visitor that will visit each field.
|
||||
*/
|
||||
void Accept(VisitorInterface& visitor) const;
|
||||
|
||||
/**
|
||||
* Creates a new field and adds it to the field collection.
|
||||
* @param type Type of the field to add.
|
||||
* @param name Name of the field to add.
|
||||
* @param value Value for the field to add.
|
||||
*/
|
||||
template <typename T>
|
||||
void AddField(FieldType type, const char* name, T value) {
|
||||
return AddField(std::make_unique<Field<T>>(type, name, std::move(value)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new field to the field collection.
|
||||
* @param field Field to add to the field collection.
|
||||
*/
|
||||
void AddField(std::unique_ptr<FieldInterface> field);
|
||||
|
||||
private:
|
||||
std::map<std::string, std::unique_ptr<FieldInterface>> fields;
|
||||
};
|
||||
|
||||
/**
|
||||
* Telemetry fields visitor interface class. A backend to log to a web service should implement
|
||||
* this interface.
|
||||
*/
|
||||
struct VisitorInterface : NonCopyable {
|
||||
virtual ~VisitorInterface() = default;
|
||||
|
||||
virtual void Visit(const Field<bool>& field) = 0;
|
||||
virtual void Visit(const Field<double>& field) = 0;
|
||||
virtual void Visit(const Field<float>& field) = 0;
|
||||
virtual void Visit(const Field<u8>& field) = 0;
|
||||
virtual void Visit(const Field<u16>& field) = 0;
|
||||
virtual void Visit(const Field<u32>& field) = 0;
|
||||
virtual void Visit(const Field<u64>& field) = 0;
|
||||
virtual void Visit(const Field<s8>& field) = 0;
|
||||
virtual void Visit(const Field<s16>& field) = 0;
|
||||
virtual void Visit(const Field<s32>& field) = 0;
|
||||
virtual void Visit(const Field<s64>& field) = 0;
|
||||
virtual void Visit(const Field<std::string>& field) = 0;
|
||||
virtual void Visit(const Field<const char*>& field) = 0;
|
||||
virtual void Visit(const Field<std::chrono::microseconds>& field) = 0;
|
||||
|
||||
/// Completion method, called once all fields have been visited
|
||||
virtual void Complete() = 0;
|
||||
virtual bool SubmitTestcase() = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Empty implementation of VisitorInterface that drops all fields. Used when a functional
|
||||
* backend implementation is not available.
|
||||
*/
|
||||
struct NullVisitor : public VisitorInterface {
|
||||
~NullVisitor() = default;
|
||||
|
||||
void Visit(const Field<bool>& /*field*/) override {}
|
||||
void Visit(const Field<double>& /*field*/) override {}
|
||||
void Visit(const Field<float>& /*field*/) override {}
|
||||
void Visit(const Field<u8>& /*field*/) override {}
|
||||
void Visit(const Field<u16>& /*field*/) override {}
|
||||
void Visit(const Field<u32>& /*field*/) override {}
|
||||
void Visit(const Field<u64>& /*field*/) override {}
|
||||
void Visit(const Field<s8>& /*field*/) override {}
|
||||
void Visit(const Field<s16>& /*field*/) override {}
|
||||
void Visit(const Field<s32>& /*field*/) override {}
|
||||
void Visit(const Field<s64>& /*field*/) override {}
|
||||
void Visit(const Field<std::string>& /*field*/) override {}
|
||||
void Visit(const Field<const char*>& /*field*/) override {}
|
||||
void Visit(const Field<std::chrono::microseconds>& /*field*/) override {}
|
||||
|
||||
void Complete() override {}
|
||||
bool SubmitTestcase() override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/// Appends build-specific information to the given FieldCollection,
|
||||
/// such as branch name, revision hash, etc.
|
||||
void AppendBuildInfo(FieldCollection& fc);
|
||||
|
||||
/// Appends CPU-specific information to the given FieldCollection,
|
||||
/// such as instruction set extensions, etc.
|
||||
void AppendCPUInfo(FieldCollection& fc);
|
||||
|
||||
/// Appends OS-specific information to the given FieldCollection,
|
||||
/// such as platform name, etc.
|
||||
void AppendOSInfo(FieldCollection& fc);
|
||||
|
||||
} // namespace Common::Telemetry
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue