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