From patchwork Tue Sep 20 09:54:12 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: 4196 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 C6B3823EF6 for ; Tue, 20 Sep 2011 09:54:14 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id A58B1A18053 for ; Tue, 20 Sep 2011 09:54:14 +0000 (UTC) Received: by fxe23 with SMTP id 23so482513fxe.11 for ; Tue, 20 Sep 2011 02:54:14 -0700 (PDT) Received: by 10.223.55.136 with SMTP id u8mr1042434fag.46.1316512454479; Tue, 20 Sep 2011 02:54:14 -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.152.18.198 with SMTP id y6cs73583lad; Tue, 20 Sep 2011 02:54:14 -0700 (PDT) Received: by 10.216.159.68 with SMTP id r46mr615097wek.84.1316512453050; Tue, 20 Sep 2011 02:54:13 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id x19si797153wec.130.2011.09.20.02.54.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Sep 2011 02:54:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1R5x1o-00018R-Cg for ; Tue, 20 Sep 2011 09:54:12 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 4D3B0E003D for ; Tue, 20 Sep 2011 09:54:12 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 139 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 139: Scene, Options: Don't display all the scene options used for benchmarks, unless the user asks for it. Message-Id: <20110920095412.24163.81528.launchpad@ackee.canonical.com> Date: Tue, 20 Sep 2011 09:54:12 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13980"; Instance="initZopeless config overlay" X-Launchpad-Hash: 66d2b6f09a6b9846e7f40998c8106548d0430fd9 ------------------------------------------------------------ revno: 139 committer: Alexandros Frantzis branch nick: trunk timestamp: Tue 2011-09-20 12:45:24 +0300 message: Scene,Options: Don't display all the scene options used for benchmarks, unless the user asks for it. The displayed list of used scene options for each run benchmark can get quite long and confusing. With this change, only explicitly set options are shown by default. The user can use the "--show-all-options" command line option to display all the scene option values used for each run benchmark. modified: src/options.cpp src/options.h src/scene.cpp src/scene.h --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'src/options.cpp' --- src/options.cpp 2011-08-09 11:13:43 +0000 +++ src/options.cpp 2011-09-20 09:45:24 +0000 @@ -36,6 +36,7 @@ bool Options::swap_buffers = true; std::pair Options::size(800, 600); bool Options::list_scenes = false; +bool Options::show_all_options = false; bool Options::show_debug = false; bool Options::show_help = false; @@ -45,6 +46,7 @@ {"no-swap-buffers", 0, 0, 0}, {"size", 1, 0, 0}, {"list-scenes", 0, 0, 0}, + {"show-all-options", 0, 0, 0}, {"debug", 0, 0, 0}, {"help", 0, 0, 0}, {0, 0, 0, 0} @@ -93,6 +95,8 @@ " -s, --size WxH Size of the display (default: 800x600)\n" " -l, --list-scenes Display information about the available scenes\n" " and their options\n" + " --show-all-options Show all scene option values used for benchmarks\n" + " (only explicitly set options are shown by default)\n" " -d, --debug Display debug messages\n" " -h, --help Display help\n"); } @@ -125,6 +129,8 @@ parse_size(optarg, Options::size); else if (c == 'l' || !strcmp(optname, "list-scenes")) Options::list_scenes = true; + else if (!strcmp(optname, "show-all-options")) + Options::show_all_options = true; else if (c == 'd' || !strcmp(optname, "debug")) Options::show_debug = true; else if (c == 'h' || !strcmp(optname, "help")) === modified file 'src/options.h' --- src/options.h 2011-08-09 11:13:43 +0000 +++ src/options.h 2011-09-20 09:45:24 +0000 @@ -36,6 +36,7 @@ static bool swap_buffers; static std::pair size; static bool list_scenes; + static bool show_all_options; static bool show_debug; static bool show_help; }; === modified file 'src/scene.cpp' --- src/scene.cpp 2011-09-15 09:04:17 +0000 +++ src/scene.cpp 2011-09-20 09:45:24 +0000 @@ -24,6 +24,7 @@ #include "scene.h" #include "log.h" #include "shader-source.h" +#include "options.h" #include #include #include @@ -119,6 +120,7 @@ return false; iter->second.value = val; + iter->second.set = true; return true; } @@ -133,6 +135,7 @@ Option &opt = iter->second; opt.value = opt.default_value; + opt.set = false; } } @@ -160,8 +163,14 @@ iter != mOptions.end(); iter++) { - ss << iter->first << "=" << iter->second.value << ":"; + if (Options::show_all_options || iter->second.set) + { + ss << iter->first << "=" << iter->second.value << ":"; + } } + + if (ss.str().empty()) + ss << ":"; } else ss << title; === modified file 'src/scene.h' --- src/scene.h 2011-09-16 11:49:57 +0000 +++ src/scene.h 2011-09-20 09:45:24 +0000 @@ -46,12 +46,13 @@ struct Option { Option(const std::string &nam, const std::string &val, const std::string &desc) : - name(nam), value(val), default_value(val), description(desc) {} + name(nam), value(val), default_value(val), description(desc), set(false) {} Option() {} std::string name; std::string value; std::string default_value; std::string description; + bool set; }; enum ValidationResult {