Commit Graph

63 Commits

Author SHA1 Message Date
Nick Kralevich
cd67e9f059 dumpstate: add O_CLOEXEC
Add O_CLOEXEC to various file descriptor calls, to avoid
leaking file descriptors to dumpstate's child processes.

Bug: 18342188
Change-Id: I74c47a98dfddc29c618067ad53d879b98ed1d87a
2015-03-19 11:32:02 -07:00
Christopher Ferris
69a141e07f am 9d68ed0e: Merge "Add timeout for dump_file."
* commit '9d68ed0ecd3a101c13a163cfe730b13b1564b442':
  Add timeout for dump_file.
2015-02-26 18:40:42 +00:00
Christopher Ferris
9d68ed0ecd Merge "Add timeout for dump_file." 2015-02-26 18:35:02 +00:00
Mark Salyzyn
2f655daeea am bb67beca: Merge "dumpstate: add pstore read"
* commit 'bb67beca35e7d570ede193a316a92022fbc2f810':
  dumpstate: add pstore read
2015-02-26 17:29:07 +00:00
Mark Salyzyn
2262c16372 dumpstate: add pstore read
Call logcat -L to pull any LAST Android logs. If the kernel is not
configured for PSTORE and PSTORE_PMSG, the hopes are the empty
content will pressure vendors to slice up and configure support.

Change-Id: I5fddfa1e0f59f24fccc30b257ba68af8a8cf8640
2015-02-26 07:41:41 -08:00
Christopher Ferris
54bcc5ffd5 Add timeout for dump_file.
It turns out dump_file is used on a number of /proc and system files.
In one case, the read of a file stalled and caused a bugreport to
hang forever. It's still possible if there is a kernel bug that this
could stall forever, but less likely.

Also, change the return type of nanotime to uint64_t.

Testing:
- Created a named fifo and verified that dump_file fails with a timeout.
- Created a large /data/anr/traces.txt to verify that large files still
  dump properly and that the additional NONBLOCK parameter doesn't cause
  a problem.
- Created a dummy /data/tombstones/tombstone_00 to verify that the
  dump of these files still works.
- Compared a dump using the old dumpstate to the new dumpstate to verify
  nothing obviously different.

Bug: 19117030
Change-Id: I0d3dd27583c853cdaccd2fd278748cb5f9ccd4fb
2015-02-25 19:59:29 -08:00
Christopher Ferris
34e3246646 am 8511b3ae: Merge "Remove -z option."
* commit '8511b3ae5eb42810f97f7c3e993d7f80d3393b83':
  Remove -z option.
2015-02-10 16:53:52 +00:00
Christopher Ferris
ff4a4dc7e6 Remove -z option.
This option doesn't work with the current selinux protections and
doesn't serve much of a purpose. You can get the same results running
this:

dumpstate | gzip > /data/local/tmp/dump.txt.gz

Bug: 19271141
Change-Id: Icc76200df33dc708e30c556ec8a0f393f995fe7c
2015-02-09 16:45:35 -08:00
Elliott Hughes
e55073a96c am 0e17a265: Merge "Switch dumpstate to "ip link list"."
* commit '0e17a265f5e8bf233a3e3b74fc03ada3dc467bed':
  Switch dumpstate to "ip link list".
2015-01-28 17:34:16 +00:00
Elliott Hughes
a59828a5d2 Switch dumpstate to "ip link list".
Change-Id: Ia1db51c866890f09fbd4316764dea5982554598f
2015-01-28 08:45:40 -08:00
Dianne Hackborn
4ba58f69cd Work on issue #18486438: Reduce size of bugreport output
Don't put packages.xml in to the output.

