Navigation Menu

Skip to content

Commit

Permalink
committing licensure
Browse files Browse the repository at this point in the history
  • Loading branch information
blucia0a committed Jan 15, 2013
1 parent d424e4e commit 80923d3
Show file tree
Hide file tree
Showing 16 changed files with 286 additions and 11 deletions.
16 changes: 16 additions & 0 deletions Compiler/RWInst.c
@@ -1,5 +1,21 @@
/******************************************************************************
* RWInst.c
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*
* RWInst - RWInst instrumentation plugin
*****************************************************************************/
Expand Down
21 changes: 21 additions & 0 deletions Compiler/ReadWriteCalls.c
@@ -1,3 +1,24 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
ReadWriteCalls.c
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#include <gcc-plugin.h>
#include <coretypes.h>
#include <diagnostic.h>
Expand Down
17 changes: 17 additions & 0 deletions README
@@ -1,4 +1,21 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==

Copyright (C) 2012 Brandon Lucia

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, either version 3 of the License, or
(at your option) any later version.

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, see <http://www.gnu.org/licenses/>.
*/

CTraps is a gcc plugin and runtime library that inserts calls to runtime
library functions just before shared memory accesses in parallel/concurrent
Expand Down
20 changes: 20 additions & 0 deletions Runtime/LWT.h
@@ -1,3 +1,23 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
LWT.h
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#ifndef _LWT_H_
#define _LWT_H_

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Plugins/Makefile
@@ -1,7 +1,7 @@
GXX=${HOME}/cvsandbox/GCC-experimental/inst/bin/g++
GCC=${HOME}/cvsandbox/GCC-experimental/inst/bin/gcc

CTRAPSHOME=/sampa/home/blucia/cvsandbox/CommGraph/Runtime
CTRAPSHOME=${HOME}/cvsandbox/CommGraph/Runtime

CFLAGS+= -fPIC -O3 -g -pthread -I${HOME}/cvsandbox/GCC-experimental/inst/include -I${CTRAPSHOME} -Wno-deprecated
CXXFLAGS+= -fPIC -O3 -g -pthread -std=c++11 -I${HOME}/cvsandbox/GCC-experimental/inst/include -I${CTRAPSHOME} -Wno-deprecated
Expand Down
19 changes: 19 additions & 0 deletions Runtime/Plugins/cganom_plugin.cpp
@@ -1,3 +1,22 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#include <stdio.h>
#include <stdlib.h>
#include <hash_map>
Expand Down
19 changes: 19 additions & 0 deletions Runtime/Plugins/cgtest_plugin.cpp
@@ -1,3 +1,22 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#include <stdio.h>
#include <stdlib.h>
#include <hash_map>
Expand Down
20 changes: 20 additions & 0 deletions Runtime/Plugins/null_plugin.c
@@ -1,3 +1,23 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/


#include <stdio.h>
#include <stdlib.h>
#include "ct_plugin.h"
Expand Down
20 changes: 20 additions & 0 deletions Runtime/Plugins/sfi_plugin.c
@@ -1,3 +1,23 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/


#include <stdio.h>
#include <stdlib.h>
#include "ct_plugin.h"
Expand Down
29 changes: 19 additions & 10 deletions Runtime/RWCalls.cpp
@@ -1,3 +1,22 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
Expand Down Expand Up @@ -148,25 +167,20 @@ void *sampleTimer(void*v){
samplingOn = false;
while(true){

//fprintf(stderr,"WAITING ON THE NEXT SAMPLE PERIOD - %lu quanta\n",quanta);
/*Non-Sampling Period*/
usleep(NON_SAMPLE_PERIOD);

//fprintf(stderr,"STARTING A SAMPLE PERIOD\n");
/*Sample Generation is ordered by samplingOn's fence*/
unsigned long t = sampleGeneration.load(memory_order_acquire);
sampleGeneration.store(t + 1, memory_order_release);
samplingOn.store(true, memory_order_release);

/*Non-Sampling Period*/
//fprintf(stderr,"Entring while sampling loop\n");
while( samplingOn.load(memory_order_acquire) ){

//fprintf(stderr,"Spinning in while sampling loop\n");
usleep(SAMPLE_QUANTUM);

}
//fprintf(stderr,"SAMPLE PERIOD OVER\n");

}

Expand Down Expand Up @@ -220,7 +234,6 @@ static void init(){
sigfillset(&sigs);
pthread_sigmask(SIG_BLOCK,&sigs,&olds);
#if defined(SAMPLING)
//fprintf(stderr,"Starting sampling thread\n");
__call_real_pthread_create(&samplingThread,NULL,sampleTimer,NULL);
#endif
pthread_sigmask(SIG_SETMASK,&olds,NULL);
Expand Down Expand Up @@ -302,8 +315,6 @@ void MemRead(void *addr){
#endif
#endif

//unsigned long selfThd = (unsigned long)pthread_self();

unsigned long index = ((unsigned long)addr) & ((unsigned long)LWT_SIZE);

#ifdef USE_ATOMICS
Expand All @@ -312,7 +323,6 @@ void MemRead(void *addr){
LWT_Entry e = LWT_table[index];
#endif

//unsigned long me = ((unsigned long)0xffff) & selfThd;
unsigned long you = (e & ((unsigned long)0xffff000000000000));

#if defined(RRRW)
Expand Down Expand Up @@ -424,7 +434,6 @@ void MemWrite(void *addr){
unsigned long newe = ( who | where );

#if defined(PLUGIN) || defined(RRRW) || defined(COMMGRAPH)
//unsigned long me = ((unsigned long)0xffff) & selfThd;
unsigned long you = (e & ((unsigned long)0xffff000000000000));
if( myTid != you ){

Expand Down
21 changes: 21 additions & 0 deletions Runtime/comm_graph.cpp
@@ -1,3 +1,24 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/



#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
Expand Down
19 changes: 19 additions & 0 deletions Runtime/comm_graph.h
@@ -1,3 +1,22 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#include <hash_map>

using namespace std;
Expand Down
19 changes: 19 additions & 0 deletions Runtime/ct_plugin.h
@@ -1,3 +1,22 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#ifdef __cplusplus
extern "C"{
#endif
Expand Down
17 changes: 17 additions & 0 deletions Runtime/ct_plugin_manager.h
@@ -1,4 +1,21 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/
void (*plugin_thd_init)(void);
void (*plugin_thd_deinit)(void);
void (*plugin_init)(void);
Expand Down
19 changes: 19 additions & 0 deletions Runtime/thd_ctr.c
@@ -1,3 +1,22 @@
/*
==CTraps -- A GCC Plugin to instrument shared memory accesses==
Copyright (C) 2012 Brandon Lucia
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, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
Expand Down

0 comments on commit 80923d3

Please sign in to comment.