New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 667651 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature

Blocked on:
issue 807180
issue 816814



Sign in to add a comment

Improve component probing mechanism

Project Member Reported by akahuang@chromium.org, Nov 22 2016

Issue description

Currently the probing code were developed by "what is usually found on a laptop", instead of "what's in AVL". During more and more project, factory team get problems like:
- The component can or cannot be probed.
- The component should be probed but it's not at the usual place.
- A value is probed but it's incorrect value.

The goal is to make HWID and probing more solid and simple to develop and use.

Change proposal:
https://docs.google.com/document/d/1jxHKi-3HYrPwPfQVHH8pjiHLSgGLhWyw-7kknSyHz5I/edit?ts=582d6f3d#heading=h.cuy5lwbw33c9

Design doc:
https://docs.google.com/document/d/15EIQwD0Gmd6Iel2Bb5Dsjg00EnBfY0JMnnPuN0yGSOg/edit
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/a8bcb919953242729524012da37f3a6ca70211eb

commit a8bcb919953242729524012da37f3a6ca70211eb
Author: Chih-Yu Huang <akahuang@google.com>
Date: Tue Nov 22 06:39:58 2016

probe: Implement function class.

A instance of the Function class is a callable object. The input and
output are both list of dictionaries. We implemented the basic
structure in this CL. The new function should be implemented at
`probe/functions/<function_name>.py`.
After calling `function.LoadFunctions`, all the functions in the
`probe/functions/` folder are registered.

BUG=chromium:667651
TEST=unittest in py/probe/function

Change-Id: I2a4e814068055a01216d2a752df16c6df82649b5
Reviewed-on: https://chromium-review.googlesource.com/413166
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>

[add] https://crrev.com/a8bcb919953242729524012da37f3a6ca70211eb/py/probe/functions/__init__.py
[add] https://crrev.com/a8bcb919953242729524012da37f3a6ca70211eb/py/probe/functions/file_unittest.py
[add] https://crrev.com/a8bcb919953242729524012da37f3a6ca70211eb/py/probe/__init__.py
[add] https://crrev.com/a8bcb919953242729524012da37f3a6ca70211eb/py/probe/function.py
[add] https://crrev.com/a8bcb919953242729524012da37f3a6ca70211eb/py/probe/functions/file.py
[add] https://crrev.com/a8bcb919953242729524012da37f3a6ca70211eb/py/probe/function_unittest.py
[add] https://crrev.com/a8bcb919953242729524012da37f3a6ca70211eb/py/probe/functions/factory_common.py
[add] https://crrev.com/a8bcb919953242729524012da37f3a6ca70211eb/py/probe/factory_common.py

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/d8981820ad98d12840e72f2bd8d953a4c7fe26ef

commit d8981820ad98d12840e72f2bd8d953a4c7fe26ef
Author: Chih-Yu Huang <akahuang@google.com>
Date: Mon Nov 28 09:18:36 2016

probe: Implement "match" function.

The probe statement has two fields: "eval" and "expect". The "expect"
field is the expected value of the probe result. We implement "match"
function to filter the results that does not match the expected value.

