15184Sek110237# 25184Sek110237# CDDL HEADER START 35184Sek110237# 45184Sek110237# The contents of this file are subject to the terms of the 55184Sek110237# Common Development and Distribution License (the "License"). 65184Sek110237# You may not use this file except in compliance with the License. 75184Sek110237# 85184Sek110237# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 95184Sek110237# or http://www.opensolaris.org/os/licensing. 105184Sek110237# See the License for the specific language governing permissions 115184Sek110237# and limitations under the License. 125184Sek110237# 135184Sek110237# When distributing Covered Code, include this CDDL HEADER in each 145184Sek110237# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 155184Sek110237# If applicable, add the following below this CDDL HEADER, with the 165184Sek110237# fields enclosed by brackets "[]" replaced with your own identifying 175184Sek110237# information: Portions Copyright [yyyy] [name of copyright owner] 185184Sek110237# 195184Sek110237# CDDL HEADER END 205184Sek110237# 215184Sek110237# 229326SAndrew.W.Wilson@sun.com# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 235184Sek110237# Use is subject to license terms. 245184Sek110237# 255184Sek110237 265184Sek110237sub pre_run { 275184Sek110237 # Initialize filebench to appropriate personality, create files 285184Sek110237 # and processes 295184Sek110237 op_init(); 305184Sek110237 315184Sek110237 # The op_load command automatically creates files 325184Sek110237 op_load(conf_reqval("personality")); 335184Sek110237 345184Sek110237 # Flush the FS cache 35*9513SAndrew.W.Wilson@sun.com op_fsflush(); 365184Sek110237 375184Sek110237 # Initialise statistics and argument arrays 385184Sek110237 @ext_stats=(); 395184Sek110237 @file_stats=(); 405184Sek110237 @arg_stats=(); 415184Sek110237} 425184Sek110237 435184Sek110237sub post_run { 445184Sek110237 my $statsbase = get_STATSBASE(); 457736SAndrew.W.Wilson@sun.com 465184Sek110237 # Create a html summary of the run 475184Sek110237 system ("cd $statsbase; " . get_FILEBENCH() . "/scripts/filebench_compare $statsbase") 485184Sek110237} 495184Sek110237 505184Sek110237sub bm_run { 515184Sek110237 my $runtime = conf_reqval("runtime"); 525184Sek110237 my $fs = get_CONFNAME(); 539326SAndrew.W.Wilson@sun.com my $warmuptime = ""; 549326SAndrew.W.Wilson@sun.com 559326SAndrew.W.Wilson@sun.com if (conf_exists("warmuptime") == 1) { 569326SAndrew.W.Wilson@sun.com $warmuptime = conf_reqval("warmuptime"); 579326SAndrew.W.Wilson@sun.com } 585184Sek110237 595184Sek110237 # The following array must not contain empty values ! This causes the 605184Sek110237 # statistics scripts to miss arguments ! 615184Sek110237 # Clear, run the benchmark, snap statistics 625184Sek110237 # This command will also run external statistics (supplied in an array) 635184Sek110237 # if desired 645184Sek110237 # Statistics automatically dumped into directory matching stats 655184Sek110237 # profile variable 665184Sek110237 # <stats>/<hostname>-<date-time>/<personality> 675184Sek110237 685184Sek110237 # create processes and start run, then collect statistics 699326SAndrew.W.Wilson@sun.com op_stats($runtime,$warmuptime,"stats.$fs",@ext_stats,@file_stats,@arg_stats); 705184Sek110237} 715184Sek110237 725184Sek1102371; 73