Change-Id: I88a682866365886506a003a64deb4a29c16ba21c
2014-11-21 16:41:31 -08:00
Mark Salyzyn
9cea6ccbd8 dumpstate: report device uptime mmc performance
Bug: 18085992
Change-Id: Ibc0a37d3d2649d1e6708d9357f37ed75f2cea121
2014-11-04 09:39:27 -08:00
Arve Hjønnevåg
2db0f5f31c dumpstate: Add trusty version if driver is found
Change-Id: I7780ea8e1d777c222a73408f70d8a6d49dee1d92
2014-10-16 16:11:07 -07:00
Christopher Ferris
ed9354fc84 Accept socket connection before tracing.
Sometimes dumping threads takes a long time and bugreport times
out. This change will cause us to accept the bugreport socket connection
before dumping threads and should avoid the failed to connect to dumpstate
service problems we've seen.

Bug: 17758374
Change-Id: I80afa0353cf1c340873f481a8d1d7faffff54120
2014-10-01 17:35:01 -07:00
Jeff Brown
1dc94e3156 Make dumpstate vibrate immediately.
Previously, the vibration was not performed until after stacks
were gathered which takes a long time.  Moved the vibration
to happen earlier so we provide better user feedback for the
three-button salute when collecting a bug report.

Deleted some dead code for playing begin/end sounds.

Improved the timing measurement code to help track down why
bug reports are so slow.  (They take over a minute now which
can cause us to lose valuable diagnostic information.)

Bug: 17474152
Change-Id: Iac73f7993d7dc85196aad96f459b22fd4a710f94
2014-09-11 14:19:04 -07:00
Andres Morales
2e671bbdb7 Fix deadlock when killing adb bugreport
Leave default signal handler (terminate) for parent process,
add SIG_IGN as signal handler for children and let them
go down when the parent gets SIGPIPE.

Bug: 17109154
Change-Id: Id33db3e97a32f289eb2a9a1a0ca8acbe3dcd285d
2014-08-22 12:10:44 -07:00
Lorenzo Colitti
d4c3d38957 Improve network connectivity dumping.
1. Explicitly dump IP addresses.

   Currently, some IP addresses are dumped using netcfg, but that
   only dumps the first IPv4 address on each interface. Instead,
   call ip -4 addr and ip -6 addr explicitly to dump all IPv4 and
   IPv6 addresses on the system.

2. Disable dumping /proc/net/{ipv6,}route, because:

 - We already dump all IPv4 and IPv6 routes in the tables that
   we use.
 - /proc/net/route is confusing because it only includes routes
   in the main table, which are all but unused. It's also in
   unreadable host-byte-order hex.
 - /proc/net/ipv6_route is confusing because it includes routes
   from all tables but does not say what table they are in.

3. Instead of dumping the contents of /proc/net/arp , use
   "ip -4 neigh show" and "ip -6 neigh show" to dump the
   neighbour caches for both IPv4 and IPv6.

Bug: 16663736
Change-Id: Id3e509b877ab7b00eb2399b6a9868b12245da2f0
2014-07-31 01:56:12 +00:00
Christopher Ferris
7dc7f3221f Add dumping of tombstones to dumpstate.
Dump only those tombstones modified within the last half an hour.

Change-Id: I8ce836b2e19eba7a9c0c31a4f312f9a382526da7
2014-07-23 19:18:07 -07:00
Elliott Hughes
d2a049220a Always #include <sys/...>, not <linux/...>.
(cherry picked from commit 1e4ee9afd2)

Change-Id: Ie005774484f98bb33c8f867cddb778ac04a1d4ea
2014-07-18 18:19:54 -07:00
Matthew Xie
f3381cf1a6 dump bluedroid kernel status do not merge
Change-Id: I4617f770088f86ceda2caf58bd1fdae81b3e31df
(cherry picked from commit ed3b9a0977)
2014-07-14 20:53:32 +00:00
Sreeram Ramachandran
c88da7cc21 resolved conflicts for merge of 928e05b1 to master
Change-Id: I1d1e623a1f95baa4375a87242ce71ea789884649
2014-07-09 08:05:04 -07:00
Sreeram Ramachandran
928e05b12b am 0d2bee0c: Merge "Dump all the correct routing tables."
* commit '0d2bee0c0baec56ec98867d7e044602097525248':
  Dump all the correct routing tables.
