New issue
Advanced search Search tips

Issue 901126 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Create a command-line tool to interact with diagnosticsd

Project Member Reported by pmoy@chromium.org, Nov 1

Issue description

Implement a command-line tool which communicates with diagnosticsd.

Requirements for the tool will be tracked in the following document:
https://docs.google.com/document/d/1RbcTdRHs1NE0W1pK1Lch_4SBENjeuYq9lnrr8U-u0tI/edit?usp=sharing

For the first iteration, the tool should take a single argument (relative file path) and send a GetProcDataRequest RPC to diagnosticsd, then display the returned GetProcDataResponse to the console. This will validate some of diagnosticsd's functionality.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 7

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/4f9699184bac553ca0c066aec7c469b58df135d3

commit 4f9699184bac553ca0c066aec7c469b58df135d3
Author: Paul Moy <pmoy@chromium.org>
Date: Wed Nov 07 19:40:51 2018

diagnostics: add empty telem tool

The telem tool will be a command-line tool which interacts with
diagnosticsd. Add an empty telem tool which only creates an
AsyncGrpcClient.

BUG=chromium:901126
TEST=emerge-sarien diagnostics, check /build/sarien/usr/bin for
telem

Change-Id: I5a3bb6083778b0c93989894b354fdd21fd698d86
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1319973
Reviewed-by: Simon Glass <sjg@chromium.org>

[modify] https://crrev.com/4f9699184bac553ca0c066aec7c469b58df135d3/diagnostics/diagnostics.gyp
[add] https://crrev.com/4f9699184bac553ca0c066aec7c469b58df135d3/diagnostics/telem/main.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/e77d3aee22eecfb4401dafa610103b933636512d

commit e77d3aee22eecfb4401dafa610103b933636512d
Author: Paul Moy <pmoy@chromium.org>
Date: Wed Nov 14 14:27:24 2018

diagnostics: install telem executable to /usr/bin

Modify the diagnostics ebuild to install the telem
executable.

BUG=chromium:901126
TEST=emerge-sarien diagnostics, check /build/sarien/usr/bin for
telem

Change-Id: I47f51f774ecfd2c7471226134bd8c17dc1e632aa
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1333829
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Trent Begin <tbegin@chromium.org>

[modify] https://crrev.com/e77d3aee22eecfb4401dafa610103b933636512d/chromeos-base/diagnostics/diagnostics-9999.ebuild

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/c043e7dc296ecd4d05bc6142ae44e9876b010542

commit c043e7dc296ecd4d05bc6142ae44e9876b010542
Author: Paul Moy <pmoy@chromium.org>
Date: Thu Nov 15 21:16:06 2018

diagnostics: make telem report proc/meminfo

Make the telemetry tool actually communicate with diagnosticsd.
Open a socket and communicate via gRPC. The message is hardcoded
to GetProcDataRequest with type=MEMINFO. The response is printed
to the console. Future CLs will refactor telem to have a smaller
main.cc and move the logic to a static library.

BUG=chromium:901126
TEST=(on DUT)telem, output should be the contents of /proc/meminfo.

Change-Id: I2f8f5feb0ac39f2fcedbf77fd3bd3ea68230ecdc
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1324311
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>

[modify] https://crrev.com/c043e7dc296ecd4d05bc6142ae44e9876b010542/diagnostics/telem/main.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Nov 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/20f2808bd9e707ce1e106a301e4226abcf1fc90c

commit 20f2808bd9e707ce1e106a301e4226abcf1fc90c
Author: Paul Moy <pmoy@chromium.org>
Date: Sat Nov 17 03:50:42 2018

diagnostics: refactor telem/main.cc into libtelem

