chromiumos/platform/debugd.git
7 days ago[debugd] return relative paths from GetUserLogFiles 70/48370/3 factory-4128.B factory-spring-4131.B master
Elly Fong-Jones [Wed, 17 Apr 2013 17:31:13 +0000 (13:31 -0400)]
[debugd] return relative paths from GetUserLogFiles

This serves to handle multiprofile - Chrome becomes responsible for gluing the
paths to active profiles onto the paths returned by this method.

BUG=chromium:221779
TEST=adhoc
dbus-send --system --fixed --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.GetUserLogFiles

This should output relative paths.

Change-Id: I79c78f2f0c7db5893a5877f436f90c5b9648040d
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48370

11 days agodebugd: Add packet capture tool 11/50011/5 release-R28-4100.B
Paul Stewart [Fri, 3 May 2013 01:13:21 +0000 (18:13 -0700)]
debugd: Add packet capture tool

Add a tool for performing interface-based or over-the-air capture.
This uses a helper shell script to select or create a monitoring
interface, and a small binary for generating a pcap file.

CQ-DEPEND=CL:50010
BUG=chromium:218380
TEST=Unit tests (for the shell script) and manual tests on a
daisy with a USB WiFi dongle.

Change-Id: I8bb7d5f2ac23eb249ed097e047a2672670445f39
Reviewed-on: https://gerrit.chromium.org/gerrit/50011
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 weeks agodebugd: power-supply-info -> power_supply_info. 64/49664/2
Daniel Erat [Tue, 30 Apr 2013 21:58:56 +0000 (14:58 -0700)]
debugd: power-supply-info -> power_supply_info.

BUG=chromium:236858
TEST=built it and visited chrome://system

Change-Id: I4c26143b470551fb2638912f65c0ef453231454d
Reviewed-on: https://gerrit.chromium.org/gerrit/49664
Commit-Queue: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
2 weeks agodebugd: Add API for getting richer perf data. 11/49211/8 stabilize-4068.0.B
Ahmad Sharif [Thu, 25 Apr 2013 19:25:41 +0000 (12:25 -0700)]
debugd: Add API for getting richer perf data.

Rich perf data is perf data that contains other events as well as callgraph or
branch data. What to profile exactly is selected randomly with a heavy lean
towards cycle profiling.

BUG=chromium:224056
TEST=FEATURES="test" emerge-$board debugd

Change-Id: Ia6d984dc2adce229d5c2355fc2ce432314755f73
Reviewed-on: https://gerrit.chromium.org/gerrit/49211
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
2 weeks agodebugd: Add RandomSelector class and tests. 09/49209/6
Ahmad Sharif [Thu, 25 Apr 2013 19:16:46 +0000 (12:16 -0700)]
debugd: Add RandomSelector class and tests.

RandomSector is a class that can be used to randomly pick strings according to
certain probabilities. It will be used to randomly pick command lines for perf.

BUG=chromium:224056
TEST=FEATURES="test" emerge-$board debugd works.

Change-Id: Ic79c277d9da5472f7edbe69dfccde7837f00c7b2
Reviewed-on: https://gerrit.chromium.org/gerrit/49209
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
4 weeks ago[debugd] run systrace helper as gid debugfs-access 40/48540/3 stabilize-4035.0.B
Jonathan Backer [Thu, 18 Apr 2013 19:00:58 +0000 (15:00 -0400)]
[debugd] run systrace helper as gid debugfs-access

A while ago we split out the debugfs accesses in debugd and ran them as a
separate gid (debugfs-access), but I missed one of these during the migration.

BUG=chromium:230800
TEST=adhoc; with this CL, visit chrome://tracing; see drm_vblank

Change-Id: I08ec92cf2d7ffa21f8c6565fa2b8fd2fa0d9eec5
Reviewed-on: https://gerrit.chromium.org/gerrit/48540
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Jonathan Backer <backer@chromium.org>
Tested-by: Jonathan Backer <backer@chromium.org>
4 weeks agolog_tool.cc: Add log of touch firmware version. 72/47772/3 stabilize-4008.0.B
Andrew de los Reyes [Wed, 10 Apr 2013 20:46:30 +0000 (13:46 -0700)]
log_tool.cc: Add log of touch firmware version.

We want this separate from the normal syslog for two reasons:

- Sometimes on a long run, the beginning of the syslog (which has
  version info) will be lost.

- By having a dedicated, small field, it will be easy to check in the
  web interface.

BUG=chromium:206478
TEST=Manually looked at chrome://system and filed feedback to see it
work. Also, tested the grep command on logs from devices with Atmel,
Synaptics, and Cypress hardware.

Change-Id: I3ee2c50b369d4e6986f24b09acdecac4c3b37e61
Reviewed-on: https://gerrit.chromium.org/gerrit/47772
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
4 weeks agodebugd: Remove code interacting with the old ModemManager. 88/48088/2
Ben Chan [Sat, 13 Apr 2013 22:49:34 +0000 (15:49 -0700)]
debugd: Remove code interacting with the old ModemManager.

BUG=chromium:231088
TEST=Test the following:
1. Build and run unit tests.
2. Verify logs gathered by debugd under 'chrome://system'.

Change-Id: I1bf8ec1597fc2d5c58e39008a8abc55a68113c1f
Reviewed-on: https://gerrit.chromium.org/gerrit/48088
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
5 weeks agoAdding memory and storage integrity tests to debugd 03/47203/3
Gediminas Ramanauskas [Thu, 14 Mar 2013 20:52:32 +0000 (13:52 -0700)]
Adding memory and storage integrity tests to debugd

BUG=chrome-os-partner:17258,18507
TEST=dbus commands Smartctl, Memtester Start/Stop, Badblocks Start/Stop work

Change-Id: Ie45ca50703a890d2c4a796483d5d02c50c983f8e
Reviewed-on: https://gerrit.chromium.org/gerrit/47203
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Gediminas Ramanauskas <gedis@chromium.org>
Tested-by: Gediminas Ramanauskas <gedis@chromium.org>
7 weeks ago[debugd] sandbox debugfs accesses 19/46019/3
Elly Fong-Jones [Wed, 20 Mar 2013 18:32:18 +0000 (14:32 -0400)]
[debugd] sandbox debugfs accesses

CQ-DEPEND=I8f362ab9e6c2c39e597577abcc73c0c8f699b6e3,I3c74ca9e33d4c14d74ad091e8250572d0c72557d
BUG=chromium-os:217234
TEST=adhoc
dbus-send --system --fixed --print-reply --dest=org.chromium.debugd
/org/chromium/debugd org.chromium.debugd.GetAllLogs
Look for permission failures accessing /sys/kernel/debug

Change-Id: I0dee240e76e8cd9db445ae8d9128c1ffa5cf2388
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46019

2 months agodebugd: Provide RunModemCommand API to run modem AT commands. 99/44399/9 factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.B firmware-spring-3833.B stabilize-3881.0.B
Darin Petkov [Fri, 1 Mar 2013 19:00:45 +0000 (20:00 +0100)]
debugd: Provide RunModemCommand API to run modem AT commands.

The API is required because communication with the serial interface
requires root privileges. The API will be used to implement the
corresponding crosh modem commands through DBus.

BUG=chrome-os-partner:17809
TEST=unit tests; tested on device along with relevant 'modem' script CL by
issuing relevant modem commands

Change-Id: I253f55a9bd1a2bdaca43ff6b40b68df07ccbd96c
Reviewed-on: https://gerrit.chromium.org/gerrit/44399
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

2 months ago[debugd] include tlsdate logs 85/44285/2
Elly Fong-Jones [Thu, 28 Feb 2013 18:45:26 +0000 (13:45 -0500)]
[debugd] include tlsdate logs

tlsdate logs are stored in /var/log/messages; include them in GetAllLogs() (and
therefore in feedback reports).

BUG=chromium-os:39247
TEST=adhoc
Run
`dbus-send --system --fixed --print-reply --dest=org.chromium.debugd
/org/chromium/debugd org.chromium.debugd.GetLog string:tlsdate`
You should see the contents of /var/log/tlsdate.log in response

Change-Id: Ifc216b5b4dae92fcc6d55891f77fc6a4385a540d
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44285
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
2 months ago[debugd] use libbase 180609 27/43627/4
Elly Fong-Jones [Wed, 20 Feb 2013 21:07:31 +0000 (16:07 -0500)]
[debugd] use libbase 180609

CQ-DEPEND=Ic3194fb6b44c6ff528af5d1ebacdd221d27e5e25
BUG=chromium-os:38931
TEST=build

Change-Id: I513422ecaa3078301b80e328422a29c45709bd9f
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
(cherry picked from commit bb6e70cbb17d732e289ae64e17de0e0ac41a7cde)
Reviewed-on: https://gerrit.chromium.org/gerrit/43627

3 months agodebugd: Anonymize SSIDs from shill and wpa_supplicant in feedback. 55/42855/2 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-bluetooth-smart toolchain-3701.42.B
Darin Petkov [Thu, 7 Feb 2013 11:07:29 +0000 (12:07 +0100)]
debugd: Anonymize SSIDs from shill and wpa_supplicant in feedback.

Add anonymization patterns for SSIDs logged by shill in a stylized
[SSID=...] format as well as wpa_supplicant's hexdump of SSIDs.

BUG=chromium-os:37755
TEST=unit tests; tested through feedback 607052489

Change-Id: I5260166d2bb3beb77b0a231ab5a69eaa505d33fe
Reviewed-on: https://gerrit.chromium.org/gerrit/42855
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

3 months agodebugd: Anonymize SSIDs in feedback logs coming out of wpa_supplicant. 18/42718/3
Darin Petkov [Wed, 6 Feb 2013 11:13:26 +0000 (12:13 +0100)]
debugd: Anonymize SSIDs in feedback logs coming out of wpa_supplicant.

BUG=chromium-os:37755
TEST=unit tests; tested through feedback 605331133

Change-Id: Id03186866e9629da748dae9f2e5cba88d9eaccdb
Reviewed-on: https://gerrit.chromium.org/gerrit/42718
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

3 months agowifi_status: call new network_diagnostics function 42/42642/2
Kees Cook [Tue, 5 Feb 2013 20:00:10 +0000 (12:00 -0800)]
wifi_status: call new network_diagnostics function

To allow existing users of network_diagnostics to continue to run
unchanged, it will call debugd for wifi status itself. This requires
that a new path for the "actual" wifi status call via debugd be created.
The new (hidden from usage) function will be "--wifi-internal".

BUG=chromium-os:23758
TEST=link build, crosh and chrome://system work as expected with crosh CL

Change-Id: I8e3ae0fe71aad45d8d5d769f4e6ea5e80243da0e
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42642
Reviewed-by: mukesh agrawal <quiche@chromium.org>
3 months agodebugd: ping_tool: Add option for broadcast 44/42544/3
Paul Stewart [Mon, 4 Feb 2013 18:02:53 +0000 (10:02 -0800)]
debugd: ping_tool: Add option for broadcast

BUG=chromium-os:38526
TEST="ping -b" from crosh

Change-Id: I6068ff5252dc3515790fa2cef5bb4d37355fde3c
Reviewed-on: https://gerrit.chromium.org/gerrit/42544
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
3 months agoAdded perf tool to debugd. 46/41546/6 stabilize-3658.0.0
Ahmad Sharif [Thu, 17 Jan 2013 19:29:37 +0000 (11:29 -0800)]
Added perf tool to debugd.

BUG=chromium-os:37970
TEST=./run_remote_tests.sh platform_DebugDaemonGetPerf

Change-Id: I205e6b1ec962f4d417681e30b2aaff513154fd8b
Reviewed-on: https://gerrit.chromium.org/gerrit/41546
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
3 months ago[debugd] handle partial sandboxing 53/41853/2
Elly Fong-Jones [Wed, 23 Jan 2013 20:50:21 +0000 (15:50 -0500)]
[debugd] handle partial sandboxing

This allows "null sandboxing" of helpers (i.e., running them as root/root, but
with the sandboxing code still enabled) for testing, development, and later use
with seccomp mode 2.

BUG=chromium-os:38123
TEST=adhoc
hack helpers/example.cc to SandboxAs("root", "root"), then run:
dbus-send --system --fixed --print-reply --dest=org.chromium.debugd
/org/chromium/debugd org.chromium.debugd.GetExample
You should see "Hello, World!" instead of "<process exited with nonzero
status>".

Change-Id: I6081eca836a2c83aa081115395b4851d8f4664ee
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41853
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
3 months agodebugd: Generalize custom pattern anonymization. 19/41719/3
Darin Petkov [Mon, 21 Jan 2013 14:18:21 +0000 (15:18 +0100)]
debugd: Generalize custom pattern anonymization.

Now only the identifier is anonymized and the context can be fully
preserved.

BUG=chromium-os:37755,chromium-os:37354
TEST=unit tests; tested on device through feedback report 581968765

Change-Id: I279b2b72cc29743f9e6e9f18eb6cde24446d3d44
Reviewed-on: https://gerrit.chromium.org/gerrit/41719
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
3 months ago[debugd] don't leak command args to minijail 58/41758/2
Elly Fong-Jones [Tue, 22 Jan 2013 16:35:22 +0000 (11:35 -0500)]
[debugd] don't leak command args to minijail

BUG=chromium-os:35122
TEST=adhoc
`dbus-send --system --fixed --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.GetAllLogs`
should not return all logs empty.

Change-Id: Iee2aaf8fd59ee4c927afe5d9456bda318e09ea11
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41758
Reviewed-by: Will Drewry <wad@chromium.org>
3 months ago[debugd] add redpig as an owner 32/41632/2
Elly Fong-Jones [Fri, 18 Jan 2013 12:21:34 +0000 (07:21 -0500)]
[debugd] add redpig as an owner

Change-Id: Ibf8335783bfc29faf44b51bf58745c9c59070975
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41632

3 months ago[debugd] sandbox helpers explicitly 43/37843/7
Elly Fong-Jones [Mon, 12 Nov 2012 21:09:49 +0000 (16:09 -0500)]
[debugd] sandbox helpers explicitly

Sandbox helpers as debugd/debugd (like they are now) by default, so the only
change from this CL is that the debug daemon itself runs as root.

CQ-DEPEND=Icc5d7709eac3b11a8098369fa6666235da639f38
BUG=chromium-os:35122
TEST=platform_DebugDaemon

Change-Id: I0cc4b7ed3fd63068dcba4f1c72f2537ebbc1a151
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37843

3 months agodebugd: Provide framework for custom pattern anonymization in feedback. 23/41523/4
Darin Petkov [Thu, 17 Jan 2013 11:06:42 +0000 (12:06 +0100)]
debugd: Provide framework for custom pattern anonymization in feedback.

Every matched pattern is replaced by a "tag-id" string. This facility
will allow us to more easily anonymize logs generated by third party
tools without the need to maintain custom patches.

