Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alex037yang
OpenXG-RAN
Commits
d47e3074
Commit
d47e3074
authored
Jun 23, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename T_cache to T_local_cache in T/local_tracer.c
needed because of the following commit
parent
6a809e84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
common/utils/T/local_tracer.c
common/utils/T/local_tracer.c
+10
-10
No files found.
common/utils/T/local_tracer.c
View file @
d47e3074
...
@@ -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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment