summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-25 15:15:54 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-25 15:15:54 +0300
commit2198ecc98ecc5e94f2856795065d198557387ade (patch)
tree873858ffceb4b6e62f441597860224b9fa3a6207 /src/utils
parent75c5b3d32afdb34b824daafaa6d4300b9a8ec06b (diff)
downloadmv-2198ecc98ecc5e94f2856795065d198557387ade.tar.gz
mv-2198ecc98ecc5e94f2856795065d198557387ade.tar.bz2
mv-2198ecc98ecc5e94f2856795065d198557387ade.tar.xz
mv-2198ecc98ecc5e94f2856795065d198557387ade.zip
Add more profiler labels.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/perfomance.cpp6
-rw-r--r--src/utils/physfsrwops.cpp7
-rw-r--r--src/utils/xml.cpp2
3 files changed, 14 insertions, 1 deletions
diff --git a/src/utils/perfomance.cpp b/src/utils/perfomance.cpp
index d7ed52d4b..5858d43e6 100644
--- a/src/utils/perfomance.cpp
+++ b/src/utils/perfomance.cpp
@@ -25,6 +25,9 @@
#include "utils/perfomance.h"
#include "configuration.h"
+#include "game.h"
+
+#include "utils/timer.h"
#include <algorithm>
#include <cstdarg>
@@ -87,7 +90,8 @@ namespace Perfomance
void flush()
{
- file << temp;
+ if (fps < 40)
+ file << temp;
temp.clear();
// file.flush();
}
diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp
index b4afa5e9e..25e6cfa8d 100644
--- a/src/utils/physfsrwops.cpp
+++ b/src/utils/physfsrwops.cpp
@@ -233,6 +233,7 @@ static bool checkFilePath(const char *const fname)
SDL_RWops *PHYSFSRWOPS_openRead(const char *const fname)
{
+ BLOCK_START("PHYSFSRWOPS_openRead")
#ifdef __APPLE__
if (!checkFilePath(fname))
return nullptr;
@@ -241,7 +242,13 @@ SDL_RWops *PHYSFSRWOPS_openRead(const char *const fname)
if (Fuzzer::conditionTerminate(fname))
return nullptr;
#endif
+#ifdef USE_PROFILER
+ SDL_RWops *const ret = create_rwops(PhysFs::openRead(fname));
+ BLOCK_END("PHYSFSRWOPS_openRead")
+ return ret;
+#else
return create_rwops(PhysFs::openRead(fname));
+#endif
} /* PHYSFSRWOPS_openRead */
SDL_RWops *PHYSFSRWOPS_openWrite(const char *const fname)
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index 3ef99758e..176bc81ac 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -85,6 +85,7 @@ namespace XML
if (Fuzzer::conditionTerminate(filename.c_str()))
return;
#endif
+ BLOCK_START("XML::Document::Document")
int size = 0;
char *data = nullptr;
valid = true;
@@ -129,6 +130,7 @@ namespace XML
logger->log("Error loading %s", filename.c_str());
}
mIsValid = valid;
+ BLOCK_END("XML::Document::Document")
}
Document::Document(const char *const data, const int size) :