telem/main.cc has a lot of logic which should be refactored
into a static library, which the telem tool and telemetry
controller (which doesn't exist yet) can both use. Create
the beginnings of libtelem, and move the logic from
telem/main.cc into libtelem.

BUG=chromium:901126
TEST=build and deploy diagnostics on sarien, then run telem.
Telem should print the contents of /proc/meminfo to the console.

Change-Id: I1236c20aca3125a59516e0bf6d0d0dfcc9f1be25
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1324313
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>

[modify] https://crrev.com/20f2808bd9e707ce1e106a301e4226abcf1fc90c/diagnostics/diagnostics.gyp
[add] https://crrev.com/20f2808bd9e707ce1e106a301e4226abcf1fc90c/diagnostics/telem/telem_connection.cc
[modify] https://crrev.com/20f2808bd9e707ce1e106a301e4226abcf1fc90c/diagnostics/telem/main.cc
[add] https://crrev.com/20f2808bd9e707ce1e106a301e4226abcf1fc90c/diagnostics/telem/telem_connection.h

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/bc11e699c37073c11d044939a7a15ef093b6e664

commit bc11e699c37073c11d044939a7a15ef093b6e664
Author: Paul Moy <pmoy@chromium.org>
Date: Sat Nov 17 03:50:43 2018

diagnostics: replace RpcReply with a lightweight callback

libtelem had been using the RpcReply class originally designed
for testing AsyncGrpcServer and AsyncGrpcClient. RpcReply had
much more functionality than needed for libtelem. Replace
RpcReply with a callback.

BUG=chromium:901126
TEST=build and deploy diagnostics for sarien, run telem and
make sure it still displays the contents of /proc/meminfo.

Change-Id: I182cac69b37c2d2b0f946a7896de613150336a10
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1334108
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>

[modify] https://crrev.com/bc11e699c37073c11d044939a7a15ef093b6e664/diagnostics/telem/telem_connection.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Dec 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/46d2fdf539420561fde9b942bdebfe757874eaf3

commit 46d2fdf539420561fde9b942bdebfe757874eaf3
Author: Paul Moy <pmoy@chromium.org>
Date: Tue Dec 11 21:00:54 2018

diagnostics: add caching and command-line arguments to telem.

Add the ability to request a single telemetry item from the
command line to telem. Also add the ability to cache data
retrieved from diagnosticsd. Add unit tests for the caching
functionality and parsing. Currently, the only two supported
items are memfree and memtotal.

BUG=chromium:901126
TEST=unit tests, also manual tests for the command-line
options memfree and memtotal.

Change-Id: Ie5da1f0e63f0c879ef1cdc0dad0a3d602eae6f0e
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1334487
Reviewed-by: Simon Glass <sjg@chromium.org>

[add] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/telem_connection_test.cc
[add] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/async_grpc_client_adapter.h
[add] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/async_grpc_client_adapter_impl.cc
[modify] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/main.cc
[add] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/telem_cache.h
[modify] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/diagnostics.gyp
[modify] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/telem_connection.h
[add] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/telemetry_item_enum.h
[modify] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/telem_connection.cc
[add] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/telem_cache.cc
[add] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/telem_cache_test.cc
[add] https://crrev.com/46d2fdf539420561fde9b942bdebfe757874eaf3/diagnostics/telem/async_grpc_client_adapter_impl.h

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/7660f9c692d133d65147af5cfb4daeb0a574e395

commit 7660f9c692d133d65147af5cfb4daeb0a574e395
Author: Paul Moy <pmoy@chromium.org>
Date: Wed Dec 12 03:33:55 2018

diagnostics: add libtelem tests to ebuild.

Now that libtelem has unit tests, they need to
be added to the diagnostics ebuild.

BUG=chromium:901126
TEST=FEATURES=test emerge-sarien diagnostics,
make sure libtelem tests are run.

Change-Id: I7914406dc9c41843fbab3b4e1a9d054ce8fc7387
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1370668
Reviewed-by: Simon Glass <sjg@chromium.org>

[modify] https://crrev.com/7660f9c692d133d65147af5cfb4daeb0a574e395/chromeos-base/diagnostics/diagnostics-9999.ebuild

Project Member

Comment 8 by bugdroid1@chromium.org, Dec 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/202932688745d459b5e9144726fbf6c9525247e4

commit 202932688745d459b5e9144726fbf6c9525247e4
Author: Paul Moy <pmoy@chromium.org>
Date: Tue Dec 18 08:42:45 2018

diagnostics: add support for retrieving groups to libtelem.

Currently, libtelem can only retrieve single items. Add support
for retrieving entire groups (list of related items). Also add
tests for both GetGroup and GetItem.

BUG=chromium:901126
TEST=manual and unit tests.

Change-Id: I058176c34800ae94ecab3020490c3df76d83c8ba
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1375090
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

[modify] https://crrev.com/202932688745d459b5e9144726fbf6c9525247e4/diagnostics/telem/telem_connection_test.cc
[modify] https://crrev.com/202932688745d459b5e9144726fbf6c9525247e4/diagnostics/telem/main.cc
[modify] https://crrev.com/202932688745d459b5e9144726fbf6c9525247e4/diagnostics/telem/telem_cache.h
[modify] https://crrev.com/202932688745d459b5e9144726fbf6c9525247e4/diagnostics/telem/telem_connection.cc
[modify] https://crrev.com/202932688745d459b5e9144726fbf6c9525247e4/diagnostics/telem/telem_cache.cc
[modify] https://crrev.com/202932688745d459b5e9144726fbf6c9525247e4/diagnostics/telem/telem_cache_test.cc
[add] https://crrev.com/202932688745d459b5e9144726fbf6c9525247e4/diagnostics/telem/telemetry_group_enum.h
[modify] https://crrev.com/202932688745d459b5e9144726fbf6c9525247e4/diagnostics/telem/telem_connection.h

Project Member

Comment 9 by bugdroid1@chromium.org, Dec 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/bc8b95ed02ca41af5331c848678362aa25ac6342

commit bc8b95ed02ca41af5331c848678362aa25ac6342
Author: Paul Moy <pmoy@chromium.org>
Date: Thu Dec 20 21:49:52 2018

diagnostics: parse the /proc/loadavg response.

Add support for two more telemetry items, runnable_entities and
existing_entities, both of which come from the /proc/loadavg
response.

BUG=chromium:901126
TEST=deploy diagnostics, run telem --item=runnable_entities and
telem --item=existing_entities. Compare with /proc/loadavg.

Change-Id: I744723464ad612751f3efc8e82afa82799bfffb5
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1376777
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Trent Begin <tbegin@chromium.org>

[modify] https://crrev.com/bc8b95ed02ca41af5331c848678362aa25ac6342/diagnostics/diagnostics.gyp
[modify] https://crrev.com/bc8b95ed02ca41af5331c848678362aa25ac6342/diagnostics/telem/telem_connection.cc
[modify] https://crrev.com/bc8b95ed02ca41af5331c848678362aa25ac6342/diagnostics/telem/telem_connection_test.cc
[modify] https://crrev.com/bc8b95ed02ca41af5331c848678362aa25ac6342/diagnostics/telem/main.cc
[modify] https://crrev.com/bc8b95ed02ca41af5331c848678362aa25ac6342/diagnostics/telem/telemetry_item_enum.h

Project Member

Comment 10 by bugdroid1@chromium.org, Dec 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/0716df74cb79509fcd9c4b67ef2ad75c91fdb480

commit 0716df74cb79509fcd9c4b67ef2ad75c91fdb480
Author: Paul Moy <pmoy@chromium.org>
Date: Fri Dec 21 02:06:30 2018

diagnostics: parse the /proc/stat response.

Add support for retrieving two more telemetry items:
idle time per CPU, and total idle time for the system.
These both come from the /proc/stat response.

BUG=chromium:901126
TEST=manual command line tests for the two new items,
and unit tests.

Change-Id: I3482db998bf2103aa50bf78c20ac4c493c7d64a6
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1383252
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Trent Begin <tbegin@chromium.org>

[modify] https://crrev.com/0716df74cb79509fcd9c4b67ef2ad75c91fdb480/diagnostics/telem/telem_connection.cc
[modify] https://crrev.com/0716df74cb79509fcd9c4b67ef2ad75c91fdb480/diagnostics/telem/telem_connection_test.cc
[modify] https://crrev.com/0716df74cb79509fcd9c4b67ef2ad75c91fdb480/diagnostics/telem/telem_cache_test.cc
[modify] https://crrev.com/0716df74cb79509fcd9c4b67ef2ad75c91fdb480/diagnostics/telem/main.cc
[modify] https://crrev.com/0716df74cb79509fcd9c4b67ef2ad75c91fdb480/diagnostics/telem/telemetry_item_enum.h

Project Member

Comment 11 by bugdroid1@chromium.org, Dec 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/d2a7313f7512253868f815c9c911fbbec160f6d2

commit d2a7313f7512253868f815c9c911fbbec160f6d2
Author: Paul Moy <pmoy@chromium.org>
Date: Mon Dec 24 03:19:26 2018

diagnostics: add more unit tests.

libtelem now has tests for each telemetry item which
can be retrieved. Each telemetry item has a test where
the data is parsed successfully, and a test where the
data passed in is bad and fails to parse.

BUG=chromium:901126
TEST=unit tests

Change-Id: Ida678faf68791f7c7cf16398142637ef541fd2cb
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1384759
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Polina Bondarenko <pbond@chromium.org>
Reviewed-by: Trent Begin <tbegin@chromium.org>

[modify] https://crrev.com/d2a7313f7512253868f815c9c911fbbec160f6d2/diagnostics/telem/telem_connection_test.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Jan 20 (2 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/c689d9b6f36775a86704d91c15e8a14fdab702ed

commit c689d9b6f36775a86704d91c15e8a14fdab702ed
Author: Paul Moy <pmoy@chromium.org>
Date: Sun Jan 20 11:16:52 2019

diagnostics: add support for reading from sysfs to libtelem.

Add a method to libtelem which lets libtelem request dumps of the
approved sysfs paths in diagnosticsd. At the moment, no parsing
is done with the returned data, and libtelem just has placeholder
TelemetryItemEnums which will be replaced by specific telemetry
items once parsing has been implemented.

BUG=chromium:901126
TEST=manual

Change-Id: I12157c37f920a0c42e4000708632d87daeeaedb0
Signed-off-by: Paul Moy <pmoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1409724
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>

[modify] https://crrev.com/c689d9b6f36775a86704d91c15e8a14fdab702ed/diagnostics/telem/telem_connection_test.cc
[modify] https://crrev.com/c689d9b6f36775a86704d91c15e8a14fdab702ed/diagnostics/telem/async_grpc_client_adapter.h
[modify] https://crrev.com/c689d9b6f36775a86704d91c15e8a14fdab702ed/diagnostics/telem/async_grpc_client_adapter_impl.cc
[modify] https://crrev.com/c689d9b6f36775a86704d91c15e8a14fdab702ed/diagnostics/telem/telem_connection.h
[modify] https://crrev.com/c689d9b6f36775a86704d91c15e8a14fdab702ed/diagnostics/telem/telemetry_item_enum.h
[modify] https://crrev.com/c689d9b6f36775a86704d91c15e8a14fdab702ed/diagnostics/telem/telem_connection.cc
[modify] https://crrev.com/c689d9b6f36775a86704d91c15e8a14fdab702ed/diagnostics/telem/async_grpc_client_adapter_impl.h

Sign in to add a comment