Closed Bug 916409 Opened 11 years ago Closed 10 years ago

Data retriever for task tracer

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 992454

People

(Reporter: sinker, Assigned: shelly)

References

Details

Attachments

(2 files, 1 obsolete file)

A desktop tool to retrieve data generated by Task Tracer from the device and generate a plain text log file for postmortem investigation.

This bug comprise a device side agent code and a desktop side tool.  The device side agent collects log buffers in threads of b2g and content processes.  The desktop tool will connect to the device, reading data from agent, and parsing data, and generate a plain text log.

Bug 908995 would keep data in a per-thread ring buffer.  So, the agent should read the data from ring buffers in a efficient way.
Assignee: nobody → slin
To summarize what has been experimented on:

1. Hook up with Gecko Profiler, use profile.sh to start up and start logging Task Tracer.

However, since we are not using the Profile Entry in Gecko Profiler, I don't think it's necessary to run Task Tracer with ./profile.sh start, but we can still leave the initialization of Task Tracer in |profiler_init()|.

2. Use PR_LOG to log raw data (to be clear, raw data is a plain text log, for use by the data converter in bug 956620).

We have to open one PR_LOG file per process, but if we let content processes to open the file, we not only encounter a permission denied problem and a security issue. So a better approach is to open files by b2g process through ipc.

3. Use a daemon process to handle the read/write of log file.
4. Use adb logcat, and write out the result to a file.

Might increase the overhead by abusing adb logcat.
Clear previous logging with 
$adb logcat -c

Start logging Task Tracer with 
$adb logcat *:S TaskTracer:I > pathToLogFile/tt.log
Attached file tasktracer.sh (obsolete) —
A script that triggers adb logcat, and writes the logs to a specified file.

Usage:
First, please "tasktracer.sh" in your B2G folder.

B2G_DIR$ ./tasktracer.sh help
--> Shows a simple help message.

B2G_DIR$ ./tasktracer.sh start
B2G_DIR$ ./tasktracer.sh start -f my_logfile.logcat
--> Starts logging TaskTracer with adb logcat, and writes the logs to a default log file: PWD/task_tracer.logcat, or my_logfile.logcat if -f is set.

B2G_DIR$ ./tasktracer.sh stop
--> Stops writting logs to logfile.
> Usage:
> First, please "tasktracer.sh" in your B2G folder.
> 
s/please/place
Attachment #8362467 - Attachment mime type: application/x-shellscript → text/plain
Attached file tasktracer.sh
Add a new command to retrieve memory maps of b2g processes from device, and save those files to the current folder:

B2G_DIR$./tasktracer.sh get_mmaps
Attachment #8362467 - Attachment is obsolete: true
No longer depends on: 908995
Blocks: 995058
FYI: I made a version that uses unix domain socket to collect the data. In theory this is faster than adb logcat and won't drop messages.

Gecko branch: https://github.com/kanru/gecko-dev/tree/tt-v5
Log server: https://gist.github.com/kanru/01c48650ee5541316798

Compile the server with |arm-linux-androideabi-gcc logserver.c -o logserver| and put it under /data/local/tmp
tasktracer.sh is modified to start/stop logserver.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: