summaryrefslogtreecommitdiff
path: root/extra/usb_power
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-0518-2245/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* pylintrc: Copy Chromium OS platform2's configCraig Hesling2021-08-026-0/+25
| | | | | | | | | | | | | | | | | | | | This requests that cros lint (and repo upload hook) use the new Chromium OS 4 space indent policy. Since legacy python scripts still use 2 space, I added pylint ignore statements to the individual files to disable indentation checking. Note: There are still valid pylint errors in some of these legacy scripts. BRANCH=none BUG=none TEST=cros lint util/*.py Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I439f5a87bc50f1f43a4996e574bbc0626922a88e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3064761 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* docs: Run mdformat on all .md filesTom Hughes2021-01-281-92/+89
| | | | | | | | | | | BRANCH=none BUG=b:178648877 TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0ac5581ba7bc512234d40dbf34222422afa9c725 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2650551 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* stats_manager: formatting fix for md file outputRuben Rodriguez Buchillon2021-01-211-2/+3
| | | | | | | | | | | | | | | | | Minor formatting fix to make sure that .md files are \n terminated. Also a small change in the way we name the logger so that it derives the name directly from the class. BUG=b:174800621 BRANCH=None TEST=sudo servod -c kohaku_rev2_loc0.xml dut-power -t 3 // normal output Change-Id: I3e49068a7b0f3e8908fbcce6a13e083ce8e9216a Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594689 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* stats_manager: add export to b/ friendly .mdRuben Rodriguez Buchillon2020-12-071-18/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change in addition to our copy/paste friendly textfile also outputs a buganizer markdown friendly .md summary of the results, to paste into bugs. BUG=b:174800621 BRANCH=None TEST=dut-power -t 3 Storing .md summaries at: [...]/S?_20201204-104756/onboard_summary.md cat [...]/S?_20201204-104756/onboard_summary.md **Onboard INA** |NAME|COUNT|MEAN|STDDEV|MAX|MIN| |-|-:|-:|-:|-:|-:| |LCD_BL_VOUT_mw|3|0.00|0.00|0.00|0.00| |PP1200_BRIJ_mw|3|0.00|0.00|0.00|0.00| |PP1200_TCPC_C0_mw|3|0.00|0.00|0.00|0.00| |PP1800_EC_mw|3|0.00|0.00|0.00|0.00| |PP1800_SENSORS_mw|3|0.00|0.00|0.00|0.00| |PP1800_VR_mw|3|0.00|0.00|0.00|0.00| |PP3300_A_R_mw|3|0.00|0.00|0.00|0.00| |PP3300_EC_STBY_mw|3|0.00|0.00|0.00|0.00| |PP3300_EC_mw|3|0.00|0.00|0.00|0.00| |PP3300_H1_mw|3|0.00|0.00|0.00|0.00| |PP3300_HUB_mw|3|0.00|0.00|0.00|0.00| |PP3300_PD_A_mw|3|0.00|0.00|0.00|0.00| |PP3300_PD_EC_mw|3|0.00|0.00|0.00|0.00| |PP3300_TCPC_C0_mw|3|0.00|0.00|0.00|0.00| |PP5000_A_mw|3|0.00|0.00|0.00|0.00| |PPVAR_BAT_R_mw|3|0.00|0.00|0.00|0.00| |PPVAR_BAT_mw|3|0.00|0.00|0.00|0.00| TEST=pytest stats_manager_unittest.py 21 passed TEST=python2 -m py.test stats_manager_unittest.py 21 passed Change-Id: I94e2d00721e744614838992604cd7a3124c0e39f Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573736 Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
* usb_power: Migrate convert_servo_ina.py to python2/3 compatibleYilin Yang2020-09-251-4/+6
| | | | | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=` python2 convert_servo_ina.py kevin_r0_loc.py` can produce the same output as before TEST=` python3 convert_servo_ina.py kevin_r0_loc.py` can produce the same output as before Signed-off-by: kerker <kerker@chromium.org> Change-Id: Ieb162902cb00b3ece5d70921ed806ba204136221 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422065 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* usb_power: Migrate convert_power_log_board.py to python2/3 compatibleYilin Yang2020-09-251-6/+9
| | | | | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`python3 convert_power_log_board.py board/kevin/kevin.board` can produce the same output as before TEST=`python2 convert_power_log_board.py board/kevin/kevin.board` can produce the same output as before Signed-off-by: kerker <kerker@chromium.org> Change-Id: I681c4ff2d7c98ad25f516982a5bc4ebb1b8caee4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422064 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* usb_power: Migrate powerlog.py to python2/3 compatibleYilin Yang2020-09-241-5/+7
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`python3 powerlog_unittest.py` pass TEST=`python2 powerlog_unittest.py` pass Signed-off-by: kerker <kerker@chromium.org> Change-Id: I8507a1a5dd4ad06c6311a7d9259a23b8a6377f6a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422063 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* usb_power: Migrate stats_manager.py to python2/3 compatibleYilin Yang2020-09-241-7/+9
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`python3 stats_manager_unittest.py` pass TEST=`python2 stats_manager_unittest.py` pass Signed-off-by: kerker <kerker@chromium.org> Change-Id: I4414eb99519ae43b1d94cebaea849a9b98beeb5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422062 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* ec: change usage of dummySam Hurst2020-08-051-13/+13
| | | | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the term "dummy" with inclusive alternatives. BUG=b:162781382 BRANCH=None TEST=make -j buildall `grep -ir dummy *` The only results are in "private/nordic_keyboard/sdk8.0.0" which is not our code. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I6a42183d998e4db4bb61625f962867fda10722e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335737 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* powerlog: fix "SusbError is not defined"David Herrig2020-07-311-1/+1
| | | | | | | | | | | | | | | | SusbError is not defined in powerlog.py This change raises Exception type instead. BUG=none BRANCH=none TEST=powerlog [..] -A=garbage => raises Exception: ('Power', 'USB device(garbage) not found') Change-Id: I8167a50796fec81f0fdf84d58e2e565f574c4f51 Signed-off-by: David Herrig <dherrig@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2324868 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Mengqi Guo <mqg@chromium.org>
* Unify #! use in python scriptsStefan Reinauer2019-10-013-3/+3
| | | | | | | | | | | | | | | | | | Right now we have several different versions of #! in our python scripts. Unify them all and specify that we are using python2. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BUG=none BRANCH=none TEST=make buildall Change-Id: Iab33a3f5d4b827451a55542bcee8837b00da7867 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1817948 Commit-Queue: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ec-devutils: update for pyusb-1.0.2Nick Sanders2019-05-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pyusb 1.0.2 changed two API calls upon which we depend: b3ee6cdfef8f find function returns an iterator. dac78933f6a6 Removed unnecessary length argument to util.get_string This CL only updates callers of these APIs (the previous CL contained some unrelated changes around kernel driver detach and closing stm32usb). Signed-off-by: Nick Sanders <nsanders@chromium.org> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Based-on: https://chromium-review.googlesource.com/1125354 BRANCH=None BUG=chromium:958677 TEST=precq passes TEST=chromiumos-sdk tryjob buildbucketId=8915374561970847360 TEST=using servo v2 servod -b grunt => no python exceptions when starting servod TEST=using servo v4 servod -b grunt => no python exceptions when starting servod TEST=using u-Servo: servod -b grunt => no python exceptions when starting servod for i in {1..10000} ; do echo $i $(dut-control ec_uart_en spi1_buf_en ); done => No stability regression versus pyusb-1.0.0b1 TEST=servo_updater, EC console via servo Cq-Depend: chromium:1597548,chromium:1597156,chromium:1597157 Change-Id: Ic8101707838e5d19e901cf1f7125b97b5102f089 Reviewed-on: https://chromium-review.googlesource.com/1597156 Commit-Ready: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
* powerlog: Don't hijack logger when import as modulePuthikorn Voravootivat2019-01-291-5/+7
| | | | | | | | | | | BRANCH=master BUG=b:112865585,b:123259683 TEST=No log spam when import as module from autotest Change-Id: I7ced102bbb893bc1baa88c625b8c7279a1e32677 Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1437515 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* sweetberry: format README, clarify detailsMengqi Guo2018-08-111-92/+138
| | | | | | | | | | | | | | Changing powerlog.README.md(orginally board.README) format to md. Adding details, making clarifications. BRANCH=None BUG=b:111318462 TEST=None Change-Id: Ic617d3da9518708560501be2786031dbd432ffe4 Signed-off-by: Mengqi Guo <mqg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1171503 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* Sweetberry: rename board.README to powerlog.README.mdMengqi Guo2018-08-101-0/+0
| | | | | | | | | | | | | | This CL only changes the file name. Next CL changes the file content. Separating into 2 CLs for easier diff. BRANCH=None BUG=b:111318462 TEST=None Change-Id: I8f8044e97b718270eb477dc29ba7e9e2c419db8c Signed-off-by: Mengqi Guo <mqg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1171599 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* stats_manager: more informative nan summary outputRuben Rodriguez Buchillon2018-08-012-1/+39
| | | | | | | | | | | | | | | | | Now for the formatted output string, if any value a domain is NaN, the domains gets tagged with a * and a help text gets added at the end of the summary to highlight this issue. CQ-DEPEND=CL:1140025 BRANCH=None BUG=chromium:806146, chromium:760267 TEST=unit tests added & pass Change-Id: I30791053bb1645065fa2bfd8305cc840a4a88031 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1140032 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* stats_manager: accept_nan supportRuben Rodriguez Buchillon2018-08-012-16/+45
| | | | | | | | | | | | | | | | | | This CL introduces a flag to StatsManager that allows for 'NaN' values to be recorded inside StatsManager. The motivation here is that if a sample fails to record it might be more desirable to record a 'NaN' than to just skip the sample, to keep timelines correct, and to not hide errors in the test-run. Also adds necessary tests for that behavior. BRANCH=None BUG=chromium:806146, chromium:760267 TEST=unit tests still pass Change-Id: If17b7f52ba4a05e9e007c73bfa5d667fe36b74b3 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1140031 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* stats_manager: add title banner pretty-printingRuben Rodriguez Buchillon2018-08-012-6/+33
| | | | | | | | | | | | | | If a title is supplied it now gets printed centralized on top of the summary when calling SummaryToString. BRANCH=None BUG=chromium:760267 TEST=unit tests are passing Change-Id: I7c59896ebac82d2ee7b632fd18350b9b4fff2c24 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1140030 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* stats_manager: Avoid losing dataRuben Rodriguez Buchillon2018-08-012-5/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the case of multiple StatsManager, we might get data clobbered. That's particularly bad on long-running tests. This CL introduces two methods to make sure output files are unique in a directory. (1) on init, the user can supply a StatsManagerID (smid) that will be prepended to all output files. E.g. if the smid is 'ec' the summary will be stored at ec_summary.txt (2) should that fail because multiple StatsManagers are using the same smid supplied (or none were supplied) a simple file rotation is done where an integer suffix keeps getting incremented until the filename is unique. E.g. if summary.txt already exists, then summary1.txt will be created. This is not threadsafe at all so the user still have to use some caution to avoid clobbering their own data. BRANCH=None BUG=chromium:760267 TEST=unit tests still all pass Change-Id: I6cc083259362ee20e0242b94ac7cbb1228a06a7a Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1140029 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* stats_manager: StatsManager returns file save locationsRuben Rodriguez Buchillon2018-08-012-19/+48
| | | | | | | | | | | | | | | | | Some test code currently duplicates knowledge by telling StatsManager where to save a file and then having to figure out where it stored the files again. This CL has StatsManager return the save locations to simplfy code. This potentially allows for informative logging on where information was stored. BRANCH=None BUG=chromium:760267 TEST=unit tests still pass Change-Id: I54b5873a4a3ddade9a73da0792c1947445759ad4 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1140028 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* stats_manager: replace prefixes with flags in StatsManagerRuben Rodriguez Buchillon2018-07-313-51/+79
| | | | | | | | | | | | | | | | | | | | | | | | | StatsManager right now uses a '__' prefix to indicate that sample_msecs should be the first key in the summary. Additionally, there is a NOSHOW_PREFIX to potentially hide rails in the summary. This CL replaces that approach with constructor arguments to feed into the StatsManager what rails to hide, and the order to print a summary. This results in cleaner code, and less information leakage across classes as hiding & sorting becomes an implementation detail. It also adds two new unit tests to StatsManagerTest to verify this behavior works as intended. As a nit this CL also replaces AddValue with AddSample as Sample is more descriptive for the use-cases. BRANCH=None BUG=chromium:760267 TEST=manual testing, same output as before, and unittests still pass Change-Id: I52ca0d85c4600691fce8d4c74fd2a81fc4aa440f Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1140027 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* stats_manager: remove expliting printing from stats_managerRuben Rodriguez Buchillon2018-07-313-62/+64
| | | | | | | | | | | | | | | | | | StatsManager is a library shared across some modules. It shouldn't print anything itself, but rather use logging & return a formatted summary that can be printed. Also take this opportunity to replace majority of explicit print calls in powerlog with logger module. BRANCH=None BUG=chromium:760267 TEST=manual testing, output as expected still for powerlog Change-Id: I0ed2ccaa45bbd1261119a1446110beadb075c1a2 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1140026 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* stats_manager: prepare StatsManager to be a utility used in hdctoolsRuben Rodriguez Buchillon2018-07-274-34/+207
| | | | | | | | | | | | | | | | | | This is the first CL in a series of CLs to start using StatsManager in servo/hdctools (package depends on ec-devutils, as in this package). This CL: - beefs up StatsManager to handle unavailable units more gracefully - adds a few more tests to stats_manager_unittest.py - adds some minor unit testing for powerlog's file retrieval logic BRANCH=None BUG=chromium:760267 TEST=manual testing, unit tests still pass, powerlog still works Change-Id: Ifcdfcc482008484fbc21326c6f087ebf466c3e74 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1140025 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* Revert "ec-devutils: update pyusb to 1.0.2"Nick Sanders2018-07-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7d26ae49bffcf269df82df7d0fee00e8c3341166. pyusb 1.0.2 fails under load and locks up the usb endpoint. BUG=b:111658037, chromium:865482 TEST=while RES=$(dut-control ec_uart_en spi1_buf_en ); do echo ${RES}; done CQ-DEPEND=CL:1149509 Original change's description: > ec-devutils: update pyusb to 1.0.2 > > Pyusb interface has changed yet again. Patch calls to get_string > and usb.core.find. Modify ordering of detetch kernel driver > and avoid rereferencing endpoints. > > BRANCH=None > BUG=b:110907544 > TEST=emerge ec-devutils, run powerlog, usb_console, servo_updater > > CQ-DEPEND=CL:1119632 > > Signed-off-by: Nick Sanders <nsanders@chromium.org> > > Change-Id: I33df474ce3bb57d2e11c9f384ac013b51d210843 > Reviewed-on: https://chromium-review.googlesource.com/1125354 > Commit-Ready: Nick Sanders <nsanders@chromium.org> > Tested-by: Nick Sanders <nsanders@chromium.org> > Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Bug: b:110907544 Change-Id: I04f015b4924e7fee76ab0f1734267e8e2d14faaa Reviewed-on: https://chromium-review.googlesource.com/1150963 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* ec-devutils: update pyusb to 1.0.2Nick Sanders2018-07-061-1/+2
| | | | | | | | | | | | | | | | | | | | Pyusb interface has changed yet again. Patch calls to get_string and usb.core.find. Modify ordering of detetch kernel driver and avoid rereferencing endpoints. BRANCH=None BUG=b:110907544 TEST=emerge ec-devutils, run powerlog, usb_console, servo_updater CQ-DEPEND=CL:1119632 Signed-off-by: Nick Sanders <nsanders@chromium.org> Change-Id: I33df474ce3bb57d2e11c9f384ac013b51d210843 Reviewed-on: https://chromium-review.googlesource.com/1125354 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* kevin/gru: remove board almost completelyJett Rink2018-06-211-5/+5
| | | | | | | | | | | | | | | | Kevin/Gru are running out of space and we already have another ARM board on ToT for development. Remove maintenance burden of keeping them around. BRANCH=none BUG=chromium:851512 TEST=build_packages --board=kevin works with dependent CLs. CQ-DEPEND=CL:1102565,CL:*640973,CL:*640974 Change-Id: Ie7c65c7799acc9f4d266e40b29b37240fec345c6 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1100011 Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Script to convert board file to servod config .py file.Ravi Chandra Sadineni2018-06-191-0/+85
| | | | | | | | | | | | | Script to convert .board file (input to powerlog.py) into .py file which can be used to generate .xml configuration file for servod. BUG=none BRANCH=none TEST= convert a .board file to .py file and verify it works. Change-Id: Ia67d1552c048895efee10d7a92830cfa25a51984 Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1105479 Reviewed-by: Puthikorn Voravootivat <puthik@google.com>
* powerlog: allow port & addr in the .board fileRuben Rodriguez Buchillon2018-05-101-2/+6
| | | | | | | | | | | | | | | | | Allow board & addr in the board file instead of channel, to make board file creation and configuration simpler. This is part of the efforts in the BUG to make sweetberry under chrome os simpler to use. In that case, we allow now (with crrev.com/c/1051215) to generate .board files using explicit pin and bank numbers (j2,j3,j4). BRANCH=None BUG=chromium:806148 TEST=manual test, works fine. Change-Id: I6fd3bb1a4a5ffffee08b81625ecb190adceeb2e7 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1051212 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* sweetberry: Make resetting USB interface more forgivingPuthikorn Voravootivat2018-05-031-9/+9
| | | | | | | | | | | | | | | | Currently, sweetberry ocassionally throws Exception when resetting the USB interface. This CL mitigates that by - Use linearly back off algorithm with 10ms delay increment before next reset attempt to avoid flooding the sweetberry hardware with reset requests. - Increase retry amount from 10 to 100 BUG=chromium:834252 TEST=No "Exception: ('Power', 'Failed to reset')" seen Change-Id: Iaf039cb82760205d1747fd630387852b7cfd8f83 Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1038788
* sweetberry: fix stats_manager and refactorMengqi Guo2018-04-274-41/+149
| | | | | | | | | | | | | | | | | | | | | | This CL updates stats_manager to match the new functionalities in powerlog.py and refactors powerlog.py to more easily find config files and print timestamps in seconds since epoch. The unit test for stats_manager is also updated accordingly. BUG=b:72973433 BRANCH=None TEST=powerlog -b nami_rev0_loc.board -c nami_rev0_loc.scenario \ --print_stats --save_stats /tmp --save_stats_json /tmp \ --save_raw_data /tmp --mW and looking at the printed data python -m unittest stats_manager_unittest CQ-DEPEND=CL:1003522 Change-Id: Ic6e4aadfcd3ad245572788094ee3d3a30106044c Signed-off-by: Mengqi Guo <mqg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1002546 Reviewed-by: Todd Broch <tbroch@chromium.org>
* sweetberry: add current and voltage loggingNick Sanders2018-03-284-27/+112
| | | | | | | | | | | | | | | | | | | | | This adds a config to specify whether sweetberry should measure power, current, voltage per powerlog entry. The json format is slightly revised to allow data type per channel. powerlog and sweetberry fw are updated to handle the new functionality. BUG=b:72973433 BRANCH=None TEST=./powerlog.py -b marlin.board -c marlin_a.scenario -s .5 Signed-off-by: Nick Sanders <nsanders@chromium.org> Change-Id: I231fc6600495146fad30583872bf14c660d5a50b Reviewed-on: https://chromium-review.googlesource.com/905427 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Mengqi Guo <mqg@chromium.org>
* sweetberry: add microsecond to sweetberry timestampMengqi Guo2017-12-071-1/+1
| | | | | | | | | | | | | | | | | | This CL adds microsecond to sweetberry timestamp, for more accuracy in timing sweetberry runs. This CL is part of the effort to start sweetberry measurements while running power autotests. BRANCH=None BUG=b:68956240 TEST=./powerlog.py -b xxx.board -c xxx.scenario \ --save_stats_json [directory to store it] Change-Id: I68c40d5be6d684205b49428c4e5cb6e69af6dfdf Signed-off-by: Mengqi Guo <mqg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/812502 Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
* sweetberry: print MEAN in json formatMengqi Guo2017-12-054-13/+75
| | | | | | | | | | | | | | | | | | | | | | | | This CL adds the flag --save_stats_json which prints the MEAN of sweetberry readings into json format. Corresponding unit test has been added too. Printing just the MEAN in json format makes it easier to read it back in power_telemetry_logger, which uploads the stats to the dashboard. This CL is part of the effort to start sweetberry measurements while running power autotests. BRANCH=None BUG=b:68956240 TEST=./powerlog.py -b xxx.board -c xxx.scenario \ --save_stats_json [directory to store it] python -m unittest -v stats_manager_unittest Change-Id: I8274bcac21175f6c53184ced79b6ffe5e7d7a72a Signed-off-by: Mengqi Guo <mqg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/807636 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
* sweetberry: save to specified directoryMengqi Guo2017-11-092-46/+105
| | | | | | | | | | | | | | | | | | | | | | This CL modifies the 2 flags --save_stats and --save_raw_data so that they can take arguments to save the corresponding file into directories that we specify. It also provides a new flag --no_print_raw_data to suppress printing sweetberry readings in real time. This CL is part of the effort to start sweetberry measurements while running power autotests. BRANCH=None BUG=b:68956240 TEST=./powerlog.py -b xxx.board -c xxx.scenario \ --save_stats ./xxx --save_raw_data ./xxx --no_print_raw_data Change-Id: I01ebeafc5f4eebd0a77746e9968367f267e93d83 Signed-off-by: Mengqi Guo <mqg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/756255 Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
* sweetberry: adding a flag to print milliwattsMengqi Guo2017-09-291-5/+13
| | | | | | | | | | | | | | | | | | Adding a flag to print power numbers in milliwatts instead of microwatts, to be the same as servo ina board. This will make it easier for power team to keep track of power numbers in the future. BRANCH=None BUG=b:35578707 TEST=./powerlog.py -b xxx.board -c xxx.scenario --mW python -m unittest -v stats_manager_unittest Change-Id: I397da26561324227682404e62ee025384e7624eb Signed-off-by: Mengqi Guo <mqg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/688743 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
* sweetberry: calculate statistics for sweetberry readingsMengqi Guo2017-09-294-27/+278
| | | | | | | | | | | | | | | | | | | This CL provides the tool to calculate statistics for sweetberry readings and present them in a clear & easy to read format. It also provides the flag to store raw data and statistics summary, should the need arise. There are also some code cleanup for powerlog.py. BRANCH=None BUG=b:35578707 TEST=./powerlog.py -b xxx.board -c xxx.scenario --print_stats \ --save_stats --save_raw_data python -m unittest -v stats_manager_unittest Change-Id: I4aa732756fe6512f37acfcb59b11d950101887d7 Signed-off-by: Mengqi Guo <mqg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/667241 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* sweetberry: converter tool for servo_inaNick Sanders2017-08-282-0/+86
| | | | | | | | | | | | | convert_servo_ina.py can convert power log config files from hdctools/servo/data into sweetberry configs BRANCH=None BUG=b:35578707 TEST=compare kevin_r0_loc.py output with kevin.board Change-Id: Iadc57fe4eb1f5b220c6bffe3a3fe8a10b0d6b5a2 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/634486
* sweetberry: modify powerlog.py to support multiple devicesNick Sanders2017-08-221-49/+189
| | | | | | | | | | | | | | | | | powerlog.py can now take -A serialA -B serialB to collect data from both left and right sweetberries simultaneously. Also, the Spower class has been modified to allow API usage rather than console only usage. BRANCH=None BUG=chromium:608039 TEST=log from both sweetberries on marlin Signed-off-by: Nick Sanders <nsanders@chromium.org> Change-Id: Iaeaddad223f35f0e5cad1549b85fa3f7e4d5e1c7 Reviewed-on: https://chromium-review.googlesource.com/422496 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* sweetberry: add power logging toolNick Sanders2016-12-1610-0/+803
powerlog.py can access sweetberry and log power data. Also included are marlin and kevin example board configs. BUG=chromium:608039 TEST=log power data BRANCH=None Change-Id: I0f868d95d17d86522dca045a227a824563f93cd0 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/413293 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>