aboutsummaryrefslogtreecommitdiff
path: root/systrace.py
AgeCommit message (Collapse)Author
2016-08-23Prune old pyc filesJohn Reck
Bug: 31038810 Change-Id: I800eaeae0b7c233d7dcabdbd2479bfb0132eb4ae
2016-08-19Update to latest catapult (1ff7619f)Chris Craik
bug:21925298 bug:29643805 bug:30299278 bug:30397774 bug:30953297 Change-Id: I4d73c3c5454541a50703253ebeb63e5b2ea01fec
2016-03-28Update to latest catapult (e5abb7bd)android-7.1.0_r7android-7.1.0_r6android-7.1.0_r5android-7.1.0_r4android-7.1.0_r3android-7.1.0_r2android-7.1.0_r1nougat-dr1-releasenougat-devChris Craik
Change-Id: Ic610f2da8ecd564d5dd58cbc8b9a738ee74b2a06
2015-08-28Update after moving the code to CatapultZhen Wang
Change-Id: I0b9e15f8d5743811f3a722e7a692e89e7e36734e Signed-off-by: Zhen Wang <zhenw@google.com>
2015-08-11Changed how pre processing commands are issued & added fix_tgids opt.Scott Bauer
Replaced the old method of issuing pre processing commands to the device in the same popen call, then matching on regular expressions to extract the data. Now for each pre processing command the command is sent in its own popen call and has its own parsing function. Added code to look for tgis in procfs on the device. The kernel provides a mechanism to map TGIDS to PIDs but the buffer easily gets overrun. This is a host side fix to try and patch up as many missing TGIDS as possible
2015-07-28Enable Systrace to be used during boot.Yasuhiro Matsuda
- Add BootAgent, which is an AtraceAgent specializing in tracing the boot sequence, and its test. - Add --boot option. This sets persist.debug.atrace.boottrace property, which triggers atrace during boot, writes categories to /data/local/tmp/boottracecategories, which is used by atrace as enabled categories, and reboots the device. Once the device has booted up, the report is created by the user hitting Ctrl+C. BUG: 21739901 Change-Id: I5e27a402f3d32cb151227d3d222c05da39eca28c
2015-06-25add support for legacy (pre-4.3) platformYoung-Ho Cha
It seems systrace-legacy.py had not maintained for a while and has some bugs and missing features. So implement atrace_legacy_agent to use legacy platforms. Change-Id: I9a60c4d9899cff5d088d00c8be643493fc163272 Signed-off-by: Young-Ho Cha <ganadist@gmail.com>
2015-06-22Refactor systraceZhen Wang
Refactor systrace so it is easier to add additional tracing method. Change-Id: If74b5dd75cb1a1fcfdc0012b01452a56d776966a Signed-off-by: Zhen Wang <zhenw@google.com>
2015-06-10Add unit test for systrace.pyZhen Wang
Change-Id: Ia4a636a6e019c91db5e1d49ea99d0706520ea32a Signed-off-by: Zhen Wang <zhenw@google.com>
2015-05-29Fix systrace.py to work on Windows.Brent Austin
The previous implementation used the python select command, which only works on network sockets in Windows. Fixed CR/LF stripping to work on windows. Added a progress indicator that shows while data is being collected. Change-Id: I1b39dde8e73956eef57eebf489e611f23ee6a7c6
2015-05-29Fix error with --list-categories caused by wrong indentation.Brent Austin
Change-Id: I65adc7a723e18994c161df7cd995cf5a950115ae
2015-05-28Refactored main().Brent Austin
Split main into smaller functions for improved readability. This is in preparation for adding support for Windows. Change-Id: I4786821b0350fd937e4b5d21a4ced7b7e154edc1
2015-05-15More robust error handling for calls to adb.Brent Austin
Print better error messages when adb fails. The output from adb is displayed so any problems are easier to debug. Also added the device serial number parameter when calling adb to get the list of available trace categories. Change-Id: I77229ca39988d034be33b9363f7e9b882468eddd
2015-05-14Added --no-compress option.Brent Austin
Added an option to download the trace data in plain text, instead of in zipped form (--no-compress). This may be necessary if the zipped trace data contains embedded CR+LF sequences. This could be a problem in theory, but in practice this either never happens or is very infrequent. This is also a handy option to use when debugging this script and it's communication with adb. Change-Id: I814e883424234c1e0284459b229447dea0c1a410
2015-05-14Added python version check.Brent Austin
This script uses Python features introduced in version 2.7. The script will now exit with an error if run with a version prior to 2.7. Change-Id: I8edaee119b773c57ad7e1725d2ff0f5e42fbd756
2015-05-14Add comments and reformatting to get rid of lint warnings.Brent Austin
Added a few comments and cleaned up most lint warnings. I was not able to fix lint warnings about the interpreter and copyright blocks (pylint comments to disable those warnings also did not work). I left in a few warnings in code that is being substantially changed as part of another CL. Change-Id: I365d8caeb264521c45b5995a24951b0da8eb4c29
2015-05-13Fix traces generated from an async invocation of atraceAdrian Roos
Such traces can become inconsistent because the trace buffers are kept per CPU. To work around this the prefix of the trace where not all CPUs have data yet are discarded. Bug: 21037114 Bug: 19437218 Change-Id: I8e0c5d5eab89a81691a3dfe485b62f76c7c1535c
2015-05-07Improve robustness of thread name fixingAdrian Roos
Accept any number of spaces between the headers of the ps command because they are not stable across Android versions. Bug: 20160776 Change-Id: Ib5737036d26bfd4675508b802a054c1a0358e56a
2015-04-28Fix adb shell argument constructionChris Craik
bug:20657957 Change-Id: I56f9be987c79f623ee57c2a0c8571e9444602a2d
2015-04-08Merge "Added ability to import traces from multiple tracers."Chris Craik
2015-04-07Set default tracing categoriesChris Craik
Change-Id: Iab60ac8a6552a5ebef5749ea2b743d616cd708ec
2015-04-06Added ability to import traces from multiple tracers.Aaron Schulman
The current design of systrace can only process traces from one tracer, atrace. This change makes it possible to import multiple tracers that can be stored in the trace.html output. Each trace is now stored as a script tag with class "trace-data". This patch also simplifies storing traces in the trace.html output. Instead of storing traces in a javascript variable, they are now simply stored as scripts with type "application/text". Change-Id: I39efd7e1a512fb37f84ff0c7ef6105e13bf1491b
2015-04-02Escape double quotes in trace contentsChris Craik
Change-Id: I179eb5ae88f7f4e1992ad4de0e67ae3ac30e58cb
2015-04-01Update to latest trace viewerChris Craik
Upstream trace viewer has changed substantially since last pull. First, the old flattening into js + css + html workflow has been replaced with a new flatten into single html file workflow. Second, trace viewer has moved to git. Some pieces that were previously only in systrace are now upstream as well. In particular, minification is now upstream. Thus, the minifying features in systrace can be removed. Change-Id: Ibc6a46fa3dccff8b771a95aae1909cf178157264
2014-08-15Fix thread names when absent or truncated.Jeff Brown
When a large number of threads are active, the kernel may start to report <...> as the name of a thread in the trace buffer which is rather unhelpful. This change uses information from 'ps -t' to fix thread names when they are absent or truncated. Use the '--no-fix-threads' option to disable this feature. Change-Id: I6566e557eeac33311ff5d4c6e95ff010cb83a0d6
2013-07-19Extract prefix and suffix html blocks to separate filesSiva Velusamy
The Monitor tool in SDK has a duplicate copy of the prefix and suffix html blocks, which necessitates changes in both places whenever the prefix block changes. Moving the html out of the script allows Monitor to reuse the same content. Change-Id: I012df9ef3423b546a2ced213bee1ccbba9d4c9cc
2013-07-15systrace: update to trace-viewer rev 740Jamie Gennis
Change-Id: I56fd37959b15653100a6add274c066c4359d55f0
2013-06-04systrace: remove the use of a Python 2.7 functionandroid-4.3_r2.3android-4.3_r2.2android-4.3_r2.1android-4.3_r2jb-mr2.0-releasejb-mr2-devJamie Gennis
Change-Id: Ic0f4890d450541736f5909273cabcbad2ba3e3fe
2013-06-03systrace: add support for older platform versions.Jamie Gennis
This change re-adds the old Systrace script from before JB MR2 and exec's it from systrace.py when it detects that the device's SDK-version is less than 18. This change also modifies the pre-JB-MR2 script to generate HTML that is compatible with the latest script.js and style.css. Change-Id: I29c3327e95f8fd0a4aab730845abac84e66848ef
2013-05-13systrace: fix pipe readingJamie Gennis
This change fixes a bug where systrace.py would neglect to read the end of the data coming from its subprocess pipe. This caused the --from-file argument to produce HTML files containing truncated traces. Change-Id: I265c9000ceff27debe2965a402fead4ff7ff8644
2013-04-08systrace: add kernel function tracing supportJamie Gennis
Change-Id: I7a446c7604ea29ffd58e59114b646720f97bdc85
2013-03-29systrace: plumb the -a flag through to systrace.pyJamie Gennis
Change-Id: I93d10fb3c526c3cbe6a19220b489bb327bb3146b
2013-03-27systrace: update to trace-viewer rev 237Jeff Brown
Change-Id: I3ebd2235f528d2eae22256027ca547d85d9a0904
2013-03-08systrace: fix CRLF handlingJamie Gennis
This change cleans up the trace data processing part of systrace.py. It also makes the CRLF handling auto-detect the line endings of the incoming data. Bug: 8327984 Change-Id: Ibc43f50a258ace99c09a539478c2c270e2d0a087
2013-02-15Fix systrace when parsing from a trace fileXia Wang
Change-Id: Iefc5c5dcb3bc1886c7a660b06e715868c91bafbd
2012-12-07systrace: add support for the new atrace interfaceJamie Gennis
This change updates systrace.py to use the new command line args supported by the atrace on-device binary. Change-Id: Ic045db52196fde4b27c535cdb5946158fe6ff0bf
2012-10-08systrace: add support for using a trace fileandroid-sdk-support_r11android-cts-4.2_r2android-cts-4.2_r1android-4.2_r1android-4.2.2_r1.2android-4.2.2_r1.1android-4.2.2_r1android-4.2.1_r1.2android-4.2.1_r1.1android-4.2.1_r1jb-mr1.1-releasejb-mr1.1-dev-plus-aospjb-mr1.1-devjb-mr1-releasejb-mr1-dev-plus-aospjb-mr1-devGlenn Kasten
Change-Id: I58f210f3f67a2de92b93829856c9a969906946c3
2012-10-04systrace: add --bus-utilization optionErik Gilling
Change-Id: I33b09e49bfdb0413c710a77e37847b7b96e82259
2012-09-20systrace: rebase against upstream trace-viewerJamie Gennis
This changes replaces the use of the Chromium trace viewer code with that of the trace-viewer project (essentially the Chromium code factored out into its own project). It updates the update.py script to pull the source from there and adds an argument to systrace.py to use linked assets from a different directory to facilitate development of trace-viewer code using systrace to test. Change-Id: I5c5a4ce336ce82cd07f1f42e97d4b4cb918ec17a
2012-08-30add -e option for adb serialKeun young Park
- allows systrace with multiple devices - -s is already taken :( Change-Id: I7abbc42fb57b68b5fa0405b8c664c2abf7585e2e
2012-06-12am 1f5d4e97: systrace: handle user builds more gracefullyandroid-sdk-adt_r20tools_r20ics-plus-aospJamie Gennis
* commit '1f5d4e97822266b682a8a599b532b3b6460f9e3f': systrace: handle user builds more gracefully
2012-06-07systrace: handle user builds more gracefullyandroid-cts-4.1_r4android-cts-4.1_r2android-cts-4.1_r1android-4.1.2_r2.1android-4.1.2_r2android-4.1.2_r1android-4.1.1_r6.1android-4.1.1_r6android-4.1.1_r5android-4.1.1_r4android-4.1.1_r3android-4.1.1_r2android-4.1.1_r1.1android-4.1.1_r1jb-releasejb-mr0-releasejb-devJamie Gennis
This change adds an indication of which command line args require root to the --help output. It also defers opening the output file until after the trace has actual started being dumped so that if atrace exits with an error the output file is not truncated. Bug: 6513400 Change-Id: Ifa0ed1d3d5eef891fee7d9109c2bb988b03c2e4d
2012-05-31Add camera as an ATRACE tagEino-Ville Talvala
Change-Id: Idb45cad8aceed00ff957f8506081f877d39cf1a6
2012-05-22Add disk I/O tracing.Jeff Brown
Bug: 6488845 Change-Id: Id072d3deb557a285fe5dd12d0f5b4f335a524e3f
2012-05-22Clean up systrace a bit.Jeff Brown
Extract the various event definitions into a table instead of a switch statement. Add a --link-assets option to systrace.py to generate a trace.html file that has the CSS and JS assets linked in rather than embedded, which is useful for debugging purposes. Fixed a bug in the tests for lineRE. Bug: 6488845 Change-Id: I90634f7144fa0a050b911bb9854e5d5662dd6330
2012-05-11systrace: add a tracing tag for videoJamie Gennis
Change-Id: I29d6d1fbf84668d003941e0d79fedb7d9e9c0ea2
2012-05-09systrace: rename the tags propertyJamie Gennis
Change-Id: Ie326b4bd8647cda55501a9635f50bc2b2c69147a
2012-05-08systrace: move init code into a js fileJamie Gennis
This change moves the initialization Javascript code out of the HTML portion of systrace.py and into init.js. This new Javascript file is then included in the Javascript minification. Change-Id: I3a474331a5970309b8166b57b52789932283c6b1
2012-05-07systrace.py: support for CPU idle event tracingJamie Gennis
This change adds the -i and --cpu-idle flags to systrace.py to enable tracing of CPU idle events in the kernel. Change-Id: I668718c3abd07fe9b5fa19871c36e83267017caf
2012-05-07Add audio tag to systraceGlenn Kasten
Change-Id: I0e39443eec7420b21827d3255b985028fee09b92