xref: /onnv-gate/usr/src/cmd/filebench/config/generic.func (revision 5184:da60d2b4a9e2)
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 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26
27sub pre_run {
28        # Initialize filebench to appropriate personality, create files
29	# and processes
30        op_init();
31
32        # The op_load command automatically creates files
33        op_load(conf_reqval("personality"));
34
35        # Flush the FS cache
36        op_command("system \"" . get_FILEBENCH() . "/scripts/fs_flush " . conf_reqval("filesystem") . " " . conf_reqval("dir") . "\"");
37
38        # Initialise statistics and argument arrays
39        @ext_stats=();
40        @file_stats=();
41        @arg_stats=();
42}
43
44sub post_run {
45        my $statsbase = get_STATSBASE();
46        # Shutdown processes and quit filebench
47        op_quit();
48        # Create a html summary of the run
49	system ("cd $statsbase; " . get_FILEBENCH() . "/scripts/filebench_compare $statsbase")
50}
51
52sub bm_run {
53        my $runtime = conf_reqval("runtime");
54        my $fs = get_CONFNAME();
55
56	# The following array must not contain empty values ! This causes the
57	# statistics scripts to miss arguments !
58        # Clear, run the benchmark, snap statistics
59        # This command will also run external statistics (supplied in an array)
60	# if desired
61        # Statistics automatically dumped into directory matching stats
62	# profile variable
63        # <stats>/<hostname>-<date-time>/<personality>
64
65	# create processes and start run, then collect statistics
66        op_stats($runtime,"stats.$fs",@ext_stats,@file_stats,@arg_stats);
67}
68
691;
70