From patchwork Thu Jun 23 14:23:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 2215 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6601F23F6D for ; Thu, 23 Jun 2011 14:23:21 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 3736FA189BB for ; Thu, 23 Jun 2011 14:23:21 +0000 (UTC) Received: by mail-qw0-f52.google.com with SMTP id 8so1392733qwb.11 for ; Thu, 23 Jun 2011 07:23:21 -0700 (PDT) Received: by 10.229.40.139 with SMTP id k11mr1604949qce.135.1308838999787; Thu, 23 Jun 2011 07:23:19 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.230.139 with SMTP id jm11cs19227qcb; Thu, 23 Jun 2011 07:23:19 -0700 (PDT) Received: by 10.216.132.214 with SMTP id o64mr1944972wei.75.1308838996468; Thu, 23 Jun 2011 07:23:16 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id k24si3958553weq.21.2011.06.23.07.23.16; Thu, 23 Jun 2011 07:23:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QZkoN-0003mQ-CG for ; Thu, 23 Jun 2011 14:23:15 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 5B2502E8027 for ; Thu, 23 Jun 2011 14:23:15 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glcompbench X-Launchpad-Branch: ~glcompbench-dev/glcompbench/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 32 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glcompbench-dev/glcompbench/trunk] Rev 32: Replace --num-iters command line option with the 'iterations' and 'duration' test options. Message-Id: <20110623142315.3922.42482.launchpad@loganberry.canonical.com> Date: Thu, 23 Jun 2011 14:23:15 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13265"; Instance="initZopeless config overlay" X-Launchpad-Hash: 0ef6d967d716b809a37aa786515630071ed7018d ------------------------------------------------------------ revno: 32 committer: Alexandros Frantzis branch nick: trunk timestamp: Thu 2011-06-23 16:13:26 +0300 message: Replace --num-iters command line option with the 'iterations' and 'duration' test options. modified: src/composite-canvas.cc src/composite-canvas.h src/options.cc src/options.h --- lp:glcompbench https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk You are subscribed to branch lp:glcompbench. To unsubscribe from this branch go to https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk/+edit-subscription === modified file 'src/composite-canvas.cc' --- src/composite-canvas.cc 2011-06-23 08:54:28 +0000 +++ src/composite-canvas.cc 2011-06-23 13:13:26 +0000 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -454,7 +455,7 @@ // Each iteration is 3 seconds of compositing by the current test object. // When we complete an iteration, reset the count and tell the caller. - if (stats.total >= 3000.0) { + if (stats.total >= current_test_duration_) { Log::info("FPS: %"PRIu64"\n", stats.nsamples / 3); for (Profiler::Point p = 0; p < profiler.get_num_points(); p += 2) { @@ -466,7 +467,7 @@ profiler.reset(); ++iterations_; - if (iterations_ < Options::num_iterations) { + if (iterations_ < current_test_iterations_) { return; } iterations_ = 0; @@ -474,6 +475,28 @@ } } +void +CompositeCanvas::load_current_test_options() +{ + std::map::const_iterator iter; + + current_test_duration_ = 0.0; + current_test_iterations_ = 0; + + iter = current_test_->options().find("duration"); + if (iter != current_test_->options().end()) { + std::stringstream ss(iter->second.value); + ss >> current_test_duration_; + current_test_duration_ *= 1000.0; + } + + iter = current_test_->options().find("iterations"); + if (iter != current_test_->options().end()) { + std::stringstream ss(iter->second.value); + ss >> current_test_iterations_; + } +} + static void next_benchmark(std::list& benchmarks, std::list::iterator &benchIt) @@ -572,6 +595,7 @@ { Benchmark *benchmark = *benchIt; current_test_ = &benchmark->setup_test(); + load_current_test_options(); reshape(width_, height_); Log::info("Running test: '%s' %susing vertex buffer objects\n", current_test_->name().c_str(), === modified file 'src/composite-canvas.h' --- src/composite-canvas.h 2011-06-22 11:36:50 +0000 +++ src/composite-canvas.h 2011-06-23 13:13:26 +0000 @@ -84,9 +84,12 @@ void benchmark_update(bool& iteration_complete); void update_all_textures(); void sample_point(int i); + void load_current_test_options(); unsigned int iterations_; unsigned int width_; unsigned int height_; + double current_test_duration_; + unsigned int current_test_iterations_; Profiler::PointPair profiler_cycle_pair_; Profiler::PointPair profiler_xevent_pair_; === modified file 'src/options.cc' --- src/options.cc 2011-06-23 11:26:39 +0000 +++ src/options.cc 2011-06-23 13:13:26 +0000 @@ -30,7 +30,6 @@ #include "options.h" int Options::size = 512; -unsigned int Options::num_iterations = 5; std::list Options::window_ids; bool Options::run_forever = false; bool Options::use_accel_tfp = true; @@ -142,8 +141,6 @@ Options::force_tex_update = true; else if (!strcmp(optname, "run-forever")) Options::run_forever = true; - else if (!strcmp(optname, "num-iters")) - Options::num_iterations = strtol(optarg, NULL, 10); else if (!strcmp(optname, "list-tests")) Options::list_tests = true; else if (!strcmp(optname, "manual-redirect")) === modified file 'src/options.h' --- src/options.h 2011-06-23 09:49:07 +0000 +++ src/options.h 2011-06-23 13:13:26 +0000 @@ -34,7 +34,6 @@ static std::list window_ids; static int size; - static unsigned int num_iterations; static bool run_forever; static bool use_accel_tfp; static std::list benchmarks;