[vmkit-commits] [vmkit] r60022 - /vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue Nov 25 06:10:10 PST 2008
Author: geoffray
Date: Tue Nov 25 08:10:09 2008
New Revision: 60022
URL: http://llvm.org/viewvc/llvm-project?rev=60022&view=rev
Log:
Print stats when static compiling.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp
Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=60022&r1=60021&r2=60022&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue Nov 25 08:10:09 2008
@@ -911,6 +911,11 @@
}
#ifdef SERVICE
+
+#include <signal.h>
+
+extern void terminationHandler(int, siginfo_t*, void*);
+
static void serviceCPUMonitor(mvm::Thread* th) {
while (true) {
sleep(1);
@@ -939,6 +944,9 @@
#ifdef SERVICE
mvm::Thread* th = new JavaThread(0, 0, this);
th->start(serviceCPUMonitor);
+ struct sigaction sa;
+ sa.sa_sigaction = terminationHandler;
+ sigaction(SIGUSR1, &sa, NULL);
#endif
} else {
threadSystem.nonDaemonThreads = 0;
@@ -1090,6 +1098,10 @@
i->setLinkage(llvm::GlobalValue::ExternalLinkage);
}
+ // Print stats before quitting.
+ bootstrapLoader->getModule()->printStats();
+ bootstrapLoader->getModuleProvider()->printStats();
+
} catch(std::string str) {
fprintf(stderr, "Error : %s\n", str.c_str());
}
More information about the vmkit-commits
mailing list