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
ZhouShuya
OpenXG-RAN
Commits
43f99ff6
Commit
43f99ff6
authored
May 11, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert to dB in ttilog if requested
parent
70ebbd7e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
common/utils/T/tracer/logger/ttilog.c
common/utils/T/tracer/logger/ttilog.c
+6
-1
common/utils/T/tracer/logger/ttilog.h
common/utils/T/tracer/logger/ttilog.h
+1
-1
No files found.
common/utils/T/tracer/logger/ttilog.c
View file @
43f99ff6
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <math.h>
struct
ttilog
{
struct
ttilog
{
char
*
event_name
;
char
*
event_name
;
...
@@ -16,6 +17,7 @@ struct ttilog {
...
@@ -16,6 +17,7 @@ struct ttilog {
/* list of views */
/* list of views */
view
**
v
;
view
**
v
;
int
vsize
;
int
vsize
;
int
convert_to_dB
;
};
};
static
void
_event
(
void
*
p
,
event
e
)
static
void
_event
(
void
*
p
,
event
e
)
...
@@ -33,13 +35,15 @@ static void _event(void *p, event e)
...
@@ -33,13 +35,15 @@ static void _event(void *p, event e)
default:
printf
(
"%s:%d: unsupported type
\n
"
,
__FILE__
,
__LINE__
);
abort
();
default:
printf
(
"%s:%d: unsupported type
\n
"
,
__FILE__
,
__LINE__
);
abort
();
}
}
if
(
l
->
convert_to_dB
)
value
=
10
*
log10
(
value
);
for
(
i
=
0
;
i
<
l
->
vsize
;
i
++
)
for
(
i
=
0
;
i
<
l
->
vsize
;
i
++
)
l
->
v
[
i
]
->
append
(
l
->
v
[
i
],
frame
,
subframe
,
value
);
l
->
v
[
i
]
->
append
(
l
->
v
[
i
],
frame
,
subframe
,
value
);
}
}
ttilog
*
new_ttilog
(
event_handler
*
h
,
void
*
database
,
ttilog
*
new_ttilog
(
event_handler
*
h
,
void
*
database
,
char
*
event_name
,
char
*
frame_varname
,
char
*
subframe_varname
,
char
*
event_name
,
char
*
frame_varname
,
char
*
subframe_varname
,
char
*
data_varname
)
char
*
data_varname
,
int
convert_to_dB
)
{
{
struct
ttilog
*
ret
;
struct
ttilog
*
ret
;
int
event_id
;
int
event_id
;
...
@@ -50,6 +54,7 @@ ttilog *new_ttilog(event_handler *h, void *database,
...
@@ -50,6 +54,7 @@ ttilog *new_ttilog(event_handler *h, void *database,
ret
->
event_name
=
strdup
(
event_name
);
if
(
ret
->
event_name
==
NULL
)
abort
();
ret
->
event_name
=
strdup
(
event_name
);
if
(
ret
->
event_name
==
NULL
)
abort
();
ret
->
database
=
database
;
ret
->
database
=
database
;
ret
->
convert_to_dB
=
convert_to_dB
;
event_id
=
event_id_from_name
(
database
,
event_name
);
event_id
=
event_id_from_name
(
database
,
event_name
);
...
...
common/utils/T/tracer/logger/ttilog.h
View file @
43f99ff6
...
@@ -5,7 +5,7 @@ typedef void ttilog;
...
@@ -5,7 +5,7 @@ typedef void ttilog;
ttilog
*
new_ttilog
(
void
*
event_handler
,
void
*
database
,
ttilog
*
new_ttilog
(
void
*
event_handler
,
void
*
database
,
char
*
event_name
,
char
*
frame_varname
,
char
*
subframe_varname
,
char
*
event_name
,
char
*
frame_varname
,
char
*
subframe_varname
,
char
*
data_varname
);
char
*
data_varname
,
int
convert_to_dB
);
#include "view/view.h"
#include "view/view.h"
...
...
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