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
canghaiwuhen
OpenXG-RAN
Commits
a9d6e04c
Commit
a9d6e04c
authored
Oct 09, 2017
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
T: modify extract_input_subframe to dump several subframes
parent
8e6cc019
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
common/utils/T/tracer/extract_input_subframe.c
common/utils/T/tracer/extract_input_subframe.c
+37
-3
No files found.
common/utils/T/tracer/extract_input_subframe.c
View file @
a9d6e04c
...
...
@@ -12,7 +12,9 @@ void usage(void)
"usage: [options] <file> <frame> <subframe>
\n
"
"options:
\n
"
" -d <database file> this option is mandatory
\n
"
" -o <output file> this option is mandatory
\n
"
" -v verbose
\n
"
" -c <number of subframes> default to 1
\n
"
);
exit
(
1
);
}
...
...
@@ -25,15 +27,23 @@ int main(int n, char **v)
int
input_event_id
;
database_event_format
f
;
char
*
file
=
NULL
;
char
*
output_file
=
NULL
;
FILE
*
out
;
int
fd
;
int
frame
=
-
1
,
subframe
=
-
1
;
int
frame_arg
,
subframe_arg
,
buffer_arg
;
int
verbose
=
0
;
int
number_of_subframes
=
1
;
int
processed_subframes
=
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
],
"-o"
))
{
if
(
i
>
n
-
2
)
usage
();
output_file
=
v
[
++
i
];
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-c"
))
{
if
(
i
>
n
-
2
)
usage
();
number_of_subframes
=
atoi
(
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
;
}
...
...
@@ -47,6 +57,19 @@ int main(int n, char **v)
exit
(
1
);
}
if
(
number_of_subframes
<
1
)
{
printf
(
"bad value for option -c, must be at least 1 and is %d
\n
"
,
number_of_subframes
);
exit
(
1
);
}
if
(
output_file
==
NULL
)
{
printf
(
"gimme -o <output file>, thanks
\n
"
);
exit
(
1
);
}
out
=
fopen
(
output_file
,
"w"
);
if
(
out
==
NULL
){
perror
(
output_file
);
exit
(
1
);}
database
=
parse_database
(
database_filename
);
load_config_file
(
database_filename
);
...
...
@@ -99,11 +122,22 @@ 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
;
if
(
fwrite
(
e
.
e
[
buffer_arg
].
b
,
e
.
e
[
buffer_arg
].
bsize
,
1
,
out
)
!=
1
)
{
perror
(
output_file
);
exit
(
1
);
}
processed_subframes
++
;
number_of_subframes
--
;
if
(
!
number_of_subframes
)
{
if
(
fclose
(
out
))
perror
(
output_file
);
printf
(
"%d subframes dumped
\n
"
,
processed_subframes
);
return
0
;
}
subframe
++
;
if
(
subframe
==
10
)
{
subframe
=
0
;
frame
=
(
frame
+
1
)
%
1024
;
}
}
printf
(
"frame %d subframe %d not found
\n
"
,
frame
,
subframe
);
printf
(
"%d subframes dumped
\n
"
,
processed_subframes
);
fclose
(
out
);
return
0
;
}
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