]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa.buildperf: measure apparent size instead of real disk usage
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 5 Oct 2016 13:29:49 +0000 (16:29 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 5 Oct 2016 13:38:24 +0000 (14:38 +0100)
This change aligns disk usage measurements of the eSDK test with the old
build-perf-test.sh script. And thus, also makes the results between the
old and the new script comparable.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/buildperf/base.py
meta/lib/oeqa/buildperf/test_basic.py

index 2c102554b9fd5d358277588ba089e47388b6e050..59dd02521c9c2a4d054aa937e5896cf3e1c498d5 100644 (file)
@@ -408,9 +408,14 @@ class BuildPerfTestCase(unittest.TestCase):
                                                       int((e_sec % 3600) / 60),
                                                        e_sec % 60))
 
-    def measure_disk_usage(self, path, name, legend):
+    def measure_disk_usage(self, path, name, legend, apparent_size=False):
         """Estimate disk usage of a file or directory"""
-        ret = runCmd2(['du', '-s', path])
+        cmd = ['du', '-s', '--block-size', '1024']
+        if apparent_size:
+            cmd.append('--apparent-size')
+        cmd.append(path)
+
+        ret = runCmd2(cmd)
         size = int(ret.output.split()[0])
         log.debug("Size of %s path is %s", path, size)
         measurement = {'type': self.DISKUSAGE,
index e448ed18c90af50baea357de9f8a3dba2d2e0755..7a48c1e77fb96d182f9e3fac5ef8f92867218bde 100644 (file)
@@ -114,7 +114,8 @@ class Test4(BuildPerfTestCase):
             self.bb_vars['SDK_DEPLOY'],
             self.bb_vars['TOOLCHAINEXT_OUTPUTNAME'] + '.sh')
         # Measure installer size
-        self.measure_disk_usage(installer, 'installer_bin', 'eSDK installer')
+        self.measure_disk_usage(installer, 'installer_bin', 'eSDK installer',
+                                apparent_size=True)
         # Measure deployment time and deployed size
         deploy_dir = os.path.join(tmp_dir, 'esdk-deploy')
         if os.path.exists(deploy_dir):
@@ -122,4 +123,5 @@ class Test4(BuildPerfTestCase):
         self.sync()
         self.measure_cmd_resources([installer, '-y', '-d', deploy_dir],
                                    'deploy', 'eSDK deploy')
-        self.measure_disk_usage(deploy_dir, 'deploy_dir', 'deploy dir')
+        self.measure_disk_usage(deploy_dir, 'deploy_dir', 'deploy dir',
+                                apparent_size=True)