Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
02931418
Commit
02931418
authored
7 years ago
by
Cedric Roux
Browse files
Options
Downloads
Patches
Plain Diff
T tracer: add a new tool: extract_input_subframe
This program extracts a given subframe from a recorded trace.
parent
17b9a9e9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/utils/T/tracer/Makefile
+7
-2
7 additions, 2 deletions
common/utils/T/tracer/Makefile
common/utils/T/tracer/extract_input_subframe.c
+109
-0
109 additions, 0 deletions
common/utils/T/tracer/extract_input_subframe.c
with
116 additions
and
2 deletions
common/utils/T/tracer/Makefile
+
7
−
2
View file @
02931418
...
@@ -5,7 +5,8 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I.
...
@@ -5,7 +5,8 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I.
LIBS
=
-lX11
-lm
-lpng
-lXft
LIBS
=
-lX11
-lm
-lpng
-lXft
all
:
record replay extract_config textlog enb ue vcd macpdu2wireshark
all
:
record replay extract_config textlog enb ue vcd macpdu2wireshark
\
extract_input_subframe
record
:
utils.o record.o database.o config.o
record
:
utils.o record.o database.o config.o
$(
CC
)
$(
CFLAGS
)
-o
record
$^
$(
LIBS
)
$(
CC
)
$(
CFLAGS
)
-o
record
$^
$(
LIBS
)
...
@@ -16,6 +17,10 @@ replay: utils.o replay.o
...
@@ -16,6 +17,10 @@ replay: utils.o replay.o
extract_config
:
extract_config.o
extract_config
:
extract_config.o
$(
CC
)
$(
CFLAGS
)
-o
extract_config
$^
$(
LIBS
)
$(
CC
)
$(
CFLAGS
)
-o
extract_config
$^
$(
LIBS
)
extract_input_subframe
:
extract_input_subframe.o database.o event.o utils.o
\
config.o
$(
CC
)
$(
CFLAGS
)
-o
$@
$^
$(
LIBS
)
textlog
:
utils.o textlog.o database.o event.o handler.o config.o
\
textlog
:
utils.o textlog.o database.o event.o handler.o config.o
\
event_selector.o view/view.a gui/gui.a logger/logger.a
\
event_selector.o view/view.a gui/gui.a logger/logger.a
\
filter/filter.a
filter/filter.a
...
@@ -59,7 +64,7 @@ filter/filter.a:
...
@@ -59,7 +64,7 @@ filter/filter.a:
clean
:
clean
:
rm
-f
*
.o core tracer_remote textlog enb ue vcd record replay
rm
-f
*
.o core tracer_remote textlog enb ue vcd record replay
rm
-f
extract_config macpdu2wireshark
rm
-f
extract_config macpdu2wireshark
extract_input_subframe
cd
gui
&&
make clean
cd
gui
&&
make clean
cd
view
&&
make clean
cd
view
&&
make clean
cd
logger
&&
make clean
cd
logger
&&
make clean
...
...
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/extract_input_subframe.c
0 → 100644
+
109
−
0
View file @
02931418
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<fcntl.h>
#include
"database.h"
#include
"event.h"
#include
"config.h"
void
usage
(
void
)
{
printf
(
"usage: [options] <file> <frame> <subframe>
\n
"
"options:
\n
"
" -d <database file> this option is mandatory
\n
"
" -v verbose
\n
"
);
exit
(
1
);
}
int
main
(
int
n
,
char
**
v
)
{
char
*
database_filename
=
NULL
;
void
*
database
;
int
i
;
int
input_event_id
;
database_event_format
f
;
char
*
file
=
NULL
;
int
fd
;
int
frame
=
-
1
,
subframe
=
-
1
;
int
frame_arg
,
subframe_arg
,
buffer_arg
;
int
verbose
=
0
;
for
(
i
=
1
;
i
<
n
;
i
++
)
{
if
(
!
strcmp
(
v
[
i
],
"-h"
)
||
!
strcmp
(
v
[
i
],
"--help"
))
usage
();
if
(
!
strcmp
(
v
[
i
],
"-d"
))
{
if
(
i
>
n
-
2
)
usage
();
database_filename
=
v
[
++
i
];
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-v"
))
{
verbose
=
1
;
continue
;
}
if
(
file
==
NULL
)
{
file
=
v
[
i
];
continue
;
}
if
(
frame
==
-
1
)
{
frame
=
atoi
(
v
[
i
]);
continue
;
}
if
(
subframe
==
-
1
)
{
subframe
=
atoi
(
v
[
i
]);
continue
;
}
usage
();
}
if
(
file
==
NULL
||
frame
==
-
1
||
subframe
==
-
1
)
usage
();
if
(
database_filename
==
NULL
)
{
printf
(
"ERROR: provide a database file (-d)
\n
"
);
exit
(
1
);
}
database
=
parse_database
(
database_filename
);
load_config_file
(
database_filename
);
input_event_id
=
event_id_from_name
(
database
,
"ENB_PHY_INPUT_SIGNAL"
);
f
=
get_format
(
database
,
input_event_id
);
frame_arg
=
subframe_arg
=
buffer_arg
=
-
1
;
for
(
i
=
0
;
i
<
f
.
count
;
i
++
)
{
if
(
!
strcmp
(
f
.
name
[
i
],
"frame"
))
{
if
(
frame_arg
!=
-
1
)
goto
err
;
if
(
strcmp
(
f
.
type
[
i
],
"int"
))
goto
err
;
frame_arg
=
i
;
}
if
(
!
strcmp
(
f
.
name
[
i
],
"subframe"
))
{
if
(
subframe_arg
!=
-
1
)
goto
err
;
if
(
strcmp
(
f
.
type
[
i
],
"int"
))
goto
err
;
subframe_arg
=
i
;
}
if
(
!
strcmp
(
f
.
name
[
i
],
"rxdata"
))
{
if
(
buffer_arg
!=
-
1
)
goto
err
;
if
(
strcmp
(
f
.
type
[
i
],
"buffer"
))
goto
err
;
buffer_arg
=
i
;
}
continue
;
err:
printf
(
"cannot deal with ENB_PHY_INPUT_SIGNAL from database file
\n
"
);
exit
(
1
);
}
if
(
frame_arg
==
-
1
||
subframe_arg
==
-
1
||
buffer_arg
==
-
1
)
goto
err
;
fd
=
open
(
file
,
O_RDONLY
);
if
(
fd
==
-
1
)
{
perror
(
file
);
exit
(
1
);
}
/* get wanted frame/subframe */
while
(
1
)
{
char
v
[
T_BUFFER_MAX
];
event
e
;
e
=
get_event
(
fd
,
v
,
database
);
if
(
e
.
type
==
-
1
)
break
;
if
(
e
.
type
!=
input_event_id
)
continue
;
if
(
verbose
)
printf
(
"input frame %d subframe %d size %d
\n
"
,
e
.
e
[
frame_arg
].
i
,
e
.
e
[
subframe_arg
].
i
,
e
.
e
[
buffer_arg
].
bsize
);
if
(
!
(
frame
==
e
.
e
[
frame_arg
].
i
&&
subframe
==
e
.
e
[
subframe_arg
].
i
))
continue
;
#if 0
for (i = 0; i < e.e[buffer_arg].bsize/2; i++) {
short *x = e.e[buffer_arg].b;
x[i] *= 14;
}
#endif
fwrite
(
e
.
e
[
buffer_arg
].
b
,
e
.
e
[
buffer_arg
].
bsize
,
1
,
stdout
);
fflush
(
stdout
);
return
0
;
}
printf
(
"frame %d subframe %d not found
\n
"
,
frame
,
subframe
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment