Skip to content

Commit

Permalink
Adding pointers to /usr/bin/perl to avoid having to use perl somescri…
Browse files Browse the repository at this point in the history
…pt.pl & added extended sample configuration file for simplify-grammar.pl (simplify-grammar_template+.cfg)
  • Loading branch information
Roel Van de Paar committed Aug 13, 2012
1 parent 476671d commit 1334485
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 0 deletions.
2 changes: 2 additions & 0 deletions combinations.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved.
# Use is subject to license terms.
#
Expand Down
2 changes: 2 additions & 0 deletions simpipe-crash.pl 100644 → 100755
@@ -1,3 +1,5 @@
#!/usr/bin/perl

use strict;

$| = 1;
Expand Down
2 changes: 2 additions & 0 deletions simpipe-fullscan.pl 100644 → 100755
@@ -1,3 +1,5 @@
#!/usr/bin/perl

use strict;

$| = 1;
Expand Down
167 changes: 167 additions & 0 deletions simplify-grammar_template+.cfg
@@ -0,0 +1,167 @@
# Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved. Use
# is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA

use GenTest::Constants;
use GenTest::Grammar;

# Extended configuration file template for util/simplify-grammar.pl
#
# Please
# - Copy this file to for example 1.cfg and
# - Adjust the settings so that they fit to your use case & environment

{

# desired_status_codes
#---------------------
# List of expected status codes.
# Status codes are described in lib/GenTest/Constants.pm
# STATUS_ANY_ERROR means that any RQG error would cause the
# simplification to continue, e.g. both deadlocks and crashes will be
# considered together.

# desired_status_codes => [+STATUS_ANY_ERROR],

desired_status_codes => [+STATUS_SERVER_CRASHED],

# expected_output
#----------------
# List of string patterns which all need to occur within the RQG output
# after a successful simplification. The search patterns are usually
# derived from a backtrace.
# Example 1:
# Starting point is a crash of a server which was compiled with debug.
# expected_output =>
# [
# 'assert.{0,150}safe_cond_timedwait.{0,150}thr_mutex\.c.{0,50}Item_func_sleep::val_int.{0,3000}SELECT 1,SLEEP\(10\)'
# ];
# Please be careful when using source file line numbers or addresses
# in search patterns
# - They increase the selectivity of the search.
# - There is a significant risk that they do no more fit if the source
# code of the server gets changed.
# Example 2:
# Starting point is a crash of a server which was compiled without debug.
# expected_output => [
# '0x0000000000413f61',
# '0x00000000004429a0',
# '0x0000000000453f0f'
# ]
# Just some adresses looks ugly but it works quite good.
# Example 3:
# If just hunt for some status code ( -> desired_status_codes ) use
# expected_output => [ '' ]
#

expected_output => [
'safe_cond_timewait'
],

# initial_grammar_file
#---------------------
# File which should be used as the base for the simplification process.

initial_grammar_file => 'conf/partitioning/partitions.yy',

# rqg_options
#------------
# runall.pl (RQG) options which should be used

rqg_options => {
basedir => '/percona-server/Percona-Server-5.5.25a-rel27.1-285.Linux.x86_64',
threads => 20,
queries => 30000,
duration => 300,
mysqld => {
'log-output' => 'none'
},
reporter => 'Backtrace,Shutdown,QueryTimeout,ErrorLog,ErrorLogAlarm',
gendata => 'conf/engines/varchar.zz',
notnull => '',
views => 1,
'mask-level' => 1, # Quotes required due to dash
mask => 5002,
querytimeout => 60,
transformers => '',
validators => 'Transformer'
},

# grammar_flags
#--------------
# Set "grammar_flags" to GRAMMAR_FLAG_COMPACT_RULES so that rules such
# as rule: a | a | a | a | a | a | b are compressed to rule: a | b
# before simplification. This will speed up the process as each
# instance of "a" will not be removed separately until they are all
# gone.

grammar_flags => +GRAMMAR_FLAG_COMPACT_RULES,

# trials
#-------
# This is the number of times we will run the RQG in order to get to
# the desired status code and/or desired strings (expected_output).
# If the error is sporadic, several runs may be required to know if the bug
# is still present in the simplified grammar or not.
# The "seed" value gets incremented per trial.

trials => 5,

# search_var_size
#----------------
# Number of bytes (counted from the end of the output file) to be used during
# search for expected_output We suck the last "search_var_size" Bytes of the file
# to be searched into a variable.
# A too huge "search_var_size" could cause problems.
# The relevant zone within the file is maybe
# - smaller
# If our search pattern is unfortunately a bit unspecific and if it
# could also occur within irrelevant zones of the file than we might
# get false positives. Decreasing "search_var_size" might help.
# - bigger
# We might get false negatives. Increasing "search_var_size" might
# help but I am unsure if any OS and PERL implementation supports
# such a monstrous variable.

search_var_size => 30000000,

# initial_seed
#-------------
# Initial seed value to use. This increases the likelihood that the RQG run
# with the initial grammar reaches the desired result.

initial_seed => 2005,

# vardir_prefix
#---------------
# "Server activity" should happen in "vardir" which is a subdirecty of
# "vardir_prefix".
# Important points are:
# - free space within the filesystem
# - performance of the filesystem
# Simplification gets a significant speed up if we could use a memory
# based filesystem.

vardir_prefix => '/dev/shm',

# storage_prefix
#---------------
# Grammars and logs of the simplification process get stored within a
# subdirectory of "storage_prefix".

storage_prefix => '/dev/shm'

}
2 changes: 2 additions & 0 deletions translateMysql.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2009 Sun Microsystems, Inc. All rights reserved. Use
# is subject to license terms.
#
Expand Down
2 changes: 2 additions & 0 deletions util/bughunt.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down
2 changes: 2 additions & 0 deletions util/dump-test.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down
2 changes: 2 additions & 0 deletions util/mask-grammar.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down
2 changes: 2 additions & 0 deletions util/simplify-crash.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down
3 changes: 3 additions & 0 deletions util/simplify-grammar.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down Expand Up @@ -131,6 +133,7 @@
if ( ! -d $config->storage_prefix) {
croak("storage_prefix '" . $config->storage_prefix . "' is not an existing directory");
}

my $storage = $config->storage_prefix.'/'.$run_id;
say "Storage is $storage";
mkdir ($storage);
Expand Down
2 changes: 2 additions & 0 deletions util/simplify-mysqltest.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down
2 changes: 2 additions & 0 deletions util/simplify-query-performance.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down
2 changes: 2 additions & 0 deletions util/simplify-query.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down
2 changes: 2 additions & 0 deletions util/simplify-sporadic.pl
@@ -1,3 +1,5 @@
#!/usr/bin/perl

# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down

0 comments on commit 1334485

Please sign in to comment.