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
lizhongxiao
OpenXG-RAN
Commits
d4d361ed
Commit
d4d361ed
authored
Mar 20, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
error if -on/-off id/group is not found
parent
f846a9e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
tracer/database.c
tracer/database.c
+13
-6
No files found.
tracer/database.c
View file @
d4d361ed
...
@@ -286,26 +286,29 @@ void list_groups(void *_d)
...
@@ -286,26 +286,29 @@ void list_groups(void *_d)
for
(
i
=
0
;
i
<
d
->
gsize
;
i
++
)
printf
(
"%s
\n
"
,
d
->
g
[
i
].
name
);
for
(
i
=
0
;
i
<
d
->
gsize
;
i
++
)
printf
(
"%s
\n
"
,
d
->
g
[
i
].
name
);
}
}
static
void
onoff_id
(
database
*
d
,
char
*
name
,
int
*
a
,
int
onoff
)
static
int
onoff_id
(
database
*
d
,
char
*
name
,
int
*
a
,
int
onoff
)
{
{
id
*
i
;
id
*
i
;
i
=
bsearch
(
&
(
id
){
name
:
name
},
d
->
i
,
d
->
isize
,
sizeof
(
id
),
id_cmp
);
i
=
bsearch
(
&
(
id
){
name
:
name
},
d
->
i
,
d
->
isize
,
sizeof
(
id
),
id_cmp
);
if
(
i
==
NULL
)
return
;
if
(
i
==
NULL
)
return
0
;
a
[
i
->
id
]
=
onoff
;
a
[
i
->
id
]
=
onoff
;
printf
(
"turning %s %s
\n
"
,
onoff
?
"ON"
:
"OFF"
,
name
);
printf
(
"turning %s %s
\n
"
,
onoff
?
"ON"
:
"OFF"
,
name
);
return
1
;
}
}
static
void
onoff_group
(
database
*
d
,
char
*
name
,
int
*
a
,
int
onoff
)
static
int
onoff_group
(
database
*
d
,
char
*
name
,
int
*
a
,
int
onoff
)
{
{
group
*
g
;
group
*
g
;
int
i
;
int
i
;
g
=
bsearch
(
&
(
group
){
name
:
name
},
d
->
g
,
d
->
gsize
,
sizeof
(
group
),
group_cmp
);
g
=
bsearch
(
&
(
group
){
name
:
name
},
d
->
g
,
d
->
gsize
,
sizeof
(
group
),
group_cmp
);
if
(
g
==
NULL
)
return
;
if
(
g
==
NULL
)
return
0
;
for
(
i
=
0
;
i
<
g
->
size
;
i
++
)
onoff_id
(
d
,
g
->
ids
[
i
],
a
,
onoff
);
for
(
i
=
0
;
i
<
g
->
size
;
i
++
)
onoff_id
(
d
,
g
->
ids
[
i
],
a
,
onoff
);
return
1
;
}
}
void
on_off
(
void
*
_d
,
char
*
item
,
int
*
a
,
int
onoff
)
void
on_off
(
void
*
_d
,
char
*
item
,
int
*
a
,
int
onoff
)
{
{
int
done
;
database
*
d
=
_d
;
database
*
d
=
_d
;
int
i
;
int
i
;
if
(
item
==
NULL
)
{
if
(
item
==
NULL
)
{
...
@@ -313,6 +316,10 @@ void on_off(void *_d, char *item, int *a, int onoff)
...
@@ -313,6 +316,10 @@ void on_off(void *_d, char *item, int *a, int onoff)
printf
(
"turning %s all traces
\n
"
,
onoff
?
"ON"
:
"OFF"
);
printf
(
"turning %s all traces
\n
"
,
onoff
?
"ON"
:
"OFF"
);
return
;
return
;
}
}
onoff_group
(
d
,
item
,
a
,
onoff
);
done
=
onoff_group
(
d
,
item
,
a
,
onoff
);
onoff_id
(
d
,
item
,
a
,
onoff
);
done
+=
onoff_id
(
d
,
item
,
a
,
onoff
);
if
(
done
==
0
)
{
printf
(
"ERROR: ID/group '%s' not found in database
\n
"
,
item
);
exit
(
1
);
}
}
}
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