TaskTracer

From MozillaWiki
Revision as of 08:35, 8 May 2014 by Gyeh (talk | contribs) (→‎TODO)
Jump to navigation Jump to search

Introduction

TaskTracer aims at the correlation between Tasks and Runnables, across threads and processes.

By looking at a task, TaskTracer tells you:

  • The “source events” of this task.
    • IO events: touch events, key events, wifi daemon signal
  • Where it is dispatched from.

How to use Task Tracer

1. Get the source code of Task Tracer.

git clone https://github.com/shellylin/gecko-dev/tree/tt-v5
(Base on m-c)
git clone https://github.com/shellylin/gecko-dev/tree/tt-1.3t
(Base on v1.3T)

2. Build and flash to a real device.

cd B2G
export MOZ_TASK_TRACER=1; ./build.sh gecko
./flash.sh gecko

3. Get the source code of data retriever and data converter.

git clone https://github.com/ginayeh/task-tracer-converter

4. Start profiling.

cd task-tracer-converter
./tasktracer.sh start

5. Stop profiling.

 ./tasktracer.sh stop

The raw log is written into task_tracer_data.logcat.

6. Get memory maps from the real device.

mkdir mmaps
./tasktracer.sh get_mmaps

The memory maps pulled out from the real device are put under mmaps directory automatically.

7. Prepare data for extracting class/task name.

./prepare-data.sh mmaps $objdir

Two intermediate files are generated for later use: mem_offset, symbol.

8. Convert raw log to JSON format.

python task_tracer_converter.py -i task_tracer_data.logcat [-o task_tracer_data.json] [-w]

Default output filename: task_tracer_data.json.

How to read the profile using Isis

Import the json file to Isis, http://alivedise.github.io/isis/

Reference links

TODO

  • Integrate with built-in profiler
    • Timestamp
    • Start/Stop
  • Thread pool
  • CpuTime
  • Integrate with Cleopatra
  • Nested loop
  • Ruler