OSDN Git Service

Rearrange the way SignalCatcher writes logs.
authorAndy McFadden <fadden@android.com>
Wed, 10 Mar 2010 21:42:22 +0000 (13:42 -0800)
committerAndy McFadden <fadden@android.com>
Wed, 10 Mar 2010 21:50:35 +0000 (13:50 -0800)
commitc9dcf262db56d831eb45bb44978a6261e16a2d78
tree5233b67c7ee759909a4629a9809fefb9fbbda610
parent77fbf5c29a9dd62f64e8e98376724b86e79ae8f6
Rearrange the way SignalCatcher writes logs.

This is an attempt to reduce the amount of time that threads are suspended
while dumping stack traces in response to a SIGQUIT.  This is primarily
for ANRs and bugreport generation, where many different apps may be trying
to write their stacks out concurrently.

Instead of grabbing the file with flock() and then printing the traces
to the file, we render the traces to memory and write them with a single
write() call to an O_APPEND fd.  Also, the file access now occurs after
the VM threads have been resumed to avoid stalling on I/O.

No change was made to the format of the output.

For bug 2504471.

Also: did some rearranging in the file.

Change-Id: If505ec014237289a6cc86aa09bc66b3a126b345c
vm/SignalCatcher.c