summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-06-10 14:50:55 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-06-10 14:50:55 +0000
commit8e64c16ecbf02f9ed28e7911dd3a67f6e75d1056 (patch)
tree74dae72b1b1e3090e74b01db457324c80f257d69
parent6484a6c8a2ff823be4fe8fd03c7ea76e371788ed (diff)
downloads6-rc-8e64c16ecbf02f9ed28e7911dd3a67f6e75d1056.tar.xz
Add debug instructions for bundle resolution...
-rw-r--r--src/s6-rc/s6-rc-compile.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/s6-rc/s6-rc-compile.c b/src/s6-rc/s6-rc-compile.c
index 9ddd371..9dad40f 100644
--- a/src/s6-rc/s6-rc-compile.c
+++ b/src/s6-rc/s6-rc-compile.c
@@ -254,7 +254,7 @@ static int add_namelist (before_t *be, int dirfd, char const *srcdir, char const
if (fd < 0) return 0 ;
buffer_init(&b, &fd_readsv, fd, buf, 2048) ;
*listindex = genalloc_len(unsigned int, &be->indices) ;
- DBG("add_namelist %s %s: *listindex is %u", name, list, *listindex) ;
+ // DBG("add_namelist %s %s: *listindex is %u", name, list, *listindex) ;
while (cont)
{
register int r = skagetln(&b, &satmp, '\n') ;
@@ -287,7 +287,7 @@ static int add_namelist (before_t *be, int dirfd, char const *srcdir, char const
}
close(fd) ;
*n = genalloc_len(unsigned int, &be->indices) - *listindex ;
- DBG("add_namelist %s %s: *n is %u", name, list, *n) ;
+ // DBG("add_namelist %s %s: *n is %u", name, list, *n) ;
return 1 ;
}
@@ -534,16 +534,20 @@ static void resolve_bundle_rec (bundle_recinfo_t *recinfo, unsigned int i)
register nameinfo_t const *p ;
avltree_search(&names_map, data.s + listindex[j], &id) ;
p = genalloc_s(nameinfo_t, &nameinfo) + id ;
+ DBG("resolve_bundle_rec: %s depends on %s", data.s + me->name, data.s + p->pos) ;
switch (p->type)
{
case SVTYPE_ONESHOT :
bitarray_set(recinfo->barray + i * recinfo->nbits, recinfo->nlong + p->i) ;
+ DBG("resolve_bundle_rec: %s is a oneshot, setting bit %u in barray[%u]", data.s + p->pos, recinfo->nlong + p->i, i) ;
break ;
case SVTYPE_LONGRUN :
bitarray_set(recinfo->barray + i * recinfo->nbits, p->i) ;
+ DBG("resolve_bundle_rec: %s is a longrun, setting bit %u in barray[%u]", data.s + p->pos, p->i, i) ;
break ;
case SVTYPE_BUNDLE :
resolve_bundle_rec(recinfo, p->i) ;
+ DBG("resolve_bundle_rec: %s is a bundle, adding barray[%u] to barray[%u]", data.s + p->pos, p->i, i) ;
bitarray_or(recinfo->barray + i * recinfo->nbits, recinfo->barray + i * recinfo->nbits, recinfo->barray + p->i * recinfo->nbits, recinfo->n) ;
break ;
default :
@@ -587,7 +591,11 @@ static inline void flatlist_bundles (bundle_t *bundles, unsigned int nbundles, u
uint32 *mydeps = bdeps + bundles[i].listindex ;
unsigned int j = 0, k = 0 ;
for (; k < bundles[i].n ; j++)
- if (bitarray_peek(mybits, j)) mydeps[k++] = j ;
+ if (bitarray_peek(mybits, j))
+ {
+ mydeps[k++] = j ;
+ DBG("flatlist_bundles: bundle %u contains service %u", i, j) ;
+ }
}
}