Author: [email protected]
Date: Tue Apr 7 06:33:39 2009
New Revision: 1685
Modified:
branches/bleeding_edge/src/platform-linux.cc
Log:
Fix profiling on Android.
Review URL: http://codereview.chromium.org/62102
Modified: branches/bleeding_edge/src/platform-linux.cc
==============================================================================
--- branches/bleeding_edge/src/platform-linux.cc (original)
+++ branches/bleeding_edge/src/platform-linux.cc Tue Apr 7 06:33:39 2009
@@ -552,9 +552,34 @@
static Sampler* active_sampler_ = NULL;
+
+#if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__))
+// Android runs a fairly new Linux kernel, so signal info is there,
+// but the C library doesn't have the structs defined.
+
+struct sigcontext {
+ uint32_t trap_no;
+ uint32_t error_code;
+ uint32_t oldmask;
+ uint32_t gregs[16];
+ uint32_t arm_cpsr;
+ uint32_t fault_address;
+};
+typedef uint32_t __sigset_t;
+typedef struct sigcontext mcontext_t;
+typedef struct ucontext {
+ uint32_t uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+} ucontext_t;
+enum ArmRegisters {R15 = 15, R13 = 13, R11 = 11};
+
+#endif
+
+
static void ProfilerSignalHandler(int signal, siginfo_t* info, void*
context) {
- // Ucontext is a glibc extension - no profiling on Android at the moment.
-#ifdef __GLIBC__
USE(info);
if (signal != SIGPROF) return;
if (active_sampler_ == NULL) return;
@@ -581,7 +606,6 @@
sample.state = Logger::state();
active_sampler_->Tick(&sample);
-#endif
}
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---