2014-07-09 00:13:15 +00:00
Sreeram Ramachandran
2b3bba34ae Dump all the correct routing tables.
The list of tables is maintained in /data/misc/net/rt_tables by netd.

Change-Id: I55475c08c5e43bcf61af916210e680c47480ac32
2014-07-08 16:29:45 -07:00
John Spurlock
5ecd4beef8 Dump system settings for all users
Change-Id: Ic832b19fe698da1984876b2949c3f26990ae5076
2014-01-29 14:34:24 -05:00
Todd Poynor
2a83daa8a3 dumpstate: dump console-ramoops instead of last_kmsg if present
Change-Id: I41a922b33f0b6b4e8e150a92e46032501a165e33
2013-12-10 14:42:27 -08:00
Dianne Hackborn
59b1516f4c Fix issue #10422349: Limit/change the battery history data in batterystats
Use new compact option to include history when dumping battery stats.

Change-Id: I3833a88db76d8791bd5c2e8f6ff414af65472a42
2013-09-04 18:04:14 -07:00
Dmitry Shmidt
1d6b97c869 dumpstate: Fix wifi list of networks dump
Bug: 9056601

Change-Id: Ia0adb67afdf3d478033d0ee34bbb95e621e2fe51
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-08-21 10:58:29 -07:00
Todd Poynor
4f5b9a701b dumpstate: switch to HAL static libraries
Change-Id: I865a0b4b4a84a2d54a239e7b09874287f0c1ad56
2013-08-13 16:30:01 -07:00
Alex Ray
656a6b9e36 dumpstate: remove libutils dependency
Change-Id: I9745f389402c01b90877612e060ac996eba99964
2013-07-23 17:51:19 -07:00
Nick Kralevich
76b45c126b dumpstate: Show SELinux process labels
Change-Id: Ie19586a3b733bd4420f6b20b5d253d42c2f165ea
2013-07-15 12:21:40 -07:00
Dianne Hackborn
1bd5068a51 Fix cmd line arguments for usagestats.
Change-Id: I9a1436aa1d1665924ba62a568bb4b66d67ae2814
2013-07-12 12:19:44 -07:00
Dianne Hackborn
5cd46aa339 Update to follow procstats options changes.
Change-Id: I6f016c944cfcd01bbbcf3cf37bc7ff05482f0012
2013-07-09 15:01:40 -07:00
Dianne Hackborn
3e5fa73722 Update to use --include-committed for procstats.
Change-Id: I5ce737b624c5617c94054d6bedebca754fbf16a9
2013-07-03 16:51:15 -07:00
Dianne Hackborn
02bea9786d Add checkin dumps to bug reports.
This is a duplicate of the associated human-readable dumps
of these services, but much better for automated parsing.

Change-Id: I902b768b03aeac1472f03f96913f9b8ada5dba9c
2013-06-26 18:59:09 -07:00
jp abgrall
4b2b0a7494 am 74bd799e: Merge "Exit dumpstate on SIGPIPE to avoid cascading child crashes"
* commit '74bd799ec20d2420459fa382533b1cc39ca9a54c':
  Exit dumpstate on SIGPIPE to avoid cascading child crashes
2013-05-28 15:46:14 -07:00
John Michelau
885f888c55 Exit dumpstate on SIGPIPE to avoid cascading child crashes
When dumpstate ignores SIGPIPE it can lead to a cascade of tombstones /
coredumps since many of its children don't handle or ignore it.  It's
best to just exit dumpstate once the pipe is broken.

