Skip to content

Commit

Permalink
First commit\!
Browse files Browse the repository at this point in the history
  • Loading branch information
madthanu committed Oct 7, 2014
1 parent 7faa1f8 commit bfe11d0
Show file tree
Hide file tree
Showing 228 changed files with 89,171 additions and 2 deletions.
313 changes: 311 additions & 2 deletions README.md

Large diffs are not rendered by default.

589 changes: 589 additions & 0 deletions _aliceautotest.py

Large diffs are not rendered by default.

913 changes: 913 additions & 0 deletions _aliceparsesyscalls.py

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions _aliceutils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import os
import argparse
import subprocess
import re

__aliceconfig = None
def init_aliceconfig(args):
global current_original_path, __aliceconfig
parser = argparse.ArgumentParser()
parser.add_argument('--strace_file_prefix', dest = 'strace_file_prefix', type = str, default = False)
parser.add_argument('--initial_snapshot', dest = 'initial_snapshot', type = str, default = False)
parser.add_argument('--checker_tool', dest = 'checker_tool', type = str, default = False)
parser.add_argument('--base_path', dest = 'base_path', type = str, default = False)
parser.add_argument('--starting_cwd', dest = 'starting_cwd', type = str, default = False)
parser.add_argument('--interesting_path_string', dest = 'interesting_path_string', type = str, default = False)
parser.add_argument('--scratchpad_dir', dest = 'scratchpad_dir', type = str, default = '/tmp')
parser.add_argument('--debug_level', dest = 'debug_level', type = int, default = 0)
parser.add_argument('--ignore_ioctl', dest = 'ignore_ioctl', type = list, default = [])
parser.add_argument('--ignore_mmap', dest = 'ignore_mmap', type = bool, default = False)
parser.add_argument('--ignore_stacktrace', dest = 'ignore_stacktrace', type = bool, default = False)

__aliceconfig = parser.parse_args('')
for key in __aliceconfig.__dict__:
if key in args:
__aliceconfig.__dict__[key] = args[key]


assert __aliceconfig.strace_file_prefix != False
assert __aliceconfig.initial_snapshot != False
assert __aliceconfig.base_path != False and __aliceconfig.base_path.startswith('/')
if __aliceconfig.base_path.endswith('/'):
__aliceconfig.base_path = __aliceconfig.base_path[0 : -1]

if __aliceconfig.interesting_path_string == False:
__aliceconfig.interesting_path_string = r'^' + __aliceconfig.base_path

if 'starting_cwd' not in __aliceconfig.__dict__ or __aliceconfig.starting_cwd == False:
__aliceconfig.starting_cwd = __aliceconfig.base_path

assert __aliceconfig.scratchpad_dir != False

def aliceconfig():
return __aliceconfig

def get_path_inode_map(directory):
result = {}
while(directory.endswith('/')):
directory = directory[ : -1]
for inode_path in subprocess.check_output("find " + directory + " -printf '%i %p %y\n'", shell = True).split('\n'):
if inode_path == '':
continue
(inode, path, entry_type) = inode_path.split(' ')
inode = int(inode)
assert entry_type == 'd' or entry_type == 'f'
result[path] = (inode, entry_type)
return result


def colorize(s, i):
return '\033[00;' + str(30 + i) + 'm' + s + '\033[0m'

def coded_colorize(s, s2 = None):
colors=[1,3,5,6,11,12,14,15]
if s2 == None:
s2 = s
return colorize(s, colors[hash(s2) % len(colors)])

def colors_test(fname):
f = open(fname, 'w')
for i in range(0, 30):
f.write(colorize(str(i), i) + '\n')
f.close()

def short_path(name):
if not __aliceconfig or not name.startswith(__aliceconfig.base_path):
return name
return name.replace(re.sub(r'//', r'/', __aliceconfig.base_path + '/'), '', 1)

# The input parameter must already have gone through original_path()
def initial_path(name):
if not name.startswith(__aliceconfig.base_path):
return False
toret = name.replace(__aliceconfig.base_path, __aliceconfig.initial_snapshot + '/', 1)
return re.sub(r'//', r'/', toret)

# The input parameter must already have gone through original_path()
def replayed_path(name):
if not name.startswith(__aliceconfig.base_path):
return False
toret = name.replace(__aliceconfig.base_path, __aliceconfig.scratchpad_dir + '/', 1)
return re.sub(r'//', r'/', toret)

def safe_string_to_int(s):
try:
if len(s) >= 2 and s[0:2] == "0x":
return int(s, 16)
elif s[0] == '0':
return int(s, 8)
return int(s)
except ValueError as err:
print s
raise err

def is_interesting(path):
return re.search(aliceconfig().interesting_path_string, path)

def writeable_toggle(path, mode = None):
if mode == 'UNTOGGLED':
return
elif mode != None:
os.chmod(path, mode)
if os.access(path, os.W_OK):
return 'UNTOGGLED'
if not os.access(path, os.W_OK):
old_mode = os.stat(path).st_mode
os.chmod(path, 0777)
return old_mode
1 change: 1 addition & 0 deletions alice-strace/.tarball-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.8
1 change: 1 addition & 0 deletions alice-strace/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.8
1 change: 1 addition & 0 deletions alice-strace/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See the file CREDITS. Automake likes us to have this file called AUTHORS.
29 changes: 29 additions & 0 deletions alice-strace/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Copyright (c) 1991, 1992 Paul Kranenburg <[email protected]>
Copyright (c) 1993 Branko Lankester <[email protected]>
Copyright (c) 1993 Ulrich Pegelow <[email protected]>
Copyright (c) 1995, 1996 Michael Elizabeth Chastain <[email protected]>
Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <[email protected]>
Copyright (C) 1998-2001 Wichert Akkerman <[email protected]>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
130 changes: 130 additions & 0 deletions alice-strace/CREDITS
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
The primary authors of strace were:

