Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1640)

Unified Diff: src/main.cpp

Issue 1781213002: Add malloc/new profiling on linux (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Refactoring Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/LinuxMallocProfiling.cpp ('K') | « src/LinuxMallocProfiling.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/main.cpp
diff --git a/src/main.cpp b/src/main.cpp
index baaa39ef8adc0cbf17e2ae0021ff1f073b05a3f4..9cb6be281a08c4a6acd6b981bf4f94d616a8712f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -16,6 +16,9 @@
#include "IceBrowserCompileServer.h"
#include "IceBuildDefs.h"
#include "IceCompileServer.h"
+#ifdef ALLOW_LINUX_MALLOC_PROFILE
+#include "LinuxMallocProfiling.h"
+#endif // ALLOW_LINUX_MALLOC_PROFILE
#ifdef __pnacl__
#include <malloc.h>
@@ -30,6 +33,9 @@
/// We can only compile the Ice::BrowserCompileServer object with the PNaCl
/// compiler toolchain, when building Subzero as a sandboxed translator.
int main(int argc, char **argv) {
+#ifdef ALLOW_LINUX_MALLOC_PROFILE
+ Ice::LinuxMallocProfiling::Start();
+#endif // ALLOW_LINUX_MALLOC_PROFILE
#ifdef __pnacl__
#define M_GRANULARITY (-2)
// PNaCl's default malloc implementation grabs small chunks of memory with
@@ -43,5 +49,9 @@ int main(int argc, char **argv) {
assert(argc == 1);
return Ice::BrowserCompileServer().runAndReturnErrorCode();
}
- return Ice::CLCompileServer(argc, argv).runAndReturnErrorCode();
+ int error = Ice::CLCompileServer(argc, argv).runAndReturnErrorCode();
Jim Stichnoth 2016/03/12 00:12:58 s/error/Error/
sehr 2016/03/15 00:36:46 Done.
+#ifdef ALLOW_LINUX_MALLOC_PROFILE
+ Ice::LinuxMallocProfiling::End();
+#endif // ALLOW_LINUX_MALLOC_PROFILE
+ return error;
}
« src/LinuxMallocProfiling.cpp ('K') | « src/LinuxMallocProfiling.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698