Reformat all the things. Have fun with merge conflicts.

This commit is contained in:
Pierre Bourdon
2016-06-24 10:43:46 +02:00
parent 2115e8a4a6
commit 3570c7f03a
1116 changed files with 187405 additions and 180344 deletions

View File

@ -12,57 +12,51 @@
namespace Common
{
class Profiler
{
public:
Profiler(const std::string& name);
~Profiler();
Profiler(const std::string& name);
~Profiler();
static std::string ToString();
static std::string ToString();
void Start();
void Stop();
std::string Read();
void Start();
void Stop();
std::string Read();
bool operator<(const Profiler& b) const;
bool operator<(const Profiler& b) const;
private:
static std::list<Profiler*> s_all_profilers;
static std::mutex s_mutex;
static u32 s_max_length;
static u64 s_frame_time;
static u64 s_usecs_frame;
static std::list<Profiler*> s_all_profilers;
static std::mutex s_mutex;
static u32 s_max_length;
static u64 s_frame_time;
static u64 s_usecs_frame;
static std::string s_lazy_result;
static int s_lazy_delay;
static std::string s_lazy_result;
static int s_lazy_delay;
std::string m_name;
u64 m_usecs;
u64 m_usecs_min;
u64 m_usecs_max;
u64 m_usecs_quad;
u64 m_calls;
u64 m_time;
int m_depth;
std::string m_name;
u64 m_usecs;
u64 m_usecs_min;
u64 m_usecs_max;
u64 m_usecs_quad;
u64 m_calls;
u64 m_time;
int m_depth;
};
class ProfilerExecuter
{
public:
ProfilerExecuter(Profiler* _p) : m_p(_p)
{
m_p->Start();
}
~ProfilerExecuter()
{
m_p->Stop();
}
ProfilerExecuter(Profiler* _p) : m_p(_p) { m_p->Start(); }
~ProfilerExecuter() { m_p->Stop(); }
private:
Profiler* m_p;
Profiler* m_p;
};
};
// Warning: This profiler isn't thread safe. Only profile functions which doesn't run simultaneously
#define PROFILE(name) static Common::Profiler prof_gen(name); Common::ProfilerExecuter prof_e(&prof_gen);
#define PROFILE(name) \
static Common::Profiler prof_gen(name); \
Common::ProfilerExecuter prof_e(&prof_gen);