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

Unified Diff: systrace/systrace/tracing_agents/ftrace_agent.py

Issue 1866753002: Add new timing mechanism to ftrace. (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: rebase Created 4 years, 8 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
« no previous file with comments | « systrace/systrace/run_systrace.py ('k') | systrace/systrace/tracing_agents/ftrace_agent_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: systrace/systrace/tracing_agents/ftrace_agent.py
diff --git a/systrace/systrace/tracing_agents/ftrace_agent.py b/systrace/systrace/tracing_agents/ftrace_agent.py
index 89d3e1aefbc8277106cf72d2df72e3579cf7429f..fc69c74c633f989b33bbc6287856561172b608c2 100644
--- a/systrace/systrace/tracing_agents/ftrace_agent.py
+++ b/systrace/systrace/tracing_agents/ftrace_agent.py
@@ -4,7 +4,6 @@
import os
import sys
-import time
from devil.utils import timeout_retry
from systrace import tracing_agents
@@ -116,13 +115,6 @@ class FtraceAgent(tracing_agents.TracingAgent):
buffer_size = self._options.trace_buf_size
return buffer_size
- def _get_trace_time(self):
- wait_time = 5
- if ((self._options.trace_time is not None)
- and (self._options.trace_time > 0)):
- wait_time = self._options.trace_time
- return wait_time
-
def _fix_categories(self, categories):
"""
Applies the default category (sched) if there are no categories
@@ -168,23 +160,12 @@ class FtraceAgent(tracing_agents.TracingAgent):
args=[options, categories])
def _StopAgentTracingImpl(self):
- pass
-
- def StopAgentTracing(self, timeout):
- return timeout_retry.Run(self._StopAgentTracingImpl,
- timeout, 1)
-
- def _GetResultsImpl(self):
"""Collect the result of tracing.
This function will block while collecting the result. For sync mode, it
reads the data, e.g., from stdout, until it finishes. For async mode, it
blocks until the agent is stopped and the data is ready.
"""
- try:
- time.sleep(self._get_trace_time())
- except KeyboardInterrupt:
- pass
self._fio.writeFile(FT_TRACE_ON, '0')
for category in self._categories:
self._category_disable(category)
@@ -195,6 +176,11 @@ class FtraceAgent(tracing_agents.TracingAgent):
if self._options.fix_circular:
print "WARN: circular buffer fixups are not yet supported."
+ def StopAgentTracing(self, timeout):
+ return timeout_retry.Run(self._StopAgentTracingImpl,
+ timeout, 1)
+
+ def _GetResultsImpl(self):
# get the output
d = self._fio.readFile(FT_TRACE)
self._fio.writeFile(FT_BUFFER_SIZE, "1")
« no previous file with comments | « systrace/systrace/run_systrace.py ('k') | systrace/systrace/tracing_agents/ftrace_agent_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698