BUG=chromium:667651
TEST=py/probe/functions/*_unittest.py

Change-Id: I3e7e7f85944eeeb63f739d9b21163e9b9e7184e1
Reviewed-on: https://chromium-review.googlesource.com/414770
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>

[add] https://crrev.com/d8981820ad98d12840e72f2bd8d953a4c7fe26ef/py/probe/functions/match.py
[add] https://crrev.com/d8981820ad98d12840e72f2bd8d953a4c7fe26ef/py/probe/functions/match_unittest.py

Project Member

Comment 5 by bugdroid1@chromium.org, Dec 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/691c0b14f26a95da6e4374122560e9f6a6a93dbb

commit 691c0b14f26a95da6e4374122560e9f6a6a93dbb
Author: Chih-Yu Huang <akahuang@google.com>
Date: Wed Dec 07 04:22:55 2016

Move LoadKernelModule to sys_utils.py

Also changed the import style.

BUG=chromium:667651
TEST=sys_utils_unittest.py

Change-Id: Icd16dd4ee31ee3278e2cfa458e08508baad53870
Reviewed-on: https://chromium-review.googlesource.com/417740
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>

[modify] https://crrev.com/691c0b14f26a95da6e4374122560e9f6a6a93dbb/py/gooftool/probe.py
[modify] https://crrev.com/691c0b14f26a95da6e4374122560e9f6a6a93dbb/py/utils/sys_utils.py

Project Member

Comment 6 by bugdroid1@chromium.org, Dec 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/87b72893595bd4b46f877f3be773d32731b79c10

commit 87b72893595bd4b46f877f3be773d32731b79c10
Author: Chih-Yu Huang <akahuang@google.com>
Date: Mon Nov 28 09:24:23 2016

probe: Implement probe command line.

We implemented two commands in probe command line:
- "eval_function"
Evaluate a probe function directly. It is handy for testing the
function implementation and finding the probed results. For example,
to call the "file" function to probe /tmp/test file:
$ ./probe_cmdline.py eval_function file /tmp/test

- "probe"
Probe the result according to the probe statements. It is similar to
"gooftool probe". The command requires a config file and output the
matched probe results. For example:
$ ./probe_cmdline.py probe probe_config.json

BUG=chromium:667651
TEST=py/probe/probe_cmdline_unittest.py

Change-Id: Ic1f693d3e3739f4f4eafc5bcb4b93bb998b26a33
Reviewed-on: https://chromium-review.googlesource.com/414669
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>

[modify] https://crrev.com/87b72893595bd4b46f877f3be773d32731b79c10/py/probe/function.py
[add] https://crrev.com/87b72893595bd4b46f877f3be773d32731b79c10/py/probe/probe_cmdline_unittest.py
[modify] https://crrev.com/87b72893595bd4b46f877f3be773d32731b79c10/py/utils/arg_utils.py
[add] https://crrev.com/87b72893595bd4b46f877f3be773d32731b79c10/py/probe/probe_cmdline.py
[add] https://crrev.com/87b72893595bd4b46f877f3be773d32731b79c10/bin/probe

Project Member

Comment 8 by bugdroid1@chromium.org, Dec 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/475bc85bb163bef9aaf0df784e0e73ae0faede31

commit 475bc85bb163bef9aaf0df784e0e73ae0faede31
Author: Chih-Yu Huang <akahuang@google.com>
Date: Fri Dec 02 06:54:43 2016

probe: Implement I2C probe function.

BUG=chromium:667651
TEST=py/probe/functions/i2c_unittest.py

Change-Id: I7a12afb00702c86c4975b2b371667376e578f9cc
Reviewed-on: https://chromium-review.googlesource.com/415714
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>

[add] https://crrev.com/475bc85bb163bef9aaf0df784e0e73ae0faede31/py/probe/functions/i2c.py
[add] https://crrev.com/475bc85bb163bef9aaf0df784e0e73ae0faede31/py/probe/functions/i2c_unittest.py

Project Member

Comment 9 by bugdroid1@chromium.org, Dec 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/7b280876db02d3dc7532e364bf2f59024b801ffb

commit 7b280876db02d3dc7532e364bf2f59024b801ffb
Author: Chih-Yu Huang <akahuang@google.com>
Date: Fri Dec 02 06:28:16 2016

probe: Add function exception handle.

If any exception occurs while the function is applied, then return
the empty array.

BUG=chromium:667651
TEST=unittest in py/probe/

Change-Id: I78234606884001b689eed58d5133321f40bad3cd
Reviewed-on: https://chromium-review.googlesource.com/415871
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>

[modify] https://crrev.com/7b280876db02d3dc7532e364bf2f59024b801ffb/py/probe/function.py

Project Member

Comment 10 by bugdroid1@chromium.org, Dec 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/87b77bd6edf61953bffa03744c8877bbbcbb5ac0

commit 87b77bd6edf61953bffa03744c8877bbbcbb5ac0
Author: Chih-Yu Huang <akahuang@google.com>
Date: Wed Dec 07 04:23:54 2016

probe: implement edid probe function.

Because we would deprecate gooftool.probe after the new probe module
is finished, we move the core EDID probing code to new place, and
redirect old module to new one for keeping the backward compatibilty.

BUG=chromium:667651
TEST=py/probe/functions/edid_unittest.py

Change-Id: I983790e23f11ac0c4b44b17d9f05a3f992f67e74
Reviewed-on: https://chromium-review.googlesource.com/417741
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>

[modify] https://crrev.com/87b77bd6edf61953bffa03744c8877bbbcbb5ac0/py/probe/function.py
[add] https://crrev.com/87b77bd6edf61953bffa03744c8877bbbcbb5ac0/py/probe/functions/edid_unittest.py
[add] https://crrev.com/87b77bd6edf61953bffa03744c8877bbbcbb5ac0/py/probe/functions/edid.py
[delete] https://crrev.com/b191bf7eda9b4810c34455cc845c99e61cd9fbbd/py/gooftool/edid_unittest.py
[modify] https://crrev.com/87b77bd6edf61953bffa03744c8877bbbcbb5ac0/py/gooftool/edid.py

Project Member

Comment 11 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/7641299be1999078a699384e9d8aa99992810c18

commit 7641299be1999078a699384e9d8aa99992810c18
Author: Chih-Yu Huang <akahuang@google.com>
Date: Thu Dec 08 06:23:57 2016

probe: implement input_device probe function.

BUG=chromium:667651
TEST=py/probe/functions/input_device_unittest.py

Change-Id: I88d7cfd73d48ba7d6a2de33987bcb5f134481c78
Reviewed-on: https://chromium-review.googlesource.com/417429
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>

[add] https://crrev.com/7641299be1999078a699384e9d8aa99992810c18/py/probe/functions/input_device.py
[add] https://crrev.com/7641299be1999078a699384e9d8aa99992810c18/py/probe/functions/input_device_unittest.py

Project Member

Comment 12 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/55ac9317c0b62883640c36eb8d4e54cb12cc5c4c

commit 55ac9317c0b62883640c36eb8d4e54cb12cc5c4c
Author: Chih-Yu Huang <akahuang@google.com>
Date: Thu Dec 08 09:16:11 2016

probe: implement VPD probe function.

BUG=chromium:667651
TEST=py/probe/functions/vpd_unittest.py

Change-Id: Ib311ee67ad84a088159e50bf86b9441e6e72ba79
Reviewed-on: https://chromium-review.googlesource.com/417463
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>

[add] https://crrev.com/55ac9317c0b62883640c36eb8d4e54cb12cc5c4c/py/probe/functions/vpd_unittest.py
[add] https://crrev.com/55ac9317c0b62883640c36eb8d4e54cb12cc5c4c/py/probe/functions/vpd.py

Project Member

Comment 13 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/a015c66f51a059de93715810eb8cbfbbc5fbba4b

commit a015c66f51a059de93715810eb8cbfbbc5fbba4b
Author: Chih-Yu Huang <akahuang@google.com>
Date: Wed Dec 07 11:14:52 2016

probe: implement flash_chip probe function.

This function is to get the information of main, EC, and PD chip.

BUG=chromium:667651
TEST=py/probe/functions/flash_chip_unittest.py

Change-Id: Ia7100b09f91f326d3c2c2efe2530cc22e6433da4
Reviewed-on: https://chromium-review.googlesource.com/417622
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>

[add] https://crrev.com/a015c66f51a059de93715810eb8cbfbbc5fbba4b/py/probe/functions/flash_chip_unittest.py
[add] https://crrev.com/a015c66f51a059de93715810eb8cbfbbc5fbba4b/py/probe/functions/flash_chip.py

Project Member

Comment 14 by bugdroid1@chromium.org, Feb 10 2017

Labels: merge-merged-factory-reef-8811.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/76919441859b898dc1a8816f3e48a62b7bcd1e58

commit 76919441859b898dc1a8816f3e48a62b7bcd1e58
Author: Chih-Yu Huang <akahuang@google.com>
Date: Fri Feb 10 05:10:01 2017

Move LoadKernelModule to sys_utils.py

Also changed the import style.

BUG=chromium:667651
TEST=sys_utils_unittest.py

Change-Id: Icd16dd4ee31ee3278e2cfa458e08508baad53870
Reviewed-on: https://chromium-review.googlesource.com/417740
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/440708
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/76919441859b898dc1a8816f3e48a62b7bcd1e58/py/gooftool/probe.py
[modify] https://crrev.com/76919441859b898dc1a8816f3e48a62b7bcd1e58/py/utils/sys_utils.py

Project Member

Comment 15 by bugdroid1@chromium.org, Feb 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/c1141fb9a7963d7d4c4308d189db92f45f5fbc3c

commit c1141fb9a7963d7d4c4308d189db92f45f5fbc3c
Author: Chih-Yu Huang <akahuang@google.com>
Date: Wed Feb 22 08:35:22 2017

probe: add syntax sugar for probe statement.

1. When we describe a function without argument, we can just use the
function name.

2. When the expect field of the probe statement is not assigned, the
default value is a empty dictionary, which means to accept every
result from the probe function. For example:
  {
    'eval': 'shell:echo hello'
  }
should returns:
  [
    {'shell_raw': 'hello'}
  ]

BUG=chromium:667651
TEST=py/probe/function_unittest.py

Change-Id: Ib9f1a599e392061ba17f4549af9fb5ca7e130a7f
Reviewed-on: https://chromium-review.googlesource.com/440769
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/c1141fb9a7963d7d4c4308d189db92f45f5fbc3c/py/probe/function.py
[modify] https://crrev.com/c1141fb9a7963d7d4c4308d189db92f45f5fbc3c/py/probe/function_unittest.py
[modify] https://crrev.com/c1141fb9a7963d7d4c4308d189db92f45f5fbc3c/py/probe/probe_cmdline.py

Project Member

Comment 16 by bugdroid1@chromium.org, Feb 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/a8480732cc020549a716f64bfd889484cfd6ea40

commit a8480732cc020549a716f64bfd889484cfd6ea40
Author: Chih-Yu Huang <akahuang@google.com>
Date: Wed Feb 22 08:35:22 2017

probe: add `optional_keys` argument in sysfs function.

The `optional_keys` argument of the sysfs function is a list. If the
files exist, then the fields are included in the result.

BUG=chromium:667651
TEST=make test

Change-Id: I207f8073038e55c8988dc3df34403685abf8d2af
Reviewed-on: https://chromium-review.googlesource.com/440904
Commit-Ready: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Chih-Yu Huang <akahuang@chromium.org>

[modify] https://crrev.com/a8480732cc020549a716f64bfd889484cfd6ea40/py/probe/functions/sysfs_unittest.py
[modify] https://crrev.com/a8480732cc020549a716f64bfd889484cfd6ea40/py/probe/functions/sysfs.py

Cc: yhong@chromium.org
Cc: -yhong@chromium.org akahuang@chromium.org
Owner: yhong@chromium.org

Comment 19 by yhong@chromium.org, Mar 30 2018

Blockedon: 816814

Comment 20 by yhong@chromium.org, Mar 30 2018

Blockedon: 807180
Project Member

Comment 21 by bugdroid1@chromium.org, Apr 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/d54b491660af091372349d06b63d4da334e2fa30

commit d54b491660af091372349d06b63d4da334e2fa30
Author: Yong Hong <yhong@chromium.org>
Date: Mon Apr 23 06:13:46 2018

probe: Add "device_path" to the probed result.

This CL add an extra field "device_path" to the probed result from
the functions which obtain information from sysfs.  The new field
records the pathname of the sysfs directory of the component.

BUG=b:77464719, chromium:667651
TEST=make test

Change-Id: I58999d4124bf103f02015af394efcd528d1b9591
Reviewed-on: https://chromium-review.googlesource.com/1013853
Commit-Ready: Yong Hong <yhong@google.com>
Tested-by: Yong Hong <yhong@google.com>
Reviewed-by: Yilun Lin <yllin@chromium.org>

[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/functions/usb_unittest.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/lib/cached_probe_function.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/functions/touchscreen_elan.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/functions/usb.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/lib/cached_probe_function_unittest.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/functions/mmc.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/functions/pci_unittest.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/functions/touchscreen_elan_unittest.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/functions/pci.py
[modify] https://crrev.com/d54b491660af091372349d06b63d4da334e2fa30/py/probe/functions/mmc_unittest.py

Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".

Sign in to add a comment