mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
JitRegister: Remove OProfile profiler
OProfile is not used at all these days, most major distributions do not ship it anymore (Debian, Fedora, and Alpine to name the few I've checked) and following a discussion on Discord, nobody is apparently using it, most devs not even being aware of it. This removes an optional dependency from Dolphin.
This commit is contained in:
parent
df351b6059
commit
713dfb41df
@ -1,31 +0,0 @@
|
|||||||
# - Try to find OProfile
|
|
||||||
# Once done this will define
|
|
||||||
# OPROFILE_FOUND - System has OProfile
|
|
||||||
# OPROFILE_INCLUDE_DIRS - The OProfile include directories
|
|
||||||
# OPROFILE_LIBRARIES - The libraries needed to use OProfile
|
|
||||||
|
|
||||||
find_path(OPROFILE_INCLUDE_DIR opagent.h)
|
|
||||||
|
|
||||||
find_library(OPROFILE_LIBRARY opagent
|
|
||||||
PATH_SUFFIXES oprofile
|
|
||||||
)
|
|
||||||
|
|
||||||
set(OPROFILE_INCLUDE_DIRS ${OPROFILE_INCLUDE_DIR})
|
|
||||||
set(OPROFILE_LIBRARIES ${OPROFILE_LIBRARY})
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(OProfile DEFAULT_MSG
|
|
||||||
OPROFILE_LIBRARY OPROFILE_INCLUDE_DIR
|
|
||||||
)
|
|
||||||
|
|
||||||
if (OPROFILE_FOUND)
|
|
||||||
if (NOT TARGET OProfile::OProfile)
|
|
||||||
add_library(OProfile::OProfile UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(OProfile::OProfile PROPERTIES
|
|
||||||
IMPORTED_LOCATION ${OPROFILE_LIBRARIES}
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES ${OPROFILE_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced(OPROFILE_INCLUDE_DIR OPROFILE_LIBRARY)
|
|
||||||
@ -119,7 +119,6 @@ option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON)
|
|||||||
|
|
||||||
option(ENABLE_GPROF "Enable gprof profiling (must be using Debug build)" OFF)
|
option(ENABLE_GPROF "Enable gprof profiling (must be using Debug build)" OFF)
|
||||||
option(FASTLOG "Enable all logs" OFF)
|
option(FASTLOG "Enable all logs" OFF)
|
||||||
option(OPROFILING "Enable profiling" OFF)
|
|
||||||
|
|
||||||
# TODO: Add DSPSpy
|
# TODO: Add DSPSpy
|
||||||
option(DSPTOOL "Build dsptool" OFF)
|
option(DSPTOOL "Build dsptool" OFF)
|
||||||
@ -565,16 +564,6 @@ if(ENCODE_FRAMEDUMPS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OPROFILING)
|
|
||||||
find_package(OProfile)
|
|
||||||
if(OPROFILE_FOUND)
|
|
||||||
message(STATUS "OProfile found, enabling profiling support")
|
|
||||||
add_definitions(-DUSE_OPROFILE=1)
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "OProfile not found. Can't build profiling support.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_HWDB)
|
if(ENABLE_HWDB)
|
||||||
find_package(LIBUDEV REQUIRED)
|
find_package(LIBUDEV REQUIRED)
|
||||||
if(LIBUDEV_FOUND)
|
if(LIBUDEV_FOUND)
|
||||||
|
|||||||
@ -350,10 +350,6 @@ if(USE_UPNP)
|
|||||||
target_link_libraries(common PRIVATE Miniupnpc::miniupnpc)
|
target_link_libraries(common PRIVATE Miniupnpc::miniupnpc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OPROFILE_FOUND)
|
|
||||||
target_link_libraries(common PRIVATE OProfile::OProfile)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_LLVM)
|
if(ENABLE_LLVM)
|
||||||
find_package(LLVM CONFIG)
|
find_package(LLVM CONFIG)
|
||||||
if(LLVM_FOUND)
|
if(LLVM_FOUND)
|
||||||
|
|||||||
@ -21,19 +21,11 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined USE_OPROFILE && USE_OPROFILE
|
|
||||||
#include <opagent.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined USE_VTUNE
|
#if defined USE_VTUNE
|
||||||
#include <jitprofiling.h>
|
#include <jitprofiling.h>
|
||||||
#pragma comment(lib, "jitprofiling.lib")
|
#pragma comment(lib, "jitprofiling.lib")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined USE_OPROFILE && USE_OPROFILE
|
|
||||||
static op_agent_t s_agent = nullptr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static File::IOFile s_perf_map_file;
|
static File::IOFile s_perf_map_file;
|
||||||
|
|
||||||
namespace Common::JitRegister
|
namespace Common::JitRegister
|
||||||
@ -42,11 +34,6 @@ static bool s_is_enabled = false;
|
|||||||
|
|
||||||
void Init(const std::string& perf_dir)
|
void Init(const std::string& perf_dir)
|
||||||
{
|
{
|
||||||
#if defined USE_OPROFILE && USE_OPROFILE
|
|
||||||
s_agent = op_open_agent();
|
|
||||||
s_is_enabled = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!perf_dir.empty() || getenv("PERF_BUILDID_DIR"))
|
if (!perf_dir.empty() || getenv("PERF_BUILDID_DIR"))
|
||||||
{
|
{
|
||||||
const std::string dir = perf_dir.empty() ? "/tmp" : perf_dir;
|
const std::string dir = perf_dir.empty() ? "/tmp" : perf_dir;
|
||||||
@ -61,11 +48,6 @@ void Init(const std::string& perf_dir)
|
|||||||
|
|
||||||
void Shutdown()
|
void Shutdown()
|
||||||
{
|
{
|
||||||
#if defined USE_OPROFILE && USE_OPROFILE
|
|
||||||
op_close_agent(s_agent);
|
|
||||||
s_agent = nullptr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_VTUNE
|
#ifdef USE_VTUNE
|
||||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_SHUTDOWN, nullptr);
|
iJIT_NotifyEvent(iJVM_EVENT_TYPE_SHUTDOWN, nullptr);
|
||||||
#endif
|
#endif
|
||||||
@ -83,15 +65,11 @@ bool IsEnabled()
|
|||||||
|
|
||||||
void Register(const void* base_address, u32 code_size, const std::string& symbol_name)
|
void Register(const void* base_address, u32 code_size, const std::string& symbol_name)
|
||||||
{
|
{
|
||||||
#if !(defined USE_OPROFILE && USE_OPROFILE) && !defined(USE_VTUNE)
|
#ifndef USE_VTUNE
|
||||||
if (!s_perf_map_file.IsOpen())
|
if (!s_perf_map_file.IsOpen())
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined USE_OPROFILE && USE_OPROFILE
|
|
||||||
op_write_native_code(s_agent, symbol_name.c_str(), (u64)base_address, base_address, code_size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_VTUNE
|
#ifdef USE_VTUNE
|
||||||
iJIT_Method_Load jmethod = {0};
|
iJIT_Method_Load jmethod = {0};
|
||||||
jmethod.method_id = iJIT_GetNewMethodID();
|
jmethod.method_id = iJIT_GetNewMethodID();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user