aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/buildperf/base.py
AgeCommit message (Collapse)Author
2016-09-06oeqa.buildperf: correct globalres time formatMarkus Lehtonen
Always use two digits for (integer part of) seconds, i.e. show '1:02.34' instead of '1:2.34'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: include commands log file name in results.jsonMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: include buildstats file name in results.jsonMarkus Lehtonen
No need to do lsdir magic for finding buildstats when reading results. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: show skipped tests in results, tooMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: convert buildstats into json formatMarkus Lehtonen
Instead of archiving buildstats in raw text file format convert all buildstats into one json-formatted file. Some redundant information, i.e. 'Event:', 'utime:', 'stime:', 'cutime:' and 'cstime:' fields, are dropped. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: measure io statMarkus Lehtonen
Add data from /proc/<pid>/io to system resource measurements. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: don't use Gnu timeMarkus Lehtonen
Use Python standard library functionality instead of the time utility for measuring elapsed (wall clock) time of commands. The time.* log files are also ditched. However, the same detailed resource usage data, previously found in time.* logs is now provided in results.json file. This data is collected through the resource module of Python. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: rename buildstats directoriesMarkus Lehtonen
Change directory name from 'buildstats-<test_name>' to just 'buildstats'. However, this patch adds the possibility to label buildstats directory name with a postfix which makes it possible to save multiple buildstats per test, for example. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: separate output dir for each testMarkus Lehtonen
Store the output data of each test in an individual subdirectory instead of storing everything in the root output directory. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: strip date from buildstats directory pathMarkus Lehtonen
Archive buildstats in a directory like 'buildstats' instead of something like 'buildstats/20160513120000'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: enable json-formatted resultsMarkus Lehtonen
Automatically create a json.formatted file (results.json) in the results directory that contains results from all tests. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: add 'product' to test result dataMarkus Lehtonen
This defaults to 'oe-core' but can be defined using the OE_BUILDPERF_PRODUCT environment variable. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: treat failed measurements as errorsMarkus Lehtonen
Now failed measurements correctly cause a test failure (recorded as an error). There should be no need to continue the test if one step fails, especially now that the tests don't depend on each other. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: make tests independentMarkus Lehtonen
Add test set-up functionality so that the individual tests do not depend on each other. This should make sure that a failure in one test does not affect the results of another test. The patch also makes it reasonable to run only a subset of the tests by using the --run-tests option. The increase in total execution time of the full suite - caused by the additional set-up steps - is insignificant because normally no additional tasks need to be run. The previous test has already done all set-up work. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03oeqa.buildperf: fix checking of invalid resultsMarkus Lehtonen
The test status check done when writing globalres log was incorrect. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-25oe-build-perf-test: add {git_commit_count} keyword for --commit-results-tagMarkus Lehtonen
Makes it possible to create easily sortable tags. Also, the default tag format is updated to use the new keyword. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oeqa.buildperf: add git commit count to result dataMarkus Lehtonen
This number represents the number of commits since the beginning of git history until the tested revision. This helps e.g. in ordering results. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oe-build-perf-test: new {tag_num} keyword for --commit-results-tagMarkus Lehtonen
This makes it possible to create numbered tags, where the "basename" of the tag is the same and the only difference is an (automatically) increasing index number. This is useful if you do multiple test runs on the same commit. For example, using: --commit-results-tag {tester_host}/{git_commit}/{tag_num} would give you tags something like: myhost/decb3119dffd3fd38b800bebc1e510f9217a152e/0 myhost/decb3119dffd3fd38b800bebc1e510f9217a152e/1 ... The default tag format is updated to use this new keyword in order to prevent unintentional tag name clashes. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oe-build-perf-test: tag results committed to GitMarkus Lehtonen
Create a Git tag when committing results to a Git repository. This patch also implements --commit-results-tag command line option for controlling the tag name. The value is a format string where the following fields may be used: - {git_branch} - target branch being tested - {git_commit} - target commit being tested - {tester_host} - hostname of the tester machine Tagging can be disabled by giving an empty string to --commit-results-tag. The option has no effect if --commit-results is not defined. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oe-build-perf-test: implement --commit-results-branchMarkus Lehtonen
A new command line option for defining the branch where results are commited. The value is actually a format string accepting two field names: - {git_branch} expands to the name of the target branch being tested - {tester_host} expands to the hostname of the tester machine The option has no effect if --commit-results is not used. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oe-build-perf-test: support committing results data to GitMarkus Lehtonen
Implement a new command line option '--commit-results' which commits the test results data into a Git repository. The given path must be an existing initialized local Git repository. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oeqa.buildperf: use term commit instead of revisionMarkus Lehtonen
This is basically a internal change, at this point. Term 'commit' better represents the data we actually have. Term 'revision' is more vague and could be understood to point to a tag object, for example. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oeqa.utils.git: implement GitRepo.get_current_branch()Markus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oeqa.utils.git: introduce GitRepo.rev_parse()Markus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-20oeqa.buildperf: fix crash when creating globalres.logMarkus Lehtonen
Fix a bug that was introduced when converting to unittest framework. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17oeqa.buildperf: use oe.path.remove()Markus Lehtonen
Drop the self-baked force_rm() method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-17oeqa.buildperf: be more verbose about failed commandsMarkus Lehtonen
Log failures of commands whose output is stored. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-17oeqa.buildperf: introduce runCmd2()Markus Lehtonen
Special runCmd() for build perf tests which doesn't raise an AssertionError when the command fails. This causes command failures to be detected as test errors instead of test failures. This way "failed" state of tests is reserved for future making it possible to set e.g. thresholds for certain measurement results. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-17oeqa.buildperf: add BuildPerfTestResult classMarkus Lehtonen
The new class is derived from unittest.TextTestResult class. It is actually implemented by modifying the old BuildPerfTestRunner class which, in turn, is replaced by a totally new simple implementation derived from unittest.TestRunner. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-17oeqa.buildperf: add BuildPerfTestLoader classMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-17oeqa.buildperf: derive BuildPerfTestCase class from unitest.TestCaseMarkus Lehtonen
Rename BuildPerfTest to BuildPerfTestCase and convert it to be derived from TestCase class from the unittest framework of the Python standard library. This doesn't work with our existing testcases or test runner class and these need to be modified, too. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-17buildperf: Add support for times without decimal partJose Perez Carranza
Add logic for the cases when the time retrieved does not have decimal part. Signed-off-by: Jose Perez Carranza <jose.perez.carranza@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oe-build-perf-test: implement --globalres-file optionMarkus Lehtonen
Using this option the script appends test results into a 'global results file'. A CSV-formatted output of the results. This option is to provide compatibility with the old build-perf-test.sh. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: add git revision and branch to result dataMarkus Lehtonen
BuildPerfTestRunner determines these from the Git repository under which it is being run (i.e. where the build directory exists). The branch and revision may be defined/overridden with OE_BUILDPERFTEST_GIT_BRANCH and OE_BUILDPERFTEST_GIT_BRANCH environment variables, if needed. This makes it possible to run the build performance test script even if the top directory is not a git repository clone, for example. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: archive build/conf into test resultsMarkus Lehtonen
Have the build/conf directory as part of test results. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: implement BuildPerfTestRunner classMarkus Lehtonen
The new class is responsible for actually running the tests and processing their results. This commit also adds a decorator function for adding new tests. No automatic test discovery, at least yet. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: add method for saving buildstatsMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: add method for measuring file disk usageMarkus Lehtonen
Add a new method to BuildPerfTest class for measuring the disk usage of a file of directory. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: add method to log shell commandsMarkus Lehtonen
Add new methods to BuildPerfTest class for running a shell command and logging its output. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: method for measuring system resource usageMarkus Lehtonen
Extend BuildPerfTest class with a new method for measuring the system resource usage of a shell command to BuildPerfTest class. For now, easurement of the elapsed time is done with the Gnu time utility, similarly to the build-perf-test.sh shell script. And, it currently only records the elapsed (wall clock). The measured values (currently, only the elapsed time) is actually a dictionary, making it possible to extend it with additional resource values, e.g. cpu time or i/o usage, in the future. In addition to the actual values of the measurement each record contains a 'name' and 'legend' where name is supposed to function as a common key or id over test runs, making comparison and trending easier, for example. Legend is supposed to be a short human readable description. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: add BuildPerfTest classMarkus Lehtonen
The new class will be used as an abstract base class for build performance tests. This implementation contains some common functionality used in multiple tests, "copied" from the build-perf-test.sh shell script. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.buildperf: functionality to drop kernel cachesMarkus Lehtonen
Add a new utility class for dropping Linux kernel caches. It uses sudo and tee to write to the drop_caches file. Checking if the user has the permissions to drop caches (without a password) is done by trying to writing an invalid value to the drop_caches file. This way, we will find if writing (with tee) is possible but not really dropping caches, yet. User can avoid giving the password by adding something like: <user> ALL = NOPASSWD: /usr/bin/tee /proc/sys/vm/drop_caches to the system sudoers file. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>