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
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
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/factory/+/11c6d3927320a0556bc546d8218786d1f3b96b59 commit 11c6d3927320a0556bc546d8218786d1f3b96b59 Author: Chih-Yu Huang <akahuang@google.com> Date: Wed Nov 23 03:51:07 2016 probe: Implement shell and sysfs function. BUG=chromium:667651 TEST=py/probe/functions/*_unittest.py Change-Id: I79bfd530ecf876727de3764ee2334b5a89d13eee Reviewed-on: https://chromium-review.googlesource.com/413824 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/11c6d3927320a0556bc546d8218786d1f3b96b59/py/probe/functions/sysfs_unittest.py [add] https://crrev.com/11c6d3927320a0556bc546d8218786d1f3b96b59/py/probe/functions/shell_unittest.py [add] https://crrev.com/11c6d3927320a0556bc546d8218786d1f3b96b59/py/probe/functions/shell.py [add] https://crrev.com/11c6d3927320a0556bc546d8218786d1f3b96b59/py/probe/functions/sysfs.py
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/factory/+/207a9a95e76aaa1a327543b40fbb8b5804d0348b commit 207a9a95e76aaa1a327543b40fbb8b5804d0348b Author: Chih-Yu Huang <akahuang@google.com> Date: Wed Nov 23 09:31:30 2016 probe: Implement PCI and USB sysfs function. BUG=chromium:667651 TEST=py/probe/functions/*_unittest.py Change-Id: I6d899fd6aa716fde9b3b27ca46f3d661cb2ad27b Reviewed-on: https://chromium-review.googlesource.com/413964 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/207a9a95e76aaa1a327543b40fbb8b5804d0348b/py/probe/functions/usb_unittest.py [modify] https://crrev.com/207a9a95e76aaa1a327543b40fbb8b5804d0348b/py/probe/functions/file.py [add] https://crrev.com/207a9a95e76aaa1a327543b40fbb8b5804d0348b/py/probe/functions/usb.py [add] https://crrev.com/207a9a95e76aaa1a327543b40fbb8b5804d0348b/py/probe/functions/pci_unittest.py [add] https://crrev.com/207a9a95e76aaa1a327543b40fbb8b5804d0348b/py/probe/functions/pci.py [modify] https://crrev.com/207a9a95e76aaa1a327543b40fbb8b5804d0348b/py/probe/functions/sysfs.py
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
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
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
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/factory/+/68b23ac091a716bbe2a7133f10bd10849ae8d6a6 commit 68b23ac091a716bbe2a7133f10bd10849ae8d6a6 Author: Chih-Yu Huang <akahuang@google.com> Date: Mon Nov 28 10:56:04 2016 pytests: implement probe pytest. Implement a pytest to probe components and verify the count of them. BUG=chromium:667651 TEST=test on the device Change-Id: If330c100d9c8f1b9ee480812211425eb9816d4d0 Reviewed-on: https://chromium-review.googlesource.com/414800 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/68b23ac091a716bbe2a7133f10bd10849ae8d6a6/py/test/pytests/probe/factory_common.py [add] https://crrev.com/68b23ac091a716bbe2a7133f10bd10849ae8d6a6/py/test/pytests/probe/__init__.py [add] https://crrev.com/68b23ac091a716bbe2a7133f10bd10849ae8d6a6/py/test/pytests/probe/probe.py [add] https://crrev.com/68b23ac091a716bbe2a7133f10bd10849ae8d6a6/py/test/pytests/probe/sample_probe_rule.json
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
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
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
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
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
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
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
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
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
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
This bug has an owner, thus, it's been triaged. Changing status to "assigned".
Comment 1 by bugdroid1@chromium.org
, Nov 23 2016