Paul Kranenburg <[email protected]>
Branko Lankester <[email protected]>
Rick Sladkey <[email protected]>

These people have contributed to strace. Some have reported problems, others
have contributed improvements to the documentation, actual code, provided
information, provided resources, or helped to port strace to new systems.
Those contributions are described in the version control logs and ChangeLog-CVS
file. If your name has been left out, if you'd rather not be listed, or if
you'd prefer a different address be used, please send a note to the
[email protected] mailing list.

Aaron Ucko <[email protected]>
Adrien Kunysz <[email protected]>
Andi Kleen <[email protected]>
Andreas Schwab <[email protected]>
Anton Blanchard <[email protected]>
Arkadiusz Miskiewicz <[email protected]>
Bai Weidong <[email protected]>
Ben Noordhuis <[email protected]>
Bernhard Reutner-Fischer <[email protected]>
Bo Kullmar <[email protected]>
Cai Fei <[email protected]>
Carlos O'Donell <[email protected]>
Carmelo AMOROSO <[email protected]>
Chris Metcalf <[email protected]>
Chris Zankel <[email protected]>
Christian Svensson <[email protected]>
D.J. Barrow <[email protected]>
Damir Shayhutdinov <[email protected]>
Daniel P. Berrange <[email protected]>
David Daney <[email protected]>
David Mosberger-Tang <[email protected]>
David S. Miller <[email protected]>
David Wilder <[email protected]>
David Woodhouse <[email protected]>
Denys Vlasenko <[email protected]>
Dmitry V. Levin <[email protected]>
Douglas Mencken <[email protected]>
Edgar E. Iglesias <[email protected]>
Fernando Luis Vazquez Cao <[email protected]>
Florian Lohoff <[email protected]>
Frederik Schüler <[email protected]>
Gabor Gombas <[email protected]>
Ganesan Rajagopal <[email protected]>
Gaël Roualland <[email protected]>
Grant Edwards <[email protected]>
Greg Banks <[email protected]>
H.J. Lu <[email protected]>
Heiko Carstens <[email protected]>
Henrik Storner <[email protected]>
Holger Hans Peter Freyther <[email protected]>
Jakub Bogusz <[email protected]>
Jakub Jelinek <[email protected]>
James Hogan <[email protected]>
Jan Kratochvil <[email protected]>
Jeff Mahoney <[email protected]>
Joe Ilacqua <[email protected]>
Johannes Stezenbach <[email protected]>
John Hughes <[email protected]>
John Spencer <[email protected]>
Ju"rgen Fluk <[email protected]>
Juergen Weigert <[email protected]>
Keith Thompson <[email protected]>
Kirill A. Shutemov <[email protected]>
Kyle McMartin <[email protected]>
Lai JiangShan <[email protected]>
Leonard N. Zubkoff <[email protected]>
Linus Torvalds <[email protected]>
Lupe Christoph <[email protected]>
Mark Wielaard <[email protected]>
Marty Leisner <[email protected]>
Matt Day <[email protected]>
Matthias Pfaller <[email protected]>
Maxim Shchetynin <[email protected]>
Maxin B. John <[email protected]>
Michael E Chastain <[email protected]>
Michael Holzheu <[email protected]>
Michail Litvak <[email protected]>
Michal Ludvig <[email protected]>
Mike Frysinger <[email protected]>
Mike Stroyan <[email protected]>
Muttley Meen <[email protected]>
Namhyung Kim <[email protected]>
Nate Eldredge <[email protected]>
Nate Sammons <[email protected]>
Neil Campbell <[email protected]>
Paolo Bonzini <[email protected]>
Paul Mundt <[email protected]>
Pavel Machek <[email protected]>
Peter Jones <[email protected]>
Pádraig Brady <[email protected]>
Rajeev V. Pillai <[email protected]>
Ralf Baechle <[email protected]>
Randolph Chung <[email protected]>
Reuben Sumner <[email protected]>
Richard Braakman <[email protected]>
Richard Henderson <[email protected]>
Richard Hirst <[email protected]>
Roland Borde <[email protected]>
Roland McGrath <[email protected]>
Sami Farin <[email protected]>
Scott Tsai <[email protected]>
Sebastian Pipping <[email protected]>
Sergei Trofimovich <[email protected]>
Simon Murray <[email protected]>
Solar Designer <[email protected]>
Srinivasa Ds <[email protected]>
Stanislav Brabec <[email protected]>
Steve Bennett <[email protected]>
Steve McIntyre <[email protected]>
Thanh Ma <[email protected]>
Thiemo Seufer <[email protected]>
Thomas Bogendoerfer <[email protected]>
Tim Yamin <[email protected]>
Timo Lindfors <[email protected]>
Tom Dyas <[email protected]>
Tommi Rantala <[email protected]>
Topi Miettinen <[email protected]>
Ulrich Drepper <[email protected]>
Wang Chao <[email protected]>
Wichert Akkerman <[email protected]>
Xiaoning Ding <[email protected]>
Yang Zhiguo <[email protected]>
Zach Brown <[email protected]>
Zev Weiss <[email protected]>
Zhang Le <[email protected]>
Марк Коренберг <[email protected]>
Loading

0 comments on commit bfe11d0

Please sign in to comment.