1 5184 ek110237 # 2 5184 ek110237 # CDDL HEADER START 3 5184 ek110237 # 4 5184 ek110237 # The contents of this file are subject to the terms of the 5 5184 ek110237 # Common Development and Distribution License (the "License"). 6 5184 ek110237 # You may not use this file except in compliance with the License. 7 5184 ek110237 # 8 5184 ek110237 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 5184 ek110237 # or http://www.opensolaris.org/os/licensing. 10 5184 ek110237 # See the License for the specific language governing permissions 11 5184 ek110237 # and limitations under the License. 12 5184 ek110237 # 13 5184 ek110237 # When distributing Covered Code, include this CDDL HEADER in each 14 5184 ek110237 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 5184 ek110237 # If applicable, add the following below this CDDL HEADER, with the 16 5184 ek110237 # fields enclosed by brackets "[]" replaced with your own identifying 17 5184 ek110237 # information: Portions Copyright [yyyy] [name of copyright owner] 18 5184 ek110237 # 19 5184 ek110237 # CDDL HEADER END 20 5184 ek110237 # 21 5184 ek110237 # 22 9326 Andrew # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 5184 ek110237 # Use is subject to license terms. 24 5184 ek110237 # 25 5184 ek110237 26 5184 ek110237 sub pre_run { 27 5184 ek110237 # Initialize filebench to appropriate personality, create files 28 5184 ek110237 # and processes 29 5184 ek110237 op_init(); 30 5184 ek110237 31 5184 ek110237 # The op_load command automatically creates files 32 5184 ek110237 op_load(conf_reqval("personality")); 33 5184 ek110237 34 5184 ek110237 # Flush the FS cache 35 9513 Andrew op_fsflush(); 36 5184 ek110237 37 5184 ek110237 # Initialise statistics and argument arrays 38 5184 ek110237 @ext_stats=(); 39 5184 ek110237 @file_stats=(); 40 5184 ek110237 @arg_stats=(); 41 5184 ek110237 } 42 5184 ek110237 43 5184 ek110237 sub post_run { 44 5184 ek110237 my $statsbase = get_STATSBASE(); 45 7736 Andrew 46 5184 ek110237 # Create a html summary of the run 47 5184 ek110237 system ("cd $statsbase; " . get_FILEBENCH() . "/scripts/filebench_compare $statsbase") 48 5184 ek110237 } 49 5184 ek110237 50 5184 ek110237 sub bm_run { 51 5184 ek110237 my $runtime = conf_reqval("runtime"); 52 5184 ek110237 my $fs = get_CONFNAME(); 53 9326 Andrew my $warmuptime = ""; 54 9326 Andrew 55 9326 Andrew if (conf_exists("warmuptime") == 1) { 56 9326 Andrew $warmuptime = conf_reqval("warmuptime"); 57 9326 Andrew } 58 5184 ek110237 59 5184 ek110237 # The following array must not contain empty values ! This causes the 60 5184 ek110237 # statistics scripts to miss arguments ! 61 5184 ek110237 # Clear, run the benchmark, snap statistics 62 5184 ek110237 # This command will also run external statistics (supplied in an array) 63 5184 ek110237 # if desired 64 5184 ek110237 # Statistics automatically dumped into directory matching stats 65 5184 ek110237 # profile variable 66 5184 ek110237 # <stats>/<hostname>-<date-time>/<personality> 67 5184 ek110237 68 5184 ek110237 # create processes and start run, then collect statistics 69 9326 Andrew op_stats($runtime,$warmuptime,"stats.$fs",@ext_stats,@file_stats,@arg_stats); 70 5184 ek110237 } 71 5184 ek110237 72 5184 ek110237 1; 73