2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
2015-11-10 05:21:49 +00:00
|
|
|
* Project64 - A Nintendo 64 emulator. *
|
2012-12-19 09:30:18 +00:00
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
2015-12-06 09:59:58 +00:00
|
|
|
#include <Project64-core/N64System/N64Types.h>
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-12-21 21:38:56 +00:00
|
|
|
typedef std::map<SPECIAL_TIMERS, int64_t > PROFILE_ENRTIES;
|
2008-09-18 03:15:49 +00:00
|
|
|
typedef PROFILE_ENRTIES::iterator PROFILE_ENRTY;
|
|
|
|
typedef PROFILE_ENRTIES::value_type PROFILE_VALUE;
|
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
class CProfiling
|
2012-10-05 09:18:02 +00:00
|
|
|
{
|
2015-04-28 22:19:02 +00:00
|
|
|
public:
|
2015-12-23 19:51:37 +00:00
|
|
|
CProfiling();
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-12-23 19:51:37 +00:00
|
|
|
//recording timing against current timer, returns the address of the timer stopped
|
|
|
|
SPECIAL_TIMERS StartTimer(SPECIAL_TIMERS Address);
|
|
|
|
SPECIAL_TIMERS StopTimer();
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-12-23 19:51:37 +00:00
|
|
|
//Display the CPU Usage
|
|
|
|
void ShowCPU_Usage();
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-12-23 19:51:37 +00:00
|
|
|
//Reset all the counters back to 0
|
|
|
|
void ResetCounters();
|
|
|
|
|
|
|
|
//Generate a log file with the current results, this will also reset the counters
|
|
|
|
void GenerateLog();
|
2012-10-05 09:18:02 +00:00
|
|
|
|
|
|
|
private:
|
2015-12-23 19:51:37 +00:00
|
|
|
CProfiling(const CProfiling&); // Disable copy constructor
|
|
|
|
CProfiling& operator=(const CProfiling&); // Disable assignment
|
2012-10-05 09:18:02 +00:00
|
|
|
|
2015-12-23 19:51:37 +00:00
|
|
|
SPECIAL_TIMERS m_CurrentTimerAddr;
|
|
|
|
uint32_t m_CurrentDisplayCount;
|
|
|
|
uint32_t m_StartTimeHi, m_StartTimeLo; //The Current Timer start time
|
|
|
|
PROFILE_ENRTIES m_Entries;
|
2008-09-18 03:15:49 +00:00
|
|
|
};
|