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
zzha zzha
OpenXG-RAN
Commits
7dbb2b8c
Commit
7dbb2b8c
authored
Apr 27, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
id management / bug fixes in database
parent
f0a70414
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
common/utils/T/tracer/database.c
common/utils/T/tracer/database.c
+15
-3
common/utils/T/tracer/database.h
common/utils/T/tracer/database.h
+1
-0
No files found.
common/utils/T/tracer/database.c
View file @
7dbb2b8c
...
@@ -27,6 +27,7 @@ typedef struct {
...
@@ -27,6 +27,7 @@ typedef struct {
int
isize
;
int
isize
;
group
*
g
;
group
*
g
;
int
gsize
;
int
gsize
;
int
*
pos
;
}
database
;
}
database
;
typedef
struct
{
typedef
struct
{
...
@@ -324,6 +325,11 @@ void *parse_database(char *filename)
...
@@ -324,6 +325,11 @@ void *parse_database(char *filename)
free
(
p
.
name
.
data
);
free
(
p
.
name
.
data
);
free
(
p
.
value
.
data
);
free
(
p
.
value
.
data
);
/* setup pos */
r
->
pos
=
malloc
(
sizeof
(
int
)
*
r
->
isize
);
if
(
r
->
pos
==
NULL
)
abort
();
for
(
i
=
0
;
i
<
r
->
isize
;
i
++
)
r
->
pos
[
r
->
i
[
i
].
id
]
=
i
;
return
r
;
return
r
;
}
}
...
@@ -410,6 +416,12 @@ void on_off(void *_d, char *item, int *a, int onoff)
...
@@ -410,6 +416,12 @@ void on_off(void *_d, char *item, int *a, int onoff)
}
}
}
}
char
*
event_name_from_id
(
void
*
_database
,
int
id
)
{
database
*
d
=
_database
;
return
d
->
i
[
d
->
pos
[
id
]].
name
;
}
database_event_format
get_format
(
void
*
_database
,
int
event_id
)
database_event_format
get_format
(
void
*
_database
,
int
event_id
)
{
{
database
*
d
=
_database
;
database
*
d
=
_database
;
...
@@ -420,9 +432,9 @@ database_event_format get_format(void *_database, int event_id)
...
@@ -420,9 +432,9 @@ database_event_format get_format(void *_database, int event_id)
abort
();
abort
();
}
}
ret
.
type
=
d
->
i
[
event_id
].
arg_type
;
ret
.
type
=
d
->
i
[
d
->
pos
[
event_id
]
].
arg_type
;
ret
.
name
=
d
->
i
[
event_id
].
arg_name
;
ret
.
name
=
d
->
i
[
d
->
pos
[
event_id
]
].
arg_name
;
ret
.
count
=
d
->
i
[
event_id
].
asize
;
ret
.
count
=
d
->
i
[
d
->
pos
[
event_id
]
].
asize
;
return
ret
;
return
ret
;
}
}
common/utils/T/tracer/database.h
View file @
7dbb2b8c
...
@@ -7,6 +7,7 @@ void dump_database(void *database);
...
@@ -7,6 +7,7 @@ void dump_database(void *database);
void
list_ids
(
void
*
database
);
void
list_ids
(
void
*
database
);
void
list_groups
(
void
*
database
);
void
list_groups
(
void
*
database
);
void
on_off
(
void
*
d
,
char
*
item
,
int
*
a
,
int
onoff
);
void
on_off
(
void
*
d
,
char
*
item
,
int
*
a
,
int
onoff
);
char
*
event_name_from_id
(
void
*
database
,
int
id
);
/****************************************************************************/
/****************************************************************************/
/* get format of an event */
/* get format of an event */
...
...
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