Commit d47e3074 authored by Cedric Roux's avatar Cedric Roux

rename T_cache to T_local_cache in T/local_tracer.c

needed because of the following commit
parent 6a809e84
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "T_defs.h" #include "T_defs.h"
#include "T_IDs.h" #include "T_IDs.h"
static T_cache_t *T_cache; static T_cache_t *T_local_cache;
static int T_busylist_head; static int T_busylist_head;
typedef struct databuf { typedef struct databuf {
...@@ -287,7 +287,7 @@ static void forward(void *_forwarder, char *buf, int size) ...@@ -287,7 +287,7 @@ static void forward(void *_forwarder, char *buf, int size)
static void wait_message(void) static void wait_message(void)
{ {
while (T_cache[T_busylist_head].busy == 0) usleep(1000); while (T_local_cache[T_busylist_head].busy == 0) usleep(1000);
} }
static void init_shm(void) static void init_shm(void)
...@@ -297,17 +297,17 @@ static void init_shm(void) ...@@ -297,17 +297,17 @@ static void init_shm(void)
if (s == -1) { perror(T_SHM_FILENAME); abort(); } if (s == -1) { perror(T_SHM_FILENAME); abort(); }
if (ftruncate(s, T_CACHE_SIZE * sizeof(T_cache_t))) if (ftruncate(s, T_CACHE_SIZE * sizeof(T_cache_t)))
{ perror(T_SHM_FILENAME); abort(); } { perror(T_SHM_FILENAME); abort(); }
T_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t), T_local_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t),
PROT_READ | PROT_WRITE, MAP_SHARED, s, 0); PROT_READ | PROT_WRITE, MAP_SHARED, s, 0);
if (T_cache == NULL) if (T_local_cache == NULL)
{ perror(T_SHM_FILENAME); abort(); } { perror(T_SHM_FILENAME); abort(); }
close(s); close(s);
/* let's garbage the memory to catch some potential problems /* let's garbage the memory to catch some potential problems
* (think multiprocessor sync issues, barriers, etc.) * (think multiprocessor sync issues, barriers, etc.)
*/ */
memset(T_cache, 0x55, T_CACHE_SIZE * sizeof(T_cache_t)); memset(T_local_cache, 0x55, T_CACHE_SIZE * sizeof(T_cache_t));
for (i = 0; i < T_CACHE_SIZE; i++) T_cache[i].busy = 0; for (i = 0; i < T_CACHE_SIZE; i++) T_local_cache[i].busy = 0;
} }
void T_local_tracer_main(int remote_port, int wait_for_tracer, void T_local_tracer_main(int remote_port, int wait_for_tracer,
...@@ -335,9 +335,9 @@ void T_local_tracer_main(int remote_port, int wait_for_tracer, ...@@ -335,9 +335,9 @@ void T_local_tracer_main(int remote_port, int wait_for_tracer,
while (1) { while (1) {
wait_message(); wait_message();
__sync_synchronize(); __sync_synchronize();
forward(f, T_cache[T_busylist_head].buffer, forward(f, T_local_cache[T_busylist_head].buffer,
T_cache[T_busylist_head].length); T_local_cache[T_busylist_head].length);
T_cache[T_busylist_head].busy = 0; T_local_cache[T_busylist_head].busy = 0;
T_busylist_head++; T_busylist_head++;
T_busylist_head &= T_CACHE_SIZE - 1; T_busylist_head &= T_CACHE_SIZE - 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment