summaryrefslogtreecommitdiffstats
path: root/runtime/trace.cc
diff options
context:
space:
mode:
authorJeff Hao <jeffhao@google.com>2013-08-29 11:18:01 -0700
committerJeff Hao <jeffhao@google.com>2013-08-29 16:14:56 -0700
commit64caa7dcf46ed6139b766dbe77fbd7353899417f (patch)
tree9606418421c5cda2116e343ae5988f98fc4fd03a /runtime/trace.cc
parentafbe1622c02379fb7f7835d73a5594b40d31d3ea (diff)
downloadart-64caa7dcf46ed6139b766dbe77fbd7353899417f.tar.gz
art-64caa7dcf46ed6139b766dbe77fbd7353899417f.tar.bz2
art-64caa7dcf46ed6139b766dbe77fbd7353899417f.zip
Change IsMethodTracingActive to GetMethodTracingMode for art.
This allows traceview to tell whether sampling or just normal method profiling is enabled. Change-Id: I518a1888a90bc50568fe56bf708d801027ac98d7
Diffstat (limited to 'runtime/trace.cc')
-rw-r--r--runtime/trace.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 6d040e15dc..7b25306177 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -427,14 +427,20 @@ void Trace::Stop() {
}
void Trace::Shutdown() {
- if (IsMethodTracingActive()) {
+ if (GetMethodTracingMode() != kTracingInactive) {
Stop();
}
}
-bool Trace::IsMethodTracingActive() {
+TracingMode Trace::GetMethodTracingMode() {
MutexLock mu(Thread::Current(), *Locks::trace_lock_);
- return the_trace_ != NULL;
+ if (the_trace_ == NULL) {
+ return kTracingInactive;
+ } else if (the_trace_->sampling_enabled_) {
+ return kSampleProfilingActive;
+ } else {
+ return kMethodTracingActive;
+ }
}
Trace::Trace(File* trace_file, int buffer_size, int flags, bool sampling_enabled)