aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-10-09target: Install busybox before updating modulesBrendan Jackman
Due to the new read_tree_values API, some devlib modules now use shutils in their __init__, which happens from Target::connect(). Therefore ensure we have busybox on the target before we get to that stage.
2017-10-06utils/ssh: fix Gem5Connection.pullSergei Trofimov
Gem5Connection lists the path to be pulled, however it was not stripping ANSI escape sequences from resulting output, which would corrupt the path.
2017-10-06utils/misc: strip more with strip_bash_colorsSergei Trofimov
Update regex used by strip_bash_colors to match more ANSI escape sequencies.
2017-10-06read_tree_values: more robust parsing.Sergei Trofimov
Skip entries not containing a ":".
2017-10-05Merge pull request #183 from setrofim/mastersetrofim
shuilt: re-introduce speedup
2017-10-05shuilt: re-introduce speedupSergei Trofimov
The previous fix for read_tree_values fixed the issue with sh not supporting arrays, but looping over paths and counting them. Hover each count increment requires spawning a subshell. For a large number of paths, this can eat away any performance benefits of using read_tree_values. Since we only care whether the count is greater than one, detect that and break out of the loop early to re-introduce the performance improvement.
2017-10-05Merge pull request #182 from setrofim/mastersetrofim
shutil: fix read_tree_values and hotplug_online_all for sh
2017-10-05shutil: fix read_tree_values and hotplug_online_all for shSergei Trofimov
read_tree_values and hotplug_online_all relied on () array evaluation which is a Bash thing and is broken in sh; this fixes things for sh.
2017-10-05shutils: fix read_tree_valuesSergei Trofimov
My bash fu was off on my previous list. The output of find was being treated as a single string, rather than an array of paths; which ment that the test that there was more than one path returned failed, resulting in null output not just for empty directories but for everyting. This fixes the issue by converting find output to an array.
2017-10-05Target: fix read_tree_values for empty dirSergei Trofimov
grep was existing with 1 when passed an empty directory, resulting in TargetError being raised unless explicitly suppressed with check_exit_code=False. This case is now fixed to correctly return an empty dict without error. read_tree_values bash function has also been optimized to not unnecessarily run find in a subshell if the path passed to the function does not exist.
2017-10-04Merge pull request #181 from setrofim/mastersetrofim
Module initialization optimizations.
2017-10-04module/hotplug: optimize online_allSergei Trofimov
Optimize online_all by offloading it to a shutils function which only requres a single call to the target.
2017-10-04module/cpuidle: optimize initialization.Sergei Trofimov
Optimize cpuidle module initialization by using the new Target.grep_values call to get information about all idle states in a single call to the target during module intialization, rather lazily fetching them from the target afterwards.
2017-10-04module/hwmon: optimize initialization.Sergei Trofimov
Optimize hwmon module initialization by using the new Target.grep_values call to get information about all HWMON devices in a single call to the target.
2017-10-04Target: add read_tree_values and read_tree_values_flatSergei Trofimov
Add two new methods to target that allow querying values of all sysfs nodes in a sub-directory structure all at once. The difference is that read_tree_values_flat returns a flat dict of path->value mappings; read_tree_values returns a nested dict structure that mimics the scanned sub-directories tree.
2017-10-04module: nicer logger nameSergei Trofimov
Use Module.name rather than Module.__name__ to name the logger for slightly more readable log output.
2017-10-04Target: ensure shutils is always setSergei Trofimov
Make sure shutils is always set, even if setup() has not been called by initializing it on first access if necessary.
2017-10-03Snap for 4373608 from 865cf9598537f5a405e8ada5ffed91daae9ac414 to pi-releaseandroid-build-team Robot
Change-Id: I0be21aa121f715464c395246dd05d9ff4ea1a9e1
2017-10-02utils/android_build: Remove methods to build kernelSuren Baghdasaryan
Kernel build process will be described in an external script referenced from board config file. Change-Id: Ied74824996a4121cdfded55b283e196e8193c6bc Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2017-10-02Merge pull request #177 from bjackman/hwmon-no-permissionssetrofim
hwmon: Disable if no permissions
2017-09-29Merge pull request #179 from setrofim/fpssetrofim
Add FPS derived metrics
2017-09-27gfxinfo fixesSergei Trofimov
- Make sure timestamps are actually reported in microseconds. - Eliminate duplicate entries from successive dumps
2017-09-27derived: add DerivedSurfaceFlingerStatsSergei Trofimov
Add DerivedSurfaceFlingerStats that parse output from SurfaceFlingerFramesInstrument to produce FPS data and rendering statistics.
2017-09-27derived: add DerivedGfxInfoStatsSergei Trofimov
Add DerivedGfxInfoStats that parse output from GfxInfoFramesInstrument to produce FPS data and rendering statistics.
2017-09-27Merge pull request #178 from setrofim/mastersetrofim
Various fixes.
2017-09-27AndroidTarget: fix ps()Sergei Trofimov
ps() splits the output on whiestspace into fields; always expecting nine. In some cases, wchan field may be blank, resulting in only eight chunks after the split. Detect that case and insert and empty entry at the appropriate index.
2017-09-27AndroidTarget: fix get_pid_of for recent AndroidsSergei Trofimov
ps on recent Androids no longer takes an optional comm name; use Target.ps() instead, and filter by process name on the host.
2017-09-27utils/rendering: frame collectors should respect column orderSergei Trofimov
Previously FrameCollector.write_frames used "columns" argument only as a filter for which columns to write, but the order would always be the same as in raw output. The Instrument API requires that the column ordering in the resulting MeasurementsCsv matches the ordering of channels specified in reset() (if any). This means the collectors should respect the ordering specified in the "columns" parameter (which gets populated based on active channels).
2017-09-27utils/rendering: fix surfaceflinger listSergei Trofimov
SurfaceFlingerFrameCollector.list now converts line endings before splitting, so it now works when the endings are something other than "\r\n".
2017-09-21Merge pull request #176 from bjackman/logcat-docssetrofim
utils/anroid: Documentation for LogcatMonitor
2017-09-21hwmon: Disable if no permissionsBrendan Jackman
If we don't have permissions, scan() currently raises a TargetError. Instead we should return False from probe() so the module is disabled
2017-09-21utils/anroid: Documentation for LogcatMonitorBrendan Jackman
2017-09-20Merge pull request #175 from bjackman/logcat-racesetrofim
Fix race in LogcatMonitor
2017-09-20utils/android: Don't lock up if LogcatMonitor stopped before startBrendan Jackman
Calling stop before start will result in hanging in self._started.wait(), because that event will never get set. Although stop before start is an illegal usage pattern, let's try not to fail annoyingly.
2017-09-20utils/android: Fix race condition in LogcatMonitorBrendan Jackman
If you call .start then immediately call .stop, the thread may not yet have set ._logcat, resulting in an AttributeError. I initially fixed this by setting _logcat = None in __init__, then putting the `kill` calls inside `if self._logcat`. The problem with this, as pointed out by @valschneider, is that we can then have this sequence: main thread: monitor thread stop() run() if self._logcat: . # False, don't kill process . join() . self._logcat = <...> Therefore, just have the stop() method wait until the process is started before unconditionally killing it.
2017-09-20Merge pull request #174 from bjackman/adb-start-serversetrofim
utils/android: Start ADB server before listing devices
2017-09-20utils/android: whitespaceBrendan Jackman
2017-09-20utils/android: Start ADB server before listing devicesBrendan Jackman
Otherwise if the server isn't started we fail to parse the output of 'adb devices'
2017-09-19util/rendering: add gfxinfo_get_last_dumpSergei Trofimov
Add gfxinfo_get_last_dump utility function to get the last gfxinfo dump from a (potentially large) file containing a concatenation of such dumps (as in the raw output of the GfxinfoFrames instrument).
2017-09-19instrument: Update MeasurementType tableSergei Trofimov
- Add generic "count" and "percent" MeasurementType's. - Add "fps" MeasurementType. - Add "thermal" category for "termperature" - Add a comment describing each category
2017-09-19DerivedMeasurements: add process_raw() + doc updatesSergei Trofimov
- Add process_raw() method to the API. This is inteneded to be invoked on any raw output (i.e. not MeasurmentCsv) generated by an Instrument. - Both process() process_raw() are portional to be overriden by impolementation; the default behavior is to return an empty list. - The output specification for both is extened to allow MeasurementCsv's, as well as DerivedMetric's. - Documentation has been reworded for clarity.
2017-09-19derived: DerivedMeasurments now return DerivedMetricsSergei Trofimov
DerivedMeasurments processors now return DerviedMetrics rather than measurments. The notion of an InstrumentChannel doesn't really make sense in the context of DerivedMeasurments, which are not directly measured on the target. Since Measurement's require a channel, a simpler DerviedMetric is added that only requires a name and a type.
2017-09-19MeasurementCsv: various enhancementsSergei Trofimov
- Added values() and iter_values() methods. These return each row as a named tuple, with channel labels as the field names. - __cmp__ has been made more generic by checking wether other has "value" attribute, rather than wether it is an instance of Measurment. - MeasurementCsv no longer keeps an open handle to the file, and instead re-opens the file each time it needs it. This removes the need for managing the open handle, and alows parallel iterations over the values (each iteration will have it's own read handle into the files).
2017-09-19InstrumentChannel: allow None sitesSergei Trofimov
Allow site to be None (still must be explicitly specified). If the site is None, the label if created using only the measurement type.
2017-09-19InstrumentChannel: name is now an alias for labelSergei Trofimov
In addition to a label constructed form the combination of site and measurment type, channels had a name that was specified on creation. This proven to be not particularly useful (there only being one instance of the name being set to something materially different from the label); and this has lead to channels being inconsistenly referenced (some times a channel is identified by its label, and sometimes by the name). This commit removes the name from __init__ arguments, and InstrumentChannel.name is now an alias for InstrumentChannel.label.
2017-09-19instrument: add get_raw() APISergei Trofimov
Derived metrics may be calculated form data in raw output that is not present in the resulting MeasurementCSV. This adds a method to provide uniform access to raw artifacts generated by an instrument.
2017-09-19insturment: add catergory for time + doc fixSergei Trofimov
- Add a category name for time MeasurmentType's, as there are now multiple. - Fix the names of time_ms and time_us in the documentation.
2017-09-19utils/misc: update CPU_PART_MAP with MongooseSergei Trofimov
Add Samsung's Mongoose M1 core part identifiers to the map.
2017-09-19MeasurementsCsv: rename itermeasurmentsSergei Trofimov
Renamed to iter_measurments for readability.
2017-09-19derived: renamed derived_measurments --> energySergei Trofimov
Renamed to reduce redandancy in import path.