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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
981173f4
Commit
981173f4
authored
Nov 15, 2024
by
Jaroslava Fiedlerova
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/T-tracer-float-support' into integration_2024_w46 (!3109)
T tracer: support float types in traces
parents
b18f3931
0eb0325b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
1 deletion
+16
-1
common/utils/T/tracer/event.c
common/utils/T/tracer/event.c
+4
-0
common/utils/T/tracer/event.h
common/utils/T/tracer/event.h
+2
-0
common/utils/T/tracer/logger/textlog.c
common/utils/T/tracer/logger/textlog.c
+3
-1
common/utils/T/tracer/utils.c
common/utils/T/tracer/utils.c
+6
-0
common/utils/T/tracer/utils.h
common/utils/T/tracer/utils.h
+1
-0
No files found.
common/utils/T/tracer/event.c
View file @
981173f4
...
...
@@ -94,6 +94,10 @@ event new_event(int type, int length, char *buffer, void *database)
e
.
e
[
i
].
type
=
EVENT_ULONG
;
e
.
e
[
i
].
ul
=
*
(
unsigned
long
*
)(
&
buffer
[
offset
]);
offset
+=
sizeof
(
unsigned
long
);
}
else
if
(
!
strcmp
(
f
.
type
[
i
],
"float"
))
{
e
.
e
[
i
].
type
=
EVENT_FLOAT
;
e
.
e
[
i
].
f
=
*
(
float
*
)(
&
buffer
[
offset
]);
offset
+=
sizeof
(
float
);
}
else
if
(
!
strcmp
(
f
.
type
[
i
],
"string"
))
{
e
.
e
[
i
].
type
=
EVENT_STRING
;
e
.
e
[
i
].
s
=
&
buffer
[
offset
];
...
...
common/utils/T/tracer/event.h
View file @
981173f4
...
...
@@ -13,6 +13,7 @@
enum
event_arg_type
{
EVENT_INT
,
EVENT_ULONG
,
EVENT_FLOAT
,
EVENT_STRING
,
EVENT_BUFFER
};
...
...
@@ -23,6 +24,7 @@ typedef struct {
union
{
int
i
;
unsigned
long
ul
;
float
f
;
char
*
s
;
struct
{
int
bsize
;
...
...
common/utils/T/tracer/logger/textlog.c
View file @
981173f4
...
...
@@ -11,7 +11,7 @@
enum
format_item_type
{
INSTRING
,
INT
,
ULONG
,
STRING
,
BUFFER
};
INT
,
ULONG
,
FLOAT
,
STRING
,
BUFFER
};
struct
format_item
{
enum
format_item_type
type
;
...
...
@@ -67,6 +67,7 @@ static void _event(void *p, event e)
case
INSTRING
:
PUTS
(
&
l
->
o
,
l
->
f
[
i
].
s
);
break
;
case
INT
:
PUTI
(
&
l
->
o
,
e
.
e
[
l
->
f
[
i
].
event_arg
].
i
);
break
;
case
ULONG
:
PUTUL
(
&
l
->
o
,
e
.
e
[
l
->
f
[
i
].
event_arg
].
ul
);
break
;
case
FLOAT
:
PUTF
(
&
l
->
o
,
e
.
e
[
l
->
f
[
i
].
event_arg
].
f
);
break
;
case
STRING
:
PUTS_CLEAN
(
&
l
->
o
,
e
.
e
[
l
->
f
[
i
].
event_arg
].
s
);
break
;
case
BUFFER
:
PUTS
(
&
l
->
o
,
"{buffer size:"
);
...
...
@@ -106,6 +107,7 @@ static int find_argument(char *name, database_event_format f,
*
event_arg
=
i
;
if
(
!
strcmp
(
f
.
type
[
i
],
"int"
))
*
it
=
INT
;
else
if
(
!
strcmp
(
f
.
type
[
i
],
"ulong"
))
*
it
=
ULONG
;
else
if
(
!
strcmp
(
f
.
type
[
i
],
"float"
))
*
it
=
FLOAT
;
else
if
(
!
strcmp
(
f
.
type
[
i
],
"string"
))
*
it
=
STRING
;
else
if
(
!
strcmp
(
f
.
type
[
i
],
"buffer"
))
*
it
=
BUFFER
;
else
return
0
;
...
...
common/utils/T/tracer/utils.c
View file @
981173f4
...
...
@@ -276,3 +276,9 @@ void PUTUL(OBUF *o, unsigned long l) {
sprintf
(
s
,
"%lu"
,
l
);
PUTS
(
o
,
s
);
}
void
PUTF
(
OBUF
*
o
,
float
f
)
{
char
s
[
256
];
sprintf
(
s
,
"%g"
,
f
);
PUTS
(
o
,
s
);
}
common/utils/T/tracer/utils.h
View file @
981173f4
...
...
@@ -50,5 +50,6 @@ void PUTS_CLEAN(OBUF *o, char *s);
void
PUTI
(
OBUF
*
o
,
int
i
);
void
PUTX2
(
OBUF
*
o
,
int
i
);
void
PUTUL
(
OBUF
*
o
,
unsigned
long
i
);
void
PUTF
(
OBUF
*
o
,
float
f
);
#endif
/* _UTILS_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