Change-Id: Ic0c57ecf4171f0c0a07837e51c41cb1876e1350c
2013-05-28 14:20:59 -05:00
Jeff Sharkey
aaaa57bf89 Bugreport broadcasts are only useful to owners.
Bug: 8415156
Change-Id: Ia73969262abe9f715f038dad934651d7e5d65c87
2013-03-25 17:15:57 -07:00
Jeff Sharkey
5a93003d3f Move screenshots near beginning of dumpstate.
Bug: 8420215
Change-Id: I6adffd1182ed8f99b8d11d43785a4eb4a388ceb5
2013-03-19 15:19:48 -07:00
Jeff Sharkey
7560443061 Increase screenshot timeout.
Devices with large displays take longer than 5 seconds to write.

Change-Id: If74bc4a3cec366ae28eca549bce28ef212e47d8f
2013-03-14 10:20:31 -07:00
Jeff Sharkey
27f9e6d849 Support broadcast when dumpstate finishes.
Add flag that sends BUGREPORT_FINISHED broadcast when dumpstate
is finished, including the resulting filesystem paths.  Also reduces
directory creation to 0770.

Bug: 7005318
Change-Id: Id4c6b699a56f8acd859b7ab73368500e1a8f3c67
2013-03-13 16:59:27 -07:00
Nick Kralevich
98ca63e6d1 am 22641851: Merge "dumpstate: use correct header file."
* commit '22641851c48fee6e79d01adcfab01c0b625cfb3c':
  dumpstate: use correct header file.
2013-03-01 18:05:56 +00:00
Nick Kralevich
e96b2d0037 dumpstate: use correct header file.
Change-Id: I006d7a219ce6309259f271beff6011cc266f1a61
2013-02-28 16:46:22 -08:00
Dmitry Shmidt
5b8176471c Remove obsolte 'su' from 'ping' call (to work on user build)
Change-Id: I2d391bbd39fc591eef33b9c9e4b4cdbda29e41e7
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-02-22 11:27:58 -08:00
Ken Sumrall
8f75fa7bcf Do not use su to run the df command in bugreports
User builds do not have su, so when the bugreport attempts to report
disk free space, the command fails and nothing is reported.  However,
the df command does not need to be run as root to report free space,
so just run the command directly.

Change-Id: Ic7deb696f293e772ddf28eacfe16e4250af9a9f3
2013-02-08 17:35:58 -08:00
Dmitry Shmidt
258fe7eac9 am 77622879: am 4bacaec4: am 0b2c9268: bugreport: Add /proc/interrupts dump
* commit '77622879a6a12c6cb916df46c919dde87656e6df':
  bugreport: Add /proc/interrupts dump
2012-11-08 15:59:28 -08:00
Dmitry Shmidt
03d0600ea7 am af9e8a59: am 61db92e7: am c11f56e5: bugreport: Add wlan FW counters dump for bcmdhd
* commit 'af9e8a59619ec6050739dd68ea108cc7e182d059':
  bugreport: Add wlan FW counters dump for bcmdhd
2012-11-08 15:59:27 -08:00
Dmitry Shmidt
0b2c926826 bugreport: Add /proc/interrupts dump
Bug: 7301178

Change-Id: Ifad3b981ac904d4637d69dfc223d5bb2c9d80bda
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2012-11-07 11:09:46 -08:00
Dmitry Shmidt
c11f56e561 bugreport: Add wlan FW counters dump for bcmdhd
Bug: 7494877

Change-Id: I4d24dbcf7596777ec02ab1312c2ab996ba7688f1
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2012-11-07 10:42:05 -08:00
Colin Cross
0c22e8b316 dumpstate: dump all threads in show_wchan
for_each_pid only finds processes and not their threads.  Add
for_each_tid and call it for show_wchan so we can see where all
threads are blocked in the kernel.

Change-Id: Iffb59f7c2933cecf51cdd358a36e19932c2f24c7
2012-11-02 23:57:43 -07:00
Colin Cross
2281af967d dumpstate: add kernel memory fragmentation unusable index
Dump /d/extfrag/unusable_index in bugreports.  It shows the
percentage of memory in each zone that is not available for
allocations for each order.

Change-Id: I2af6680cb609887ea7b3d6107d1aa88bd0206b52
2012-10-28 22:41:06 -07:00