Removes ThreadDrillerEvents, replaces handlers with TreadEventBus

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-12-02 12:40:39 -08:00
parent 8bde44d5fb
commit 19ddeeded9
8 changed files with 14 additions and 46 deletions
@@ -29,12 +29,12 @@ namespace AZ::Debug
EventTraceDriller::EventTraceDriller()
{
EventTraceDrillerSetupBus::Handler::BusConnect();
AZStd::ThreadDrillerEventBus::Handler::BusConnect();
AZStd::ThreadEventBus::Handler::BusConnect();
}
EventTraceDriller::~EventTraceDriller()
{
AZStd::ThreadDrillerEventBus::Handler::BusDisconnect();
AZStd::ThreadEventBus::Handler::BusDisconnect();
EventTraceDrillerSetupBus::Handler::BusDisconnect();
}
@@ -22,7 +22,7 @@ namespace AZ
: public Driller
, public EventTraceDrillerBus::Handler
, public EventTraceDrillerSetupBus::Handler
, public AZStd::ThreadDrillerEventBus::Handler
, public AZStd::ThreadEventBus::Handler
, public AZ::TickBus::Handler
{
public:
@@ -8,7 +8,7 @@
#pragma once
#ifndef AZ_PROFILE_MEMORY_ALLOC
// No other profiler has defined the performance markers AZ_PROFILE_MEMORY_ALLOC (and friends), fall back to a Driller implementation (currently empty)
// No other profiler has defined the performance markers AZ_PROFILE_MEMORY_ALLOC (and friends), fall back to current implementation (empty)
# define AZ_PROFILE_MEMORY_ALLOC(category, address, size, context)
# define AZ_PROFILE_MEMORY_ALLOC_EX(category, filename, lineNumber, address, size, context)
# define AZ_PROFILE_MEMORY_FREE(category, address)
@@ -32,24 +32,7 @@ namespace AZStd
virtual void OnThreadExit(const AZStd::thread::id& id) = 0;
};
//! Thread events driller bus - only "drillers" (profilers) should connect to this.
//! A global mutex that includes a lock on the memory manager and other driller busses
//! is held during dispatch, and listeners are expected to do no allocation
//! or thread workloads or blocking or mutex operations of their own - only dump the data to
//! network or file ASAP.
//! DO NOT USE this bus unless you are a profiler capture system, use the ThreadEvents / ThreadBus instead
class ThreadDrillerEvents
: public AZ::Debug::DrillerEBusTraits
{
public:
/// Called when we enter a thread, optional thread_desc is provided when the use provides one.
virtual void OnThreadEnter(const AZStd::thread::id& id, const AZStd::thread_desc* desc) = 0;
/// Called when we exit a thread.
virtual void OnThreadExit(const AZStd::thread::id& id) = 0;
};
typedef AZ::EBus<ThreadEvents> ThreadEventBus;
typedef AZ::EBus<ThreadDrillerEvents> ThreadDrillerEventBus;
}
#endif // AZSTD_THREAD_BUS_H