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 2009 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_fsflush();
  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         my $warmuptime = "";
  54 
  55         if (conf_exists("warmuptime") == 1) {
  56             $warmuptime = conf_reqval("warmuptime");
  57         }
  58 
  59         # The following array must not contain empty values ! This causes the
  60         # statistics scripts to miss arguments !
  61         # Clear, run the benchmark, snap statistics 
  62         # This command will also run external statistics (supplied in an array)
  63         # if desired 
  64         # Statistics automatically dumped into directory matching stats
  65         # profile variable
  66         # <stats>/<hostname>-<date-time>/<personality>
  67 
  68         # create processes and start run, then collect statistics
  69         op_stats($runtime,$warmuptime,"stats.$fs",@ext_stats,@file_stats,@arg_stats);
  70 }
  71 
  72 1;