Use custom patterns no anonymize cell ID and location area code coming
from ModemManager logs.

BUG=chromium-os:37354
TEST=unit tests; tested through feedback report 572501093.

Change-Id: I0db1ff13f0993dd7ae509d2da569a91f6d6f7b41
Reviewed-on: https://gerrit.chromium.org/gerrit/41523
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

3 months agodebugd: Remove reference to powerm. 63/41563/4
Daniel Erat [Thu, 17 Jan 2013 21:06:13 +0000 (13:06 -0800)]
debugd: Remove reference to powerm.

BUG=chromium-os:36804
TEST=manual: built it and checked chrome://system
TBR=ellyjones@chromium.org

Change-Id: I06e85dfd05d5fa99cf7a662246c3392a3173fbbd
Reviewed-on: https://gerrit.chromium.org/gerrit/41563
Commit-Queue: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 months agodebugd: git ignore emacs backup files and the build directory (for cros_workon_make). 21/41521/2
Darin Petkov [Thu, 17 Jan 2013 09:25:04 +0000 (10:25 +0100)]
debugd: git ignore emacs backup files and the build directory (for cros_workon_make).

BUG=none
TEST=git status

Change-Id: I84ad63635bbc81d4dbffe6bcee351069d56ad85c
Reviewed-on: https://gerrit.chromium.org/gerrit/41521
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

4 months agodebugd: Anonymize MAC addresses in feedback logs. 16/41016/3
Darin Petkov [Thu, 10 Jan 2013 15:38:54 +0000 (16:38 +0100)]
debugd: Anonymize MAC addresses in feedback logs.

The logs are scanned for a regular expression matching
case-insensitive MAC-48 addresses with octets separated by :. Any
matches are replaced by generating a unique NIC part.

BUG=chromium-os:37754
TEST=unit tests; tested on device by submitting feedback (563151825)
and then inspecting it.
CQ-DEPEND=Iaa3f3d240baf2eeaaffa11dd8e45ffa4065d11c1

Change-Id: I51ac107d22d87eeba888b9b5db5d78edff24109e
Reviewed-on: https://gerrit.chromium.org/gerrit/41016
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

4 months ago[debugd] don't crash netif if Device prop is missing 85/40385/2 factory-3536.B
Elly Fong-Jones [Thu, 3 Jan 2013 19:17:05 +0000 (14:17 -0500)]
[debugd] don't crash netif if Device prop is missing

For VPN services, there's no device property, which means that when we try to
access props["Device"], we end up with an empty Variant, with ensuing assertion
failure.

BUG=chromium-os:33707
TEST=adhoc
With at least one VPN service available, run /usr/libexec/debugd/helpers/netif.

Change-Id: I95e9494e0dc591469630e3760cf4fad0d2c83cf6
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40385
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
4 months agoInclude i915_error_state in common_logs 46/40146/2
Stéphane Marchesin [Sat, 22 Dec 2012 00:29:53 +0000 (16:29 -0800)]
Include i915_error_state in common_logs

i915_error_state allows us to debug GPU lockups, so include it.

BUG=none
TEST=Boot Chrome OS, see i915_error_state in chrome://system

Change-Id: I07319dff3d2e1a85dbc5285fbd7e08f92ffe5025
Reviewed-on: https://gerrit.chromium.org/gerrit/40146
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>

5 months agoInclude stashed connectivity event logs in chrome://system and feedback. 68/39468/2 toolchain-3428.65.B
Darin Petkov [Mon, 10 Dec 2012 13:18:32 +0000 (14:18 +0100)]
Include stashed connectivity event logs in chrome://system and feedback.

BUG=chromium-os:37100
TEST=inspected chrome://system on the device for net-diags.net.log
CQ-DEPEND=I679f559e5eff2e38ed6a38d47b284da8b06b1f51

Change-Id: I5e86c8202c711adee4274c9c9c5d3d684c3afb9a
Reviewed-on: https://gerrit.chromium.org/gerrit/39468
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>

5 months agodebugd: Update location for power manager output. 49/39349/2 stabilize2
Daniel Erat [Thu, 6 Dec 2012 22:14:17 +0000 (14:14 -0800)]
debugd: Update location for power manager output.

This gets powerd and powerm's stdout and stderr from
/var/log/power[dm].out instead of
/var/log/power_manager/power[dm].out.

BUG=chromium-os:36888
TEST=chrome://system shows power[dm].out's contents
CQ-DEPEND=I5788f32cc7f4e2f021315e6d7b86fccaaacc7c63

Change-Id: I0891c8e9f3d3593b7f084bae40ff5e40c39516e9
Reviewed-on: https://gerrit.chromium.org/gerrit/39349
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Ready: Daniel Erat <derat@chromium.org>

5 months agodebugd: Allow setting debug mode for WiMAX. 17/39017/2
Ben Chan [Fri, 30 Nov 2012 19:47:50 +0000 (11:47 -0800)]
debugd: Allow setting debug mode for WiMAX.

BUG=chromium-os:36839
TEST=Tested the following:
1. Run the following command in a root shell:

   dbus-send --system --print-reply --dest=org.chromium.debugd \
       /org/chromium/debugd org.chromium.debugd.SetDebugMode \
       string:wimax

2. Run 'ff_debug' in crosh to confirm that the following tags are
   enabled: device, manager, service, wimax

Change-Id: I71e55197f92b08dc61ac5c2579a9ea7e2577edde
Reviewed-on: https://gerrit.chromium.org/gerrit/39017
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

5 months ago[debugd] sanity-check dbus response 28/38828/3
Elly Fong-Jones [Wed, 28 Nov 2012 19:06:03 +0000 (14:06 -0500)]
[debugd] sanity-check dbus response

Right now, crosbug.com/35978 is manifesting as an exception thrown inside
dbus-c++, which doesn't carry any useful debug information. From the crash logs,
I know we failed trying to fetch a path from an iterator somewhere in
AddSignalStrengths, so add explicit checks on all variables that we expect to be
paths. Hopefully we'll get a better error this way, which will make it easier to
figure out who's returning bogus data and how.

BUG=chromium-os:35978
TEST=none

Change-Id: I99f9bd1b8de7dd93d17a8727b4a8392dc4438aab
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
(cherry picked from commit 89c5c41ec0d1b163e3e80591b355aff226086863)
Reviewed-on: https://gerrit.chromium.org/gerrit/38828
Reviewed-by: Kees Cook <keescook@chromium.org>
5 months agodebugd: Enable 'cellular' debug tag when setting debug mode to cellular. 08/39008/2
Ben Chan [Fri, 30 Nov 2012 19:34:41 +0000 (11:34 -0800)]
debugd: Enable 'cellular' debug tag when setting debug mode to cellular.

BUG=chromium-os:36838
TEST=Tested the following:
1. Navigate to chrome://net-internals/#chromeos in Chrome.
2. Click 'Cellular' under 'Select interface for debugging'.
3. Run 'ff_debug' in crosh to confirm that the 'cellular' tag is
   enabled.

Change-Id: I4a5a152e7708406d617f72e2be41535e71889303
Reviewed-on: https://gerrit.chromium.org/gerrit/39008
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
5 months agodebugd: Including new /var/log/net.log in user feedback. 50/38050/4
Wade Guthrie [Wed, 14 Nov 2012 21:14:31 +0000 (13:14 -0800)]
debugd: Including new /var/log/net.log in user feedback.

