-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Onder Kalaci
committed
Jun 8, 2014
1 parent
c2ab4b5
commit 0189fae
Showing
12 changed files
with
2,273 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/python | ||
import os | ||
import sys | ||
import time | ||
|
||
DEBUG_MODE = False | ||
PIN_EXECUTABLE = "/home/onder/Desktop/PIN/pin-2.12-56759-gcc.4.4.7-linux/pin -follow_execv " | ||
KILLHTTPD = " sudo killall -SIGINT apache2" | ||
HTTPDSTARTCOMMAND = "sudo /usr/sbin/apache2ctl -X " | ||
CLIENT_COUNT = "20" | ||
REQUEST_COUNT = "100" | ||
GENERATOREXECUTER = "./generator.py -n " + CLIENT_COUNT + " -c " + REQUEST_COUNT | ||
|
||
sharedObjectList = ["PureLocksetImp.so", "ThreadSanitizerImp.so", "PureHappensBeforeImp.so"] | ||
|
||
|
||
|
||
def killHTTPD(): | ||
os.system(KILLHTTPD) | ||
|
||
|
||
def findExactTotalRace(fileName): | ||
totalCount = 0 | ||
f = open(fileName, "r") | ||
lines = f.readlines() | ||
for line in lines: | ||
if line.find("totalRaceCount:") != -1: | ||
totalCount = totalCount + int(line.split(":")[1]) | ||
|
||
return str(totalCount) | ||
|
||
|
||
def executePIN(): | ||
|
||
|
||
f = open("execution_history.txt", "w") | ||
for sharedObject in sharedObjectList: | ||
killHTTPD() | ||
sharedObjectName = sharedObject.split(".")[0] | ||
strToExecute = PIN_EXECUTABLE + " -t ../" + sharedObject + " -- " + HTTPDSTARTCOMMAND + " > " + sharedObjectName + "_httpd.txt 2>&1 &" | ||
|
||
|
||
os.system(strToExecute) | ||
os.system("sleep 20") | ||
print "apache2 started...." | ||
startTime = time.time() | ||
os.system(GENERATOREXECUTER) | ||
endTime = time.time() | ||
totalTime = str( endTime - startTime) | ||
killHTTPD() | ||
print "killed apache" | ||
os.system("sleep 3") | ||
f.write("************************\n") | ||
strToWrite = sharedObjectName + " time : " + totalTime + " race:" + findExactTotalRace( sharedObjectName + "_httpd.txt") | ||
f.write(strToWrite) | ||
f.write("\n************************\n") | ||
f.close() | ||
executePIN() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/python | ||
|
||
import sys,getopt,threading,time | ||
import urllib2 | ||
|
||
|
||
|
||
threadcount = '' | ||
connectioncount = '' | ||
|
||
def argParser(argv): | ||
global connectioncount, threadcount | ||
try: | ||
opts, args = getopt.getopt(argv,"hn:c:",["threadcount=","connectioncount="]) | ||
except getopt.GetoptError: | ||
print 'test.py -n <threadcount> -c <connectioncount>' | ||
sys.exit(2) | ||
for opt, arg in opts: | ||
print opt, arg | ||
if opt == '-h': | ||
print 'test.py -n <threadcount> -c <connectioncount>' | ||
sys.exit() | ||
elif opt in ("-n", "--threadcount"): | ||
threadcount = arg | ||
elif opt in ("-c", "--connectioncount"): | ||
connectioncount = arg | ||
|
||
|
||
class Connector(threading.Thread): | ||
def __init__(self, connectionCount): | ||
threading.Thread.__init__(self) | ||
self.connectioncount = connectionCount | ||
|
||
def run(self): | ||
try: | ||
for i in range(0, int(self.connectioncount)): | ||
time.sleep(0.1) | ||
req = urllib2.Request('http://127.0.0.1') | ||
r = urllib2.urlopen(req) | ||
if len(r.read()) != 8484: | ||
print "OOOPS error" | ||
except Exception,e: | ||
print "%s",e | ||
if __name__ == "__main__": | ||
argParser(sys.argv[1:]) | ||
print 'threadcount', threadcount | ||
print 'connectioncount', connectioncount | ||
allConnectors = [] | ||
for i in range(0, int(threadcount)): | ||
tmp = Connector(connectioncount) | ||
allConnectors.append(tmp) | ||
|
||
for connector in allConnectors: | ||
connector.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Learn Center</title> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all"> | ||
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all"> | ||
<link rel="stylesheet" href="css/style.css" type="text/css" media="all"> | ||
<script type="text/javascript" src="js/jquery-1.5.2.js" ></script> | ||
<script type="text/javascript" src="js/cufon-yui.js"></script> | ||
<script type="text/javascript" src="js/cufon-replace.js"></script> | ||
<script type="text/javascript" src="js/Molengo_400.font.js"></script> | ||
<script type="text/javascript" src="js/Expletus_Sans_400.font.js"></script> | ||
<!--[if lt IE 9]> | ||
<script type="text/javascript" src="js/html5.js"></script> | ||
<style type="text/css">.bg, .box2{behavior:url("js/PIE.htc");}</style> | ||
<![endif]--> | ||
</head> | ||
<body id="page1"> | ||
<div class="body1"> | ||
<div class="main"> | ||
<!-- header --> | ||
<header> | ||
<div class="wrapper"> | ||
<nav> | ||
<ul id="menu"> | ||
<li><a href="index.html">About</a></li> | ||
<li><a href="courses.html">Courses</a></li> | ||
<li><a href="programs.html">Programs</a></li> | ||
<li><a href="teachers.html">Teachers</a></li> | ||
<li><a href="admissions.html">Admissions</a></li> | ||
<li class="end"><a href="contacts.html">Contacts</a></li> | ||
</ul> | ||
</nav> | ||
<ul id="icon"> | ||
<li><a href="#"><img src="images/icon1.jpg" alt=""></a></li> | ||
<li><a href="#"><img src="images/icon2.jpg" alt=""></a></li> | ||
<li><a href="#"><img src="images/icon3.jpg" alt=""></a></li> | ||
</ul> | ||
</div> | ||
<div class="wrapper"> | ||
<h1><a href="index.html" id="logo">Learn Center</a></h1> | ||
</div> | ||
<div id="slogan"> We Will Open The World<span>of knowledge for you!</span> </div> | ||
<ul class="banners"> | ||
<li><a href="#"><img src="images/banner1.jpg" alt=""></a></li> | ||
<li><a href="#"><img src="images/banner2.jpg" alt=""></a></li> | ||
<li><a href="#"><img src="images/banner3.jpg" alt=""></a></li> | ||
</ul> | ||
</header> | ||
<!-- / header --> | ||
</div> | ||
</div> | ||
<div class="body2"> | ||
<div class="main"> | ||
<!-- content --> | ||
<section id="content"> | ||
<div class="wrapper"> | ||
<div class="pad1 pad_top1"> | ||
<article class="cols marg_right1"> | ||
<figure><a href="#"><img src="images/page1_img1.jpg" alt=""></a></figure> | ||
<span class="font1">Our Mission Statement</span> </article> | ||
<article class="cols marg_right1"> | ||
<figure><a href="#"><img src="images/page1_img2.jpg" alt=""></a></figure> | ||
<span class="font1">Performance Report</span> </article> | ||
<article class="cols"> | ||
<figure><a href="#"><img src="images/page1_img3.jpg" alt=""></a></figure> | ||
<span class="font1">Prospective Parents</span> </article> | ||
</div> | ||
</div> | ||
<div class="box1"> | ||
<div class="wrapper"> | ||
<article class="col1"> | ||
<div class="pad_left1"> | ||
<h2>Welcome to Our Center</h2> | ||
<p class="font2">Learn Center is one of free website templates created by <span>TemplateMonster.com team</span></p> | ||
<p><strong>Learn Center Template</strong> is optimized for 1024X768 screen resolution. It’s also XHTML & CSS valid. This website template has several pages: <a href="courses.html">Courses</a>, <a href="programs.html">Programs</a>, <a href="teachers.html">Teachers</a>, <a href="admissions.html">Admissions</a>, <a href="contacts.html">Contacts</a> (note that contact us form – doesn’t work).</p> | ||
</div> | ||
<a href="#" class="button"><span><span>Read More</span></span></a> | ||
<div class="pad_left1"> | ||
<h2>Individual Approach to Education!</h2> | ||
</div> | ||
<div class="wrapper"> | ||
<figure class="left marg_right1"><img src="images/page1_img4.jpg" alt=""></figure> | ||
<p class="pad_bot1 pad_top2"><strong>Lorem ipsum dolor sit amet, consectetur adipisicing eiusmod tempor incididunt ut labore.</strong></p> | ||
<p> Learn Center Template goes with two packages – with PSD source files and without them. PSD source files are available for free for the registered members of Templates.com. The basic package (without PSD source is available for anyone without registration).</p> | ||
</div> | ||
<div class="pad_top2"> <a href="#" class="button"><span><span>Read More</span></span></a> </div> | ||
</article> | ||
<article class="col2 pad_left2"> | ||
<div class="pad_left1"> | ||
<h2>New Programs</h2> | ||
</div> | ||
<ul class="list1"> | ||
<li><a href="#">International Studies</a></li> | ||
<li><a href="#">Models & Language Reaching</a></li> | ||
<li><a href="#">Public School Facts</a></li> | ||
<li><a href="#">State Testing Data</a></li> | ||
<li><a href="#">Education Jobs</a></li> | ||
</ul> | ||
<div class="pad_left1"> | ||
<h2>Latest News</h2> | ||
</div> | ||
<div class="wrapper"> <span class="date">27</span> | ||
<p class="pad_top2"><a href="#">April, 2011</a><br> | ||
Sed utirspiciatis unde omnis iste natus error sit...</p> | ||
</div> | ||
<div class="wrapper"> <span class="date">25</span> | ||
<p class="pad_top2"><a href="#">April, 2011</a><br> | ||
Voluptatem accusan dolore mque laudantium...</p> | ||
</div> | ||
<div class="pad_top2"> <a href="#" class="button"><span><span>Read More</span></span></a> </div> | ||
</article> | ||
</div> | ||
</div> | ||
</section> | ||
<!-- content --> | ||
<!-- footer --> | ||
<footer> | ||
<div class="wrapper"> | ||
<div class="pad1"> | ||
<div class="pad_left1"> | ||
<div class="wrapper"> | ||
<article class="col_1"> | ||
<h3>Address:</h3> | ||
<p class="col_address"><strong>Country:<br> | ||
City:<br> | ||
Address:<br> | ||
Email:</strong></p> | ||
<p>USA<br> | ||
San Diego<br> | ||
Beach st. 54<br> | ||
<a href="#">lcenter@mail.com</a></p> | ||
</article> | ||
<article class="col_2 pad_left2"> | ||
<h3>Join In:</h3> | ||
<ul class="list2"> | ||
<li><a href="#">Sign Up</a></li> | ||
<li><a href="#">Forums</a></li> | ||
<li><a href="#">Promotions</a></li> | ||
<li><a href="#">Lorem</a></li> | ||
</ul> | ||
</article> | ||
<article class="col_3 pad_left2"> | ||
<h3>Why Us:</h3> | ||
<ul class="list2"> | ||
<li><a href="#">Lorem ipsum dolor </a></li> | ||
<li><a href="#">Aonsect adipisic</a></li> | ||
<li><a href="#">Eiusmjkod tempor </a></li> | ||
<li><a href="#">Incididunt ut labore </a></li> | ||
</ul> | ||
</article> | ||
<article class="col_4 pad_left2"> | ||
<h3>Newsletter:</h3> | ||
<form id="newsletter" action="#" method="post"> | ||
<div class="wrapper"> | ||
<div class="bg"> | ||
<input type="text"> | ||
</div> | ||
</div> | ||
<a href="#" class="button"><span><span><strong>Subscribe</strong></span></span></a> | ||
</form> | ||
</article> | ||
</div> | ||
<div class="wrapper"> | ||
<article class="call"> <span class="call1">Call Us Now: </span><span class="call2">1-800-567-8934</span> </article> | ||
<article class="col_4 pad_left2">Copyright © <a href="#">Domain Name</a> All Rights Reserved<br> | ||
Design by <a target="_blank" href="http://www.templatemonster.com/">TemplateMonster.com</a></article> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</footer> | ||
<!-- / footer --> | ||
</div> | ||
</div> | ||
<script type="text/javascript">Cufon.now();</script> | ||
<div align=center>This template downloaded form <a href='http://all-free-download.com/free-website-templates/'>free website templates</a></div></body> | ||
</html> |
Oops, something went wrong.