Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eric Vidal
66
Commits
3e008d98
Commit
3e008d98
authored
1 year ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
display contents as a graph. Remove init field
parent
30abc76e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib66/exec/ssexec_tree_status.c
+18
-10
18 additions, 10 deletions
src/lib66/exec/ssexec_tree_status.c
with
18 additions
and
10 deletions
src/lib66/exec/ssexec_tree_status.c
+
18
−
10
View file @
3e008d98
...
...
@@ -25,6 +25,7 @@
#include
<oblibs/types.h>
#include
<oblibs/string.h>
#include
<oblibs/files.h>
#include
<oblibs/stack.h>
#include
<skalibs/sgetopt.h>
#include
<skalibs/genalloc.h>
...
...
@@ -118,6 +119,10 @@ static void info_display_enabled(char const *field,char const *treename)
static
void
info_display_init
(
char
const
*
field
,
char
const
*
treename
)
{
/* it not possible to write the resolve file of a tree at boot
if the filesystem is ro. So consider tree as never initiated.
ssexec_{start,stop,free,...} will deal with the live state of
the services anyway.
unsigned int init = tree_isinitialized(pinfo->base.s, treename) ;
if (init == -1) log_dieu(LOG_EXIT_SYS, "resolve file of tree: ", treename) ;
...
...
@@ -128,6 +133,7 @@ static void info_display_init(char const *field,char const *treename)
if (buffer_putsflush(buffer_1,"\n") == -1)
log_dieusys(LOG_EXIT_SYS,"write to stdout") ;
*/
}
static
void
info_display_allow
(
char
const
*
field
,
char
const
*
treename
)
...
...
@@ -346,14 +352,23 @@ static void info_display_contents(char const *field, char const *treename)
size_t
padding
=
1
;
graph_t
graph
=
GRAPH_ZERO
;
stralloc
sa
=
STRALLOC_ZERO
;
unsigned
int
areslen
=
0
;
resolve_service_t
ares
[
SS_MAX_SERVICE
+
1
]
;
memset
(
ares
,
0
,
(
SS_MAX_SERVICE
+
1
)
*
sizeof
(
resolve_service_t
))
;
if
(
NOFIELD
)
padding
=
info_display_field_name
(
field
)
;
else
{
field
=
0
;
padding
=
0
;
}
graph_build_service
(
&
graph
,
ares
,
&
areslen
,
pinfo
,
STATE_FLAGS_TOPROPAGATE
|
STATE_FLAGS_WANTUP
)
;
if
(
!
resolve_get_field_tosa_g
(
&
sa
,
pinfo
->
base
.
s
,
treename
,
DATA_TREE
,
E_RESOLVE_TREE_CONTENTS
))
log_dieu
(
LOG_EXIT_SYS
,
"get field contents of tree: "
,
treename
)
;
if
(
!
sa
.
len
)
goto
empty
;
service_graph_g
(
sa
.
s
,
sa
.
len
,
&
graph
,
ares
,
&
areslen
,
pinfo
,
STATE_FLAGS_TOPROPAGATE
|
STATE_FLAGS_WANTUP
)
;
if
(
!
areslen
)
goto
empty
;
...
...
@@ -365,21 +380,13 @@ static void info_display_contents(char const *field, char const *treename)
depth_t
d
=
info_graph_init
()
;
if
(
!
info_walk
(
&
graph
,
0
,
treename
,
&
info_graph_display_service
,
0
,
REVERSE
,
&
d
,
padding
,
T_STYLE
))
if
(
!
info_walk
(
&
graph
,
0
,
0
,
&
info_graph_display_service
,
0
,
REVERSE
,
&
d
,
padding
,
T_STYLE
))
log_dieu
(
LOG_EXIT_SYS
,
"display the graph dependencies"
)
;
goto
freed
;
}
else
{
stralloc
sa
=
STRALLOC_ZERO
;
if
(
!
resolve_get_field_tosa_g
(
&
sa
,
pinfo
->
base
.
s
,
treename
,
DATA_TREE
,
E_RESOLVE_TREE_CONTENTS
))
log_dieu
(
LOG_EXIT_SYS
,
"get tree services list of: "
,
treename
)
;
if
(
!
sa
.
len
)
goto
empty
;
if
(
REVERSE
)
if
(
!
sastr_reverse
(
&
sa
))
log_dieu
(
LOG_EXIT_SYS
,
"reverse the dependencies list"
)
;
...
...
@@ -407,6 +414,7 @@ static void info_display_contents(char const *field, char const *treename)
freed:
graph_free_all
(
&
graph
)
;
stralloc_free
(
&
sa
)
;
}
static
void
info_display_all
(
char
const
*
treename
,
int
*
what
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment