summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/profiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/profiler.cpp')
-rw-r--r--src/emu/profiler.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/emu/profiler.cpp b/src/emu/profiler.cpp
index c3c0ea05608..19f3908f097 100644
--- a/src/emu/profiler.cpp
+++ b/src/emu/profiler.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles
/***************************************************************************
- profiler.c
+ profiler.cpp
Functions to manage profiling of MAME execution.
@@ -89,8 +89,11 @@ real_profiler_state::real_profiler_state()
// reset - initializes state
//-------------------------------------------------
-void real_profiler_state::reset(bool enabled)
+void real_profiler_state::reset(bool enabled) noexcept
{
+ // disabling the profiler from the UI happens while PROFILER_EXTRA is active
+ //assert(!m_filoptr || (m_filoptr == m_filo));
+
m_text_time = attotime::never;
if (enabled)
@@ -117,10 +120,10 @@ void real_profiler_state::reset(bool enabled)
const char *real_profiler_state::text(running_machine &machine)
{
- start(PROFILER_PROFILER);
+ auto profile = start(PROFILER_PROFILER);
// get the current time
- attotime current_time = machine.scheduler().time();
+ attotime const current_time = machine.scheduler().time();
// we only want to update the text periodically
if ((m_text_time == attotime::never) || ((current_time - m_text_time).as_double() >= TEXT_UPDATE_TIME))
@@ -129,7 +132,6 @@ const char *real_profiler_state::text(running_machine &machine)
m_text_time = current_time;
}
- stop();
return m_text.c_str();
}
@@ -193,7 +195,7 @@ void real_profiler_state::update_text(running_machine &machine)
}
// loop over all types and generate the string
- device_iterator iter(machine.root_device());
+ device_enumerator iter(machine.root_device());
std::ostringstream stream;
for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_TOTAL; ++curtype)
{