BUG=chromium-os:36269
TEST=Manual.  I used the CL listed, below, to generate code in
/var/log/net.log and generated feedback chrome's 'Report an issue...'
feature.  I then checked the feedback on
https://feedback.corp.google.com/#/Product/208/Reports and verified that
the logfile was, indeed, there.

CQ-DEPEND=I28bbb3c9514b02ee898b03b261c42437fed73f3e

Change-Id: Ib311580f479c3d7a82b2df1671454d2d272afa82
Reviewed-on: https://gerrit.chromium.org/gerrit/38050
Commit-Ready: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
5 months agoAdd Mali memory and exynos_gem_objects to chrome://system 54/38254/2
Sonny Rao [Sat, 17 Nov 2012 00:16:41 +0000 (16:16 -0800)]
Add Mali memory and exynos_gem_objects to chrome://system

This will record the contents of
/sys/debug/kernel/dri/0/exynos_gem_objects and
/sys/devices/platform/mali.0/memory into chrome://system
and feedback logs to help us understand graphics memory usage and
debug memory leaks.

BUG=chromium-os:36456
TEST=navigate to chrome://system on an mali system (daisy) and see that
mali_memory and exynos_gem_objects entries exists and have something
there.

Change-Id: I3a33266746954b028243de0773cbfc248ebb3f93
Reviewed-on: https://gerrit.chromium.org/gerrit/38254
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>

5 months agoInclude mount-encrypted log in feedback report 31/38331/2
Kees Cook [Mon, 19 Nov 2012 22:16:01 +0000 (14:16 -0800)]
Include mount-encrypted log in feedback report

We need to see what state a system's encrypted partition came up in when
doing a feedback report.

BUG=chrome-os-partner:15960
TEST=parrot build, manual test:
 /usr/bin/dbus-send --system --print-reply --dest=org.chromium.debugd \
 /org/chromium/debugd org.chromium.debugd.GetFeedbackLogs | \
 grep mount-encrypted

Change-Id: Iee39257951bcb5888aaef47c9dbbc0943c2d6481
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/38331
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
6 months agoAdd i915_gem_gtt and i915_gem_objects to chrome://system
Sonny Rao [Thu, 25 Oct 2012 01:11:04 +0000 (18:11 -0700)]
Add i915_gem_gtt and i915_gem_objects to chrome://system

This will record the contents of /sys/debug/kernel/dri/0/i915_gem_gtt
and /sys/debug/kernel/dri/0/i915_gem_objects into chrome://system
and feedback logs to help us understand graphics memory usage and
debug memory leaks.

BUG=chromium-os:29531
TEST=navigate to chrome://system on an x86 system and see that
i915_gem_gtt and i915_gem_objects entries exists and have something
there.

Change-Id: I67a81791b04741993b84b3475502c3ce724e226a
Reviewed-on: https://gerrit.chromium.org/gerrit/36529
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
6 months agoInclude firmware related logs in chrome://system
Stefan Reinauer [Thu, 18 Oct 2012 18:08:09 +0000 (11:08 -0700)]
Include firmware related logs in chrome://system

bios_log: coreboot firmware log
eventlog: persistent firmware event log
bios_times: firmware boot times

BUG=none
TEST=Boot ChromeOS, see above new log files in chrome://system
BRANCH=none

Change-Id: I942893f432ea855f232c4cd575298b94ede8716b
Reviewed-on: https://gerrit.chromium.org/gerrit/35952
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Ready: Stefan Reinauer <reinauer@chromium.org>

7 months agoRevert "[debugd] wait for pstore mount"
Elly Jones [Tue, 16 Oct 2012 20:08:54 +0000 (13:08 -0700)]
Revert "[debugd] wait for pstore mount"

This reverts commit 9dea58d9be857bbfce694b0038c97d1879f0076a

CQ-DEPEND=I20124e599b260c1809ab4d76c2b8da1cdef582d3

See https://gerrit.chromium.org/gerrit/#/c/35716/

Change-Id: Ibdf267ad9b07e818064a553200d80c20ec453fad
Reviewed-on: https://gerrit.chromium.org/gerrit/35738
Commit-Ready: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Elly Jones <ellyjones@chromium.org>
7 months agodebugd: Add a dbus method to query log files Chrome itself should collect
Gaurav Shah [Fri, 12 Oct 2012 00:22:43 +0000 (17:22 -0700)]
debugd: Add a dbus method to query log files Chrome itself should collect

BUG=chromium-os:34817
TEST=none

Change-Id: I32bcf19511a16df272134adb20d8fd69afb83a9d
Reviewed-on: https://gerrit.chromium.org/gerrit/35361
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
7 months ago[debugd] wait for pstore mount
Elly Fong-Jones [Mon, 15 Oct 2012 22:57:04 +0000 (18:57 -0400)]
[debugd] wait for pstore mount

We need the pstore mount point from outside our vfs namespace before we enter
it, so wait at startup for the pstore mount point to be mounted.

BUG=chromium-os:35340
TEST=adhoc
boot, grep debugd /var/log/messages

Change-Id: I47745792766186c428bfd42216ed90c4ea759c9e
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35626
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
7 months agodebugd: Encode non-UTF8 log content in base64.
Ben Chan [Mon, 15 Oct 2012 02:37:00 +0000 (19:37 -0700)]
debugd: Encode non-UTF8 log content in base64.

This CL encodes any non-UTF8 log content in base64 before returning the
content over DBus as the DBus library gives an assertion on non-UTF8
strings.

BUG=chromium-os:35310
TEST=Manually inject non-UTF8 characters to /var/log/messages, e.g.

    echo -e '\xef\xbf\xbc' >> /var/log/messages

and then verify that the 'syslog' section in chrome://system shows a
base64-encoded string of /var/log/messages.

Change-Id: Ib907c19aee9270b7984f3978b3fa58fd86b52738
Reviewed-on: https://gerrit.chromium.org/gerrit/35531
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
7 months ago[debugd] fetch /dev/pstore/console-ramoops
Elly Fong-Jones [Mon, 8 Oct 2012 18:22:01 +0000 (14:22 -0400)]
[debugd] fetch /dev/pstore/console-ramoops

BUG=chromium-os:34991
TEST=adhoc
dbus-send --system --print-reply --dest=org.chromium.debugd \
    /org/chromium/debugd org.chromium.debugd.GetLog string:console-ramoops

Change-Id: I9509eed35e0f02369d6af16082914ef09f2598a7
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34903
Reviewed-by: Will Drewry <wad@chromium.org>
7 months agodebugd: Do not try to collect user logs factory-2985.B factory-2993.B factory-3004.B
Gaurav Shah [Mon, 1 Oct 2012 18:51:08 +0000 (11:51 -0700)]
debugd: Do not try to collect user logs

debugd runs in a VFS namespace and doesn't have access to later
cryptohome mounts. These includes anything under /home/chroneos/user/
These logs should be collected by Chrome itself.

This CL removes collection of the following:
/home/chronos/usr/log/chrome
/home/chronos/usr/login-times
/home/chronos/usr/logout-times

BUG=chromium-os:34817
TEST=none

Change-Id: Ife015b4893741f1496a15a22ca6d837cf4ffd05f
Reviewed-on: https://gerrit.chromium.org/gerrit/34366
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
7 months ago[debugd] remove alsa logging.
Dylan Reid [Thu, 27 Sep 2012 23:56:23 +0000 (16:56 -0700)]
[debugd] remove alsa logging.

debugd doesn't have access to alsa controls, and it probably shouldn't.
alsa control output can be added to cras debug output if needed.

BUG=chrome-os-partner:14510
TEST=go to chrome://system check alsa controls aren't there.

