Add top-level trace markers for each benchmark

Also add new paragraph about using systrace correctly

Docs-Preview: https://skia.org/?cl=41502
Change-Id: I114c14cc2e87a8b72aec46d8c354d3ea877a41ab
Reviewed-on: https://skia-review.googlesource.com/41502
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2017-08-31 14:09:22 -04:00 committed by Skia Commit-Bot
parent d5a3f7f967
commit c3cdef5fb0
2 changed files with 27 additions and 19 deletions

View File

@ -46,6 +46,7 @@
#include "SkSurface.h"
#include "SkTaskGroup.h"
#include "SkThreadUtils.h"
#include "SkTraceEvent.h"
#include "Stats.h"
#include "ThermalManager.h"
#include "ios_utils.h"
@ -1272,6 +1273,8 @@ int main(int argc, char** argv) {
}
}
TRACE_EVENT1("skia", bench->getUniqueName(), "config", config);
target->setup();
bench->perCanvasPreDraw(canvas);

View File

@ -19,6 +19,11 @@ Running any tool with `--trace atrace` on an Android device will cause the appli
tracing information to [atrace](https://source.android.com/devices/tech/debug/ftrace). On other
platforms, this has no effect.
If you run `systrace` from the host command line, you will need to supply `-a <app_name>`,
and the `<app_name>` argument will need to exactly match the command line used on the target
device. For example, if you use `adb shell "cd /data/local/tmp; ./nanobench --trace atrace ..."`
you must pass `-a ./nanobench` or systrace will ignore events from the application.
Console Logging
---------------
@ -30,25 +35,25 @@ For simple situations, all tracing events can be directed to the console with `-
out/Release/dm --config gl --match ^gamma$ --trace debugf
~~~
[ 0] <skia.gpu> GrDrawingManager::internalFlush id=1 #0 {
[ 0] } GrDrawingManager::internalFlush
[ 0] <skia.gpu> GrGpu::createTexture id=1 #1 {
[ 0] } GrGpu::createTexture
[ 0] <skia.gpu> GrRenderTargetContext::discard id=1 #2 {
[ 0] } GrRenderTargetContext::discard
[ 0] <skia.gpu> SkGpuDevice::clearAll id=1 #3 {
[ 1] <skia.gpu> GrRenderTargetContext::clear id=1 #4 {
[ 1] } GrRenderTargetContext::clear
[ 0] } SkGpuDevice::clearAll
[ 0] <skia> SkCanvas::drawRect() #5 {
[ 1] <skia.gpu> SkGpuDevice::drawRect id=1 #6 {
[ 2] <skia.gpu> GrRenderTargetContext::drawRect id=1 #7 {
[ 3] <skia.gpu> GrRenderTargetContext::addDrawOp id=1 #8 {
[ 3] } GrRenderTargetContext::addDrawOp
[ 2] } GrRenderTargetContext::drawRect
[ 1] } SkGpuDevice::drawRect
[ 0] } SkCanvas::drawRect()
...
[ 0] <skia.gpu> GrDrawingManager::internalFlush id=1 #0 {
[ 0] } GrDrawingManager::internalFlush
[ 0] <skia.gpu> GrGpu::createTexture id=1 #1 {
[ 0] } GrGpu::createTexture
[ 0] <skia.gpu> GrRenderTargetContext::discard id=1 #2 {
[ 0] } GrRenderTargetContext::discard
[ 0] <skia.gpu> SkGpuDevice::clearAll id=1 #3 {
[ 1] <skia.gpu> GrRenderTargetContext::clear id=1 #4 {
[ 1] } GrRenderTargetContext::clear
[ 0] } SkGpuDevice::clearAll
[ 0] <skia> SkCanvas::drawRect() #5 {
[ 1] <skia.gpu> SkGpuDevice::drawRect id=1 #6 {
[ 2] <skia.gpu> GrRenderTargetContext::drawRect id=1 #7 {
[ 3] <skia.gpu> GrRenderTargetContext::addDrawOp id=1 #8 {
[ 3] } GrRenderTargetContext::addDrawOp
[ 2] } GrRenderTargetContext::drawRect
[ 1] } SkGpuDevice::drawRect
[ 0] } SkCanvas::drawRect()
...
~~~
Chrome Tracing