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
wangjie
OpenXG-RAN
Commits
d89bfa72
Commit
d89bfa72
authored
Nov 02, 2018
by
Cedric Roux
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/T-fixes-w43' into develop_integration_2018_w44
parents
e46031fe
633534c2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
6 deletions
+48
-6
common/utils/T/tracer/Makefile
common/utils/T/tracer/Makefile
+5
-0
common/utils/T/tracer/extract.c
common/utils/T/tracer/extract.c
+23
-2
common/utils/T/tracer/logger/logger.h
common/utils/T/tracer/logger/logger.h
+1
-0
common/utils/T/tracer/logger/textlog.c
common/utils/T/tracer/logger/textlog.c
+14
-3
common/utils/T/tracer/textlog.c
common/utils/T/tracer/textlog.c
+5
-1
No files found.
common/utils/T/tracer/Makefile
View file @
d89bfa72
...
...
@@ -60,6 +60,11 @@ macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
multi
:
multi.o utils.o database.o config.o
$(CC)
$(CFLAGS)
-o
multi
$^
$(LIBS)
multi.o
:
../T_IDs.h
../T_IDs.h
:
cd
..
&&
$(MAKE)
.PHONY
:
all gui/gui.a view/view.a logger/logger.a filter/filter.a
gui/gui.a
:
...
...
common/utils/T/tracer/extract.c
View file @
d89bfa72
...
...
@@ -16,6 +16,8 @@ void usage(void)
" -f <name> <value> field 'name' of 'event' has to match 'value'
\n
"
" type of 'name' must be int
\n
"
" (you can use several -f options)
\n
"
" -after <raw time> <nsec> 'event' time has to be greater than this
\n
"
" -count <n> dump 'n' matching events (less if EOF reached)
\n
"
);
exit
(
1
);
}
...
...
@@ -51,6 +53,10 @@ int main(int n, char **v)
int
filter_count
=
0
;
int
buffer_arg
;
int
found
;
int
count
=
1
;
int
check_time
=
0
;
time_t
sec
;
long
nsec
;
for
(
i
=
1
;
i
<
n
;
i
++
)
{
if
(
!
strcmp
(
v
[
i
],
"-h"
)
||
!
strcmp
(
v
[
i
],
"--help"
))
usage
();
...
...
@@ -63,6 +69,14 @@ int main(int n, char **v)
filter_value
[
filter_count
++
]
=
atoi
(
v
[
++
i
]);
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-after"
))
{
if
(
i
>
n
-
3
)
usage
();
check_time
=
1
;
sec
=
atoll
(
v
[
++
i
]);
nsec
=
atol
(
v
[
++
i
]);
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-count"
))
{
if
(
i
>
n
-
2
)
usage
();
count
=
atoi
(
v
[
++
i
]);
continue
;
}
if
(
file
==
NULL
)
{
file
=
v
[
i
];
continue
;
}
if
(
event_name
==
NULL
)
{
event_name
=
v
[
i
];
continue
;
}
if
(
buffer_name
==
NULL
)
{
buffer_name
=
v
[
i
];
continue
;
}
...
...
@@ -111,13 +125,20 @@ int main(int n, char **v)
break
;
if
(
i
!=
filter_count
)
continue
;
if
(
check_time
&&
!
(
e
.
sending_time
.
tv_sec
>
sec
||
(
e
.
sending_time
.
tv_sec
==
sec
&&
e
.
sending_time
.
tv_nsec
>=
nsec
)))
continue
;
if
(
fwrite
(
e
.
e
[
buffer_arg
].
b
,
e
.
e
[
buffer_arg
].
bsize
,
1
,
out
)
!=
1
)
{
perror
(
output_file
);
exit
(
1
);
}
found
=
1
;
break
;
found
++
;
if
(
found
==
count
)
break
;
}
if
(
found
==
0
)
printf
(
"ERROR: event not found
\n
"
);
if
(
found
!=
count
)
printf
(
"WARNING: dumped %d events (wanted %d)
\n
"
,
found
,
count
);
fclose
(
out
);
...
...
common/utils/T/tracer/logger/logger.h
View file @
d89bfa72
...
...
@@ -30,6 +30,7 @@ void framelog_set_skip(logger *_this, int skip_delay);
void
framelog_set_update_only_at_sf9
(
logger
*
_this
,
int
update_only_at_sf9
);
void
textlog_dump_buffer
(
logger
*
_this
,
int
dump_buffer
);
void
textlog_raw_time
(
logger
*
_this
,
int
raw_time
);
#include "view/view.h"
...
...
common/utils/T/tracer/logger/textlog.c
View file @
d89bfa72
...
...
@@ -33,6 +33,7 @@ struct textlog {
/* local output buffer */
OBUF
o
;
int
dump_buffer
;
int
raw_time
;
};
static
void
_event
(
void
*
p
,
event
e
)
...
...
@@ -51,9 +52,13 @@ static void _event(void *p, event e)
#ifdef T_SEND_TIME
t
=
localtime
(
&
e
.
sending_time
.
tv_sec
);
/* round tv_nsec to nearest millisecond */
sprintf
(
tt
,
"%2.2d:%2.2d:%2.2d.%9.9ld: "
,
t
->
tm_hour
,
t
->
tm_min
,
t
->
tm_sec
,
e
.
sending_time
.
tv_nsec
);
if
(
l
->
raw_time
)
sprintf
(
tt
,
"%2.2d:%2.2d:%2.2d.%9.9ld [%ld]: "
,
t
->
tm_hour
,
t
->
tm_min
,
t
->
tm_sec
,
e
.
sending_time
.
tv_nsec
,
e
.
sending_time
.
tv_sec
);
else
sprintf
(
tt
,
"%2.2d:%2.2d:%2.2d.%9.9ld: "
,
t
->
tm_hour
,
t
->
tm_min
,
t
->
tm_sec
,
e
.
sending_time
.
tv_nsec
);
PUTS
(
&
l
->
o
,
tt
);
#endif
...
...
@@ -215,3 +220,9 @@ void textlog_dump_buffer(logger *_this, int dump_buffer)
struct
textlog
*
l
=
_this
;
l
->
dump_buffer
=
dump_buffer
;
}
void
textlog_raw_time
(
logger
*
_this
,
int
raw_time
)
{
struct
textlog
*
l
=
_this
;
l
->
raw_time
=
raw_time
;
}
common/utils/T/tracer/textlog.c
View file @
d89bfa72
...
...
@@ -52,6 +52,7 @@ void usage(void)
" they will be processed in order
\n
"
" by default, all is off
\n
"
" -full also dump buffers' content
\n
"
" -raw-time also prints 'raw time'
\n
"
" -ip <host> connect to given IP address (default %s)
\n
"
" -p <port> connect to given port (default %d)
\n
"
" -x GUI output
\n
"
...
...
@@ -91,6 +92,7 @@ int main(int n, char **v)
int
gui_active
=
1
;
textlog_data
textlog_data
;
int
full
=
0
;
int
raw_time
=
0
;
/* write on a socket fails if the other end is closed and we get SIGPIPE */
if
(
signal
(
SIGPIPE
,
SIG_IGN
)
==
SIG_ERR
)
abort
();
...
...
@@ -117,6 +119,7 @@ int main(int n, char **v)
if
(
!
strcmp
(
v
[
i
],
"-debug-gui"
))
{
gui_logd
=
1
;
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-no-gui"
))
{
gui_active
=
0
;
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-full"
))
{
full
=
1
;
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-raw-time"
))
{
raw_time
=
1
;
continue
;
}
usage
();
}
...
...
@@ -162,6 +165,7 @@ int main(int n, char **v)
// "ev: {} eNB_id [eNB_ID] frame [frame] subframe [subframe]");
logger_add_view
(
textlog
,
out
);
if
(
full
)
textlog_dump_buffer
(
textlog
,
1
);
if
(
raw_time
)
textlog_raw_time
(
textlog
,
1
);
free
(
name
);
free
(
desc
);
}
...
...
@@ -187,7 +191,7 @@ int main(int n, char **v)
while
(
1
)
{
event
e
;
e
=
get_event
(
textlog_data
.
socket
,
&
ebuf
,
database
);
if
(
e
.
type
==
-
1
)
abort
()
;
if
(
e
.
type
==
-
1
)
break
;
handle_event
(
h
,
e
);
}
...
...
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