Change-Id: Ic296a23d3ad3f9a88544dedcd8e48b869c29902e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34236
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
8 months agodebugd: Handle DBus error thrown by Modem::GetInfo(). factory-2914.B
Arman Uguray [Tue, 11 Sep 2012 23:46:32 +0000 (16:46 -0700)]
debugd: Handle DBus error thrown by Modem::GetInfo().

Sometimes, gobi::Sdk::GetManufacturer (gobi_sdk_wrapper.cc: 984) fails
to succeed, which causes GetInfo to throw a DBus error. This only seems
to happen on certain hardware. In case of failure, debugd will now set
an empty dictionary as the value of "status" or "info".

BUG=chromium-os:33645
TEST=Did manual testing by confirming the results through
chrome://system in browser.

Change-Id: I5461f103caef3491d2f71bb01b3c6bbfa2a25899
Reviewed-on: https://gerrit.chromium.org/gerrit/33024
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
Commit-Ready: Arman Uguray <armansito@chromium.org>

8 months agodebugd: add exynos busfreq system trace events
Sam Leffler [Fri, 7 Sep 2012 17:46:33 +0000 (10:46 -0700)]
debugd: add exynos busfreq system trace events

Add power events to trace exynos busfreq operation.

BUG=chrome-os-partner:13801
TEST=collect a trace and verify event data is present
CQ-DEPEND=I0e82ad4afb72e6b4664dbd95d206186864a9266e

Change-Id: I2eea56b3a3722ce744adb31759e3743433231367
Reviewed-on: https://gerrit.chromium.org/gerrit/32586
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
9 months ago[debugd] Fixed SetLogging DBus call. factory-2846.B factory-2848.B firmware-butterfly-2788.B firmware-stout-2817.B
Yuri Gorshenin [Thu, 16 Aug 2012 19:03:46 +0000 (23:03 +0400)]
[debugd] Fixed SetLogging DBus call.

Fixed call to ModemManager SetLogging method via DBus. Added runtime
search of alive ModemManagers.

BUG=chromium-os:31968
TEST=manual testing on the Alex device

Change-Id: I9a9f70701b156ac6663de1d5aad23469dbf540e1
Reviewed-on: https://gerrit.chromium.org/gerrit/25615
Reviewed-by: Yuri Gorshenin <ygorshenin@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Ready: Yuri Gorshenin <ygorshenin@chromium.org>
Tested-by: Yuri Gorshenin <ygorshenin@chromium.org>
9 months ago[debugd] include signal strength in GetInterfaces()
Elly Jones [Wed, 15 Aug 2012 21:11:44 +0000 (17:11 -0400)]
[debugd] include signal strength in GetInterfaces()

BUG=chromium-os:33047
TEST=adhoc
Run /usr/libexec/debugd/helpers/netif directly, inspect output

Change-Id: I43960aadb234f68ec9eccb9c4797b63bdff6a7cf
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30454
Reviewed-by: Kees Cook <keescook@chromium.org>
9 months ago[debugd] add TestICMP
Elly Jones [Tue, 14 Aug 2012 21:37:05 +0000 (17:37 -0400)]
[debugd] add TestICMP

This method tests ICMP connectivity to a supplied IP address and returns some
statistics about it - min/avg/max ping times and number of successful pings.

BUG=chromium-os:33047
TEST=adhoc

Change-Id: I46da5ae7669d49c5ad8129faf5dc1021db773f3f
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30310
Reviewed-by: Kees Cook <keescook@chromium.org>
9 months ago[debugd] dump up to 256K of command output
Elly Jones [Mon, 13 Aug 2012 17:22:46 +0000 (13:22 -0400)]
[debugd] dump up to 256K of command output

Any shorter truncates dmesg output, which we need for verified boot diagnosis.

BUG=chromium-os:33466
TEST=adhoc

Change-Id: I80cc8fdd8a676a91b3d06028623be17858fb1c68
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29998
Reviewed-by: Kees Cook <keescook@chromium.org>
9 months ago[debugd] Add GetFeedbackLogs
Elly Jones [Fri, 10 Aug 2012 19:07:05 +0000 (15:07 -0400)]
[debugd] Add GetFeedbackLogs

Right now, _all_ feedback logs are masked, which is good for userfeedback, but
not so useful when we display diagnostic info. As such, add a new method
GetFeedbackLogs() which does what the existing method does (return masked
logs), and change GetAllLogs() to return *unmasked* logs. Concurrently, change
the userfeedback caller to use GetFeedbackLogs(), while leaving the other uses
calling GetAllLogs().

BUG=chromium-os:33458
TEST=adhoc
CQ-DEPEND=I92f84554ceb932aed75eb9c2dd25ea6a56fa1cee

Change-Id: Ib1540145d19c9f170893e7e7f70e8a7ebef2f29b
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29909

9 months agodebugd: Use 'connectivity show-feedback' instead of 'connectivity show'. factory-2717.B factory-2723.14.B
Ben Chan [Thu, 2 Aug 2012 22:34:22 +0000 (15:34 -0700)]
debugd: Use 'connectivity show-feedback' instead of 'connectivity show'.

'connectivity show-feedback' is similar to 'connectivity show' but
tailors output for feedback reports.

BUG=chromium-os:33198
TEST=Check network-devices and network-services log via 'chrome://system'.

Change-Id: I120d7e3ddeef2121efa87d6a2df6c6f4e1492106
Reviewed-on: https://gerrit.chromium.org/gerrit/29107
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
9 months agodebugd: remove input trace events from "all"
Sam Leffler [Wed, 1 Aug 2012 20:41:30 +0000 (13:41 -0700)]
debugd: remove input trace events from "all"

Remove the threaded irq events from the "all" category for now because
it generates a lot of events that aren't particularly useful.  crosh users
can still enable it explicitly so this only affects chrome:tracing.

BUG=none
TEST=run chrome:tracing and verify there are no import errors

Change-Id: I6ac08f98beb210042137f87271bbfac13b72c917
Reviewed-on: https://gerrit.chromium.org/gerrit/28968
Tested-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

9 months agodebugd: enable mali system trace events
Sam Leffler [Thu, 26 Jul 2012 21:09:11 +0000 (14:09 -0700)]
debugd: enable mali system trace events

Add mali dvfs events to the power class for analyzing performance.

BUG=chrome-os-partner:11795
TEST=collect data and check about:tracing

Change-Id: I8456c84c5b0dbd818d40fee475539c88f4d20a13
Reviewed-on: https://gerrit.chromium.org/gerrit/28523
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
9 months ago[debugd] add kernel-crash log entry
Elly Jones [Tue, 31 Jul 2012 22:07:46 +0000 (18:07 -0400)]
[debugd] add kernel-crash log entry

This aggregates all the kernel crash logs in /var/spool/crash for easier access
in feedback logs.

BUG=chromium:127057
TEST=Adhoc

Change-Id: Ic895d9f1e317a6cdbfea443c405a2b456e4f4897
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28861
Reviewed-by: Rahul Chaturvedi <rkc@chromium.org>
9 months ago[debugd] Use 'modem status-feedback' instead of 'mm-status'. firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B
Ben Chan [Fri, 27 Jul 2012 01:17:03 +0000 (18:17 -0700)]
[debugd] Use 'modem status-feedback' instead of 'mm-status'.

mm-status is being deprecated and replaced by 'modem status-feedback',
which handles both cromo and ModemManager1.

BUG=chromium-os:29159
TEST=Check mm-status log via 'chrome://system'.

Change-Id: I65e83c91c24434887ff58ca0ac911aa35858025c
Reviewed-on: https://gerrit.chromium.org/gerrit/28552
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

9 months ago[debugd] fix typo in netif
Elly Jones [Wed, 25 Jul 2012 17:30:39 +0000 (13:30 -0400)]
[debugd] fix typo in netif

BUG=None
TEST=build

Change-Id: I120da6619273513aea62bb19939807cbff3f5d51
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28407

9 months agoAdd input category to system trace events
Sonny Rao [Tue, 24 Jul 2012 23:32:37 +0000 (16:32 -0700)]
Add input category to system trace events

The trackpad driver and many other input drivers use threaded irq
handlers to do interrupt processing.  This adds threaded irq entry and
exit trace events as input related events.

BUG=chromium-os:31954
TEST=`systrace.sh start input` <cause input events> `systrace.sh stop`
threaded irq entry/exit events are visible

Change-Id: I29be61e16a017cc7e9e204bdb6c3b48f9a312bed
Reviewed-on: https://gerrit.chromium.org/gerrit/28338
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
9 months ago[debugd] add GetInterfaces 45/28045/5
Elly Jones [Fri, 20 Jul 2012 19:39:23 +0000 (15:39 -0400)]
[debugd] add GetInterfaces

This function returns a machine-readable description of the machine's network
interfaces.

BUG=chromium-os:30740
TEST=Adhoc
Run the helper by hand, and make the dbus request using dbus-send. Autotest
later.

Change-Id: I67f91f5665c92a64d3bc0524d5f0252304face09
Signed-off-by: Elly Jones <ellyjones@chromium.org>
9 months agoMerge "[debugd] add hacking guide"
Gerrit [Fri, 20 Jul 2012 15:59:29 +0000 (08:59 -0700)]
Merge "[debugd] add hacking guide"

9 months ago[debugd] add hacking guide 50/27650/2
Elly Jones [Tue, 17 Jul 2012 16:39:51 +0000 (12:39 -0400)]
[debugd] add hacking guide

Change-Id: Id02be4eb67893b669efe892cfc999a67a8db4e9a
Signed-off-by: Elly Jones <ellyjones@chromium.org>
10 months ago[debugd] remove cras logging 09/27309/1
Elly Jones [Thu, 12 Jul 2012 19:04:27 +0000 (15:04 -0400)]
[debugd] remove cras logging

We don't currently have access to cras, and we arguably shouldn't, as such
access lets us do anything we want to system audio. Instead, let chrome fetch
this log, since it has to have access to do so anyway.

BUG=chromium-os:30740
TEST=build

Change-Id: Ic99ee6d7866304770d713274f30366bd7cda532a
Signed-off-by: Elly Jones <ellyjones@chromium.org>
10 months agodebugd: enable exynos flip event 86/26786/2
Jeff Disher [Wed, 4 Jul 2012 14:35:13 +0000 (10:35 -0400)]
debugd: enable exynos flip event

Add the exynos graphics events for pageflip request and complete.

TEST=Was able to observe believable trace data from systrace which
included these events.  Verified that x86 systrace still works.
BUG=chrome-os-partner:11092

Change-Id: I3f79741d617dc4a6cb6ad743f6dff922172c83ce
Signed-off-by: Jeff Disher <disher@google.com>
10 months ago[debugd] add setuid cras helper 88/26588/3 factory-2569.B
Elly Jones [Mon, 2 Jul 2012 19:01:16 +0000 (15:01 -0400)]
[debugd] add setuid cras helper

BUG=chromium-os:30740
TEST=Adhoc
GetLog cras works now

Change-Id: I3995bf4664791a3ce02527907750184d46fc040a
Signed-off-by: Elly Jones <ellyjones@chromium.org>
10 months ago[debugd] fix some logs 71/26571/1
Elly Jones [Mon, 2 Jul 2012 15:09:10 +0000 (11:09 -0400)]
[debugd] fix some logs

The update_engine log spec had a typo in it. The touchpad_activity log was
attempting to log to /home/chronos/user, which is not visible inside our VFS
namespace. A change to inputcontrol
(<https://gerrit.chromium.org/gerrit/#change,26454>) adds an option to log into
debugd's tmpfs; change this code to do that.

BUG=chromium-os:30740
TEST=Adhoc
dbus-send --system --print-reply --dest=org.chromium.debugd /org/chromium/debugd
    org.chromium.debugd.GetLog string:{touchpad_activity,update_engine,...}

Change-Id: Ic9293367f247d52c83b97ca3d905c2666e94dbe1
Signed-off-by: Elly Jones <ellyjones@chromium.org>
10 months agoMerge "[debugd] remove unused var in Makefile"
Gerrit [Thu, 28 Jun 2012 20:06:26 +0000 (13:06 -0700)]
Merge "[debugd] remove unused var in Makefile"

10 months ago[debugd] remove unused var in Makefile 56/25956/1
Elly Jones [Fri, 22 Jun 2012 19:49:59 +0000 (15:49 -0400)]
[debugd] remove unused var in Makefile

TEST=build
BUG=None

Change-Id: I9781c850478653d20fd569aadfe4ad73bf160502
Signed-off-by: Elly Jones <ellyjones@chromium.org>
10 months agodebugd: enable cpufreq_interactive boost/unboost events 03/25803/1 factory-2475.B
Sam Leffler [Wed, 20 Jun 2012 22:28:45 +0000 (15:28 -0700)]
debugd: enable cpufreq_interactive boost/unboost events

Add boost/unboost events for the interactive governor to the list of
power events.

BUG=chromium-os:17379 chromium:118032
TEST=record a trace and check syslog to verify the events are enabled

Change-Id: Ieb8b2cee208a735265d5e5be48928938edd39011

10 months agodebugd: handle trace event setup failures 02/25802/1
Sam Leffler [Wed, 20 Jun 2012 22:25:21 +0000 (15:25 -0700)]
debugd: handle trace event setup failures

Do not fail when a trace event cannot be enabled; just continue and
log the failure.  This allows us to define event lists without concern
for arch dependencies.

BUG=none
TEST=manual:add a bogus event and verify all good events are enabled and the bogus one logged

Change-Id: Id581a3a74a5e7a7a444775fea4f2088a2fa046f8

10 months ago[debugd] properly limit getmsgs 34/25634/1 release-R21-2465.B
Elly Jones [Tue, 19 Jun 2012 17:48:38 +0000 (13:48 -0400)]
[debugd] properly limit getmsgs

This typo caused us to call getmsgs with a max age of '2
hours/var/log/messages', which date handily parses as no date, so we'd try to
feed all of /var/log/messages through tac | awk | tac | tail, with a great deal
of ensuing CPU usage. Oops!

BUG=chromium-os:30740
TEST=Adhoc
time dbus-send --system --print-reply --dest=org.chromium.debugd \
    /org/chromium/debugd org.chromium.debugd.GetAllLogs
Should show ~8sec instead of ~30sec.

Change-Id: Ic4662484bcd70d41ea7d7490e41055d6fd5faea1
Signed-off-by: Elly Jones <ellyjones@chromium.org>
11 months ago[debugd] add logfile accessors 07/25007/2 factory-2460.B
Elly Jones [Mon, 11 Jun 2012 17:04:28 +0000 (13:04 -0400)]
[debugd] add logfile accessors

Add support for fetching system logfiles over DBus. The list of logfiles is
taken from /src/platform/userfeedback/etc/sys_log_utils.sysinfo.lst at revision
72219e8d347d181edbb9e6f9dfb9878903a6e2d8.

TEST=Adhoc
BUG=chromium-os:30740

Change-Id: I956847cf8fdebfff0cbc153dc53020a07daf5695
Signed-off-by: Elly Jones <ellyjones@chromium.org>
11 months ago[debugd] CHECK the result of DBusPropertyMapToValue 75/24775/1
Elly Jones [Thu, 7 Jun 2012 21:17:35 +0000 (17:17 -0400)]
[debugd] CHECK the result of DBusPropertyMapToValue

If this function fails we've tripped over a type that function can't handle,
which is a programming bug on our part, and the best thing to do is just exit
the helper (debugd will collect the stack trace as 'output').

BUG=None
TEST=Adhoc

Change-Id: I26c04b7f046dfbd2802ecb2f3f95a0a844b4810e
Signed-off-by: Elly Jones <ellyjones@chromium.org>
12 months agodebugd: add drm vblank events to systrace 95/22395/1 factory-2305.B factory-2338.B factory-2368.B factory-2394.B firmware-link-2348.B
Sam Leffler [Thu, 10 May 2012 16:18:59 +0000 (09:18 -0700)]
debugd: add drm vblank events to systrace

Add drm::drm_vblank_event to gfx events.

BUG=chromium-os:17379 chromium:118032
TEST=collect trace and check contents

Change-Id: I36e83c145c7a53e071d88a8af20f48941a93929e

12 months agodebugd: write null clock sync record 07/21407/1 factory-2268.16.B release-R20-2268.B
Sam Leffler [Thu, 26 Apr 2012 21:32:14 +0000 (14:32 -0700)]
debugd: write null clock sync record

Write a clock sync record on systrace stop that causes chrome to not
time-shift data.  This used in conjunction with other changes that export
the kernel's trace event clock to user space to align user and kernel
event data.

With this change we no longer need the clock_monotonic helper so delete it.

BUG=chromium-os:27809
TEST=manual:collect trace data; check sync record contents

Change-Id: I2d7edcc9e6b80bee96033ec00b4dddef016f8307

13 months agodebugd: update systrace events 88/19788/2
Sam Leffler [Fri, 6 Apr 2012 21:42:02 +0000 (14:42 -0700)]
debugd: update systrace events

Add sched:sched_wakeup so we can see delays from wakeup to run.
Drop deprecated power events and replace with power:cpu_idle and
power:cpu_frequency.

While here do some minor cleanups (old ref to $trace_events, spacing).

BUG=chromium-os:27809
TEST=collect trace data and check contents for addition/different events

Change-Id: I8d5d22cb5fde382382ac2f5c9f24c2d849e77b72

13 months agodebugd: correct systrace trace marker timestamp 50/18750/2 release-R19-2046.B
Sam Leffler [Wed, 21 Mar 2012 22:25:12 +0000 (15:25 -0700)]
debugd: correct systrace trace marker timestamp

The systrace trace marker generated by the helper must use the monotonic
clock (e.g. clock_gettime(CLOCK_MONOTONIC)) to match chrome.  Previously
we used /proc/uptime but this value is boottime-based and not suitable.
Add a clock_monotonic helper to print the right value and use it instead.

BUG=chromium-os:27809
TEST=suspend for a while; generate trace data and verify chrome and system event timestamps align properly

Change-Id: I86b0de73e77c982dbb64c41b1f357d61ea99d32f

13 months agoMerge "debugd: add systrace support"
Gerrit [Wed, 21 Mar 2012 19:02:33 +0000 (12:02 -0700)]
Merge "debugd: add systrace support"

13 months ago[debugd] convert docs to markdown 71/18671/1
Elly Jones [Wed, 21 Mar 2012 17:37:04 +0000 (13:37 -0400)]
[debugd] convert docs to markdown

Update the docs, convert them to markdown, and add a makefile in doc that builds
HTML files from them.

BUG=None
TEST=adhoc
Ran it.

Change-Id: I5807dc1da7c1dcabe4a339ba21fa2815fd580190
Signed-off-by: Elly Jones <ellyjones@chromium.org>
13 months agodebugd: add systrace support 49/17149/4
Sam Leffler [Thu, 1 Mar 2012 17:50:30 +0000 (09:50 -0800)]
debugd: add systrace support

Add simple support for doing system tracing.  SystraceStart registers a
set of kernel events and enables collection using the global trace clock.
SystraceStop ends collection, clears the registered events, and writes
the collected data to stdout (which the caller should attach to a file or
similar). SystraceStatus reports the current state of event collection
in an unstructued (text) format (suitable for sending directly to the
terminal).

Note the helper assumes debugd has write-access to files in the tracing
debugfs directory.

BUG=chromium-os:27809
TEST=use crosh systrace support to invoke start, status, and stop methods

Change-Id: I42e1f3c6ba3b543e608a358bb4682b1a7f8ba02f

14 months ago[debugd] convert to SLOT-ed libbase 46/16046/3 factory-1987.B
Mike Frysinger [Thu, 16 Feb 2012 19:15:21 +0000 (14:15 -0500)]
[debugd] convert to SLOT-ed libbase

Make sure we execute pkg-config twice in the ebuild and not once
per object compile/link.  Use the pc files from both libchrome
and libchromeos.  Drop glib-2.0 usage since we only had that for
the implicit dep via libbase (we're using the .pc file now which
expresses that requirement).

BUG=chromium-os:16623
TEST=`emerge-x86-alex chromeos-debugd` still works
TEST=`cros_run_unit_tests --board x86-alex -p chromeos-debugd` passes

Change-Id: I3f6cbfa9a7a38622fe8f80421b034cadc68bdde7

14 months ago[debugd] add OWNERS 07/16507/1
Elly Jones [Thu, 23 Feb 2012 19:57:52 +0000 (14:57 -0500)]
[debugd] add OWNERS

BUG=chromium-os:22007
TEST=None

Change-Id: I33fb14a265818801e5b59f18d89f1ea7993d7b4d
Signed-off-by: Elly Jones <ellyjones@chromium.org>
14 months ago[debugd] change default ping count to infinite 67/16367/1
Sam Leffler [Wed, 22 Feb 2012 18:25:48 +0000 (10:25 -0800)]
[debugd] change default ping count to infinite

Change the default ping count to be consistent with how cmd-line ping
works--send ping packets until interrupted.

BUG=none
TEST=run ping gw from crosh and verify it no longer stops after 4 packets

Change-Id: I3552db111975b55f47e67c6a9d16bd846a23a0e2

15 months ago[debugd] add SetDebugMode 29/15629/5
Elly Jones [Thu, 9 Feb 2012 19:29:06 +0000 (14:29 -0500)]
[debugd] add SetDebugMode

TODO: autotest

BUG=chromium-os:26091
TEST=Not yet

Change-Id: I66ca135bb9a81a5f9f236d552c9ea6b23bda46b9
Signed-off-by: Elly Jones <ellyjones@chromium.org>
15 months ago[debugd] add GetDebugLogs 60/15860/2
Elly Jones [Tue, 14 Feb 2012 23:24:22 +0000 (18:24 -0500)]
[debugd] add GetDebugLogs

This DBus method emits system debug logs (from /var/log) over a supplied file
descriptor.

BUG=chromium-os:26391
TEST=Not yet

Change-Id: I1eafa1ba68ac6b3f669c3f61a6a72d3e5eb36862
Signed-off-by: Elly Jones <ellyjones@chromium.org>
15 months agoMakefile cleanup 77/15377/1
Will Drewry [Tue, 7 Feb 2012 02:57:08 +0000 (20:57 -0600)]
Makefile cleanup

- Fixed outer invocation to not lose OUT=
- Removed all use of $(OUT) in target naming and dependencies
- Cleaned up %.h: %.xml so that they trigger without VPATH
- Removes VPATH directives
- Moved to using $($(MODULE_NAME)_CXX_OBJECTS) for $(helpers_CXX_OBJECTS)
- Made helper dependencies generated like the rest of their rules
- Reordered helper generation such that DBUSHDRS is present at eval time

Signed-off-by: Will Drewry <wad@chromium.org>
BUG=chromium-os:25791
TEST=builds and installed without modem_status.cc. With modem_status.cc, gets DBusPropertyProxyErrors.  Need ellyjones@ to test this.  Since the build dependencies are underdeclared, I'm hoping it builds properly there or in a trybot. Will try there next.

Change-Id: I8936d78665a5c57403563a58d81977e2e9413fa6

15 months ago[debugd] Add GetNetworkStatus() 12/14912/4
Elly Jones [Thu, 26 Jan 2012 23:06:24 +0000 (18:06 -0500)]
[debugd] Add GetNetworkStatus()

BUG=chromium-os:25543
TEST=platform_DebugDaemonGetNetworkStatus

Change-Id: Id8a54e98e2f0e1125c9af6009218de6f0c2a5c76
Signed-off-by: Elly Jones <ellyjones@chromium.org>
15 months ago[debugd] add GetModemStatus skeleton. 50/13750/10 release-R18-1660.B
Elly Jones [Thu, 5 Jan 2012 23:05:56 +0000 (18:05 -0500)]
[debugd] add GetModemStatus skeleton.

Just a skeleton of the infrastructure that will be required to do this properly;
the meat of GetModemStatus isn't implemented yet. I still need to update the
design doc too.

BUG=chromium-os:23839
TEST=platform_DebugDaemonGetModemStatus

Change-Id: I76b09b7b762b3d36537ab3485b534b7abb727216
Signed-off-by: Elly Jones <ellyjones@chromium.org>
15 months agoMerge "pull in latest common.mk for make-3.82 fixes"
Gerrit [Tue, 17 Jan 2012 22:36:01 +0000 (14:36 -0800)]
Merge "pull in latest common.mk for make-3.82 fixes"

16 months agopull in latest common.mk for make-3.82 fixes 16/14216/1
Mike Frysinger [Sat, 14 Jan 2012 06:53:21 +0000 (01:53 -0500)]
pull in latest common.mk for make-3.82 fixes

BUG=chromium-os:24841
TEST=`emerge chromeos-debugd` worked with make-3.82

Change-Id: I5995d104cabb0f03820b18f5fc56508fa7b22bc0

16 months agodo not pass MAKEFLAGS by hand 15/14215/1
Mike Frysinger [Sat, 14 Jan 2012 06:48:05 +0000 (01:48 -0500)]
do not pass MAKEFLAGS by hand

The $(MAKE) variable takes care of passing things like command line
flags to sub-makes, so we don't have to parse MAKEFLAGS ourselves.

Otherwise, trying to do something like `make -j` leads to failure:
make[2]: Entering directory `/home/vapier/trunk/src/platform/debugd'
make[2]: *** No rule to make target `j'.  Stop.
make[2]: Leaving directory `/home/vapier/trunk/src/platform/debugd'

BUG=None
TEST=build by hand with -j and see it work

Change-Id: I741ad4f0db4bb756a8c490a5b245481d03707c2e

16 months ago[debugd] add GetRoutes() API. 52/13252/4
Elly Jones [Tue, 20 Dec 2011 20:01:59 +0000 (15:01 -0500)]
[debugd] add GetRoutes() API.

This API exposes the system routing table.

BUG=chromium-os:23839
TEST=Adhoc,platform_DebugDaemonGetRoutes
dbus-send --system --fixed --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.GetRoutes \
dict:string:variant:numeric,boolean:true:v6,boolean:true

Change-Id: I2018beff1ec44ba1f145f02a9534923590c3cc04
Signed-off-by: Elly Jones <ellyjones@chromium.org>
16 months ago[debugd] migrate to new common.mk 89/13189/1
Elly Jones [Mon, 19 Dec 2011 23:29:51 +0000 (18:29 -0500)]
[debugd] migrate to new common.mk

This lets unit tests work properly, since we need the new common.mk's
run-tests-with-bind-mounts functionality.

Change-Id: I84cd1356d3994760173bd9a6eb7b825214ce41d7
Signed-off-by: Elly Jones <ellyjones@chromium.org>
16 months ago[debugd] add TracePath{Start,Stop} 77/13177/3
Elly Jones [Mon, 19 Dec 2011 21:59:10 +0000 (16:59 -0500)]
[debugd] add TracePath{Start,Stop}

BUG=chromium-os:23839
TEST=platform_DebugDaemonTracePath

Change-Id: I4fd15a4aba146d8127360312db37da89ba070435
Signed-off-by: Elly Jones <ellyjones@chromium.org>
16 months ago[debugd] factor out process tracking 55/13155/2
Elly Jones [Mon, 19 Dec 2011 21:19:22 +0000 (16:19 -0500)]
[debugd] factor out process tracking

This is about to be needed for tracepath/route.

BUG=chromium-os:23839
TEST=platform_DebugDaemonPing

Change-Id: Id70a09d651a6c91d0d5f491cb2dfe9adef720487
Signed-off-by: Elly Jones <ellyjones@chromium.org>
16 months agodebugd: implement PingStart and PingStop. 29/12329/12
Elly Jones [Thu, 1 Dec 2011 19:18:32 +0000 (14:18 -0500)]
debugd: implement PingStart and PingStop.

Implement our first DBus methods.

BUG=chromium-os:20843
TEST=unittests,platform_DebugDaemonPing

Change-Id: Idd1b04a3b4fb75c91e8a31f89feebb5e116373f1
Signed-off-by: Elly Jones <ellyjones@chromium.org>
18 months agodebugd: pull new common.mk. 79/11779/1 factory-1412.B release-R17-1412.B
Elly Jones [Wed, 16 Nov 2011 19:25:03 +0000 (14:25 -0500)]
debugd: pull new common.mk.

Change-Id: I9dec9110f18d07d853a603621e3b1e7eed8cef07
Signed-off-by: Elly Jones <ellyjones@chromium.org>
18 months agodebugd: Add skeleton. 28/11228/9
Elly Jones [Fri, 4 Nov 2011 18:48:13 +0000 (14:48 -0400)]
debugd: Add skeleton.

The skeleton sandboxes the debug daemon, mounts the tmpfs, and launches its
helper programs (of which there are currently none). It then enters the DBus
main loop and handles method calls (of which there are currently none).

TEST=None yet
BUG=chromium-os:20843

Change-Id: I54ff713969a84c0a2571ad69d31a8d2b2b11e874
Signed-off-by: Elly Jones <ellyjones@chromium.org>
18 months agodebugd: first pass at documentation. 60/8460/8 factory-1284.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B
Elly Jones [Wed, 28 Sep 2011 22:46:32 +0000 (18:46 -0400)]
debugd: first pass at documentation.

Add the start of a design doc, an implementation doc, and an API.

TODO: Flesh the API out more.

BUG=chromium-os:20843
TEST=None

Change-Id: Ic2f1e61dde8a7a8d1364549f897c896960a2a0ae
Signed-off-by: Elly Jones <ellyjones@chromium.org>