All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: Xenomai Help <xenomai@xenomai.org>, Jeff Weber <jweber@domain.hid>
Subject: Re: [Xenomai-help] task not being scheduled
Date: Tue, 27 Feb 2007 21:59:22 +0100	[thread overview]
Message-ID: <17892.39850.482375.823627@domain.hid> (raw)
In-Reply-To: <45E494AC.5050603@domain.hid>

[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 739 bytes --]

Jan Kiszka wrote:
 > Jeff Weber wrote:
 > > trace and .config attached.
 > 
 > OK. Sorry for not believing in the first place :), but there are
 > actually timer events missing for your 10-ms-period task.
 > 
 > I saw in the .config that you are using the heap timer list. Already
 > tried the classic linked list as well? Maybe we see in issue related to
 > this queue implementation.
 > 
 > Gilles, I think the heap was your contribution. If it turns out to bite
 > us here, any idea where to look, what to instrument
 > (xntrace_special[_u64]...)?

I used a dumper that I called at any time when I wanted to inspect the
contents of a binary heap. Here it comes, it probably needs to be
re-adapted.

-- 


					    Gilles Chanteperdrix.

[-- Attachment #2: aheap_dump.h --]
[-- Type: text/plain, Size: 2670 bytes --]

#ifndef AHEAP_DUMP_H
#define AHEAP_DUMP_H

#ifndef __KERNEL__
#include <stdlib.h>             /* For NULL */
#include <errno.h>              /* For EINVAL, EBUSY */
#include <string.h>             /* For memset */
#endif /* __KERNEL__ */

#if DUMPER && !defined(__KERNEL__)
#define flnz(word)                              \
({                                              \
    unsigned long out;                          \
    /* Derived from bitops.h's ffs() */         \
    __asm__ ("bsrl %1, %0"                      \
             : "=r" (out)                       \
             : "mr"  (word));                   \
    out;                                        \
})

static inline void
aheap_dumper_visit (FILE *file,
                    aheap_t *heap,
                    aheaph_t *node,
                    int (*prn)(char *, size_t, const aheaph_t *const),
                    const char *blank,
                    unsigned blank_sz,
                    char *buf,
                    unsigned indent,
                    unsigned len)
{
    aheaph_t *left, *right;

    right = aheaph_child(heap, node, 1);
    if(right) {
        if(blank_sz >= (unsigned) (buf-blank)) {
            snprintf(buf, len+2, "%*s\n", (int) len+1, "bug!");
            fputs(buf-blank_sz, file);
        } else
            aheap_dumper_visit(file, heap, right, prn, blank,
                               blank_sz+indent, buf, indent, len);
    }
    
    (*prn)(buf, len+1, node);
    buf[len] = '\n';
    buf[len+1] = '\0';
    
    fputs(buf-blank_sz, file);

    left = aheaph_child(heap, node, 0);    
    if(left) {
        if(blank_sz >= (unsigned) (buf-blank)) {
            snprintf(buf, len+2, "%*s\n", (int) len+1, "bug!");
            fputs(buf-blank_sz, file);
        } else
            aheap_dumper_visit(file, heap, left, prn, blank,
                               blank_sz+indent, buf, indent, len);
    }
}

static inline void
aheap_dump (FILE *file,
            aheap_t *heap,
            int (*prn)(char *, size_t, const aheaph_t *const),
            unsigned indent,
            unsigned len)
{
    aheaph_t *holder = aheap_gethead(heap);

    putc('\n', file);
    if (!holder)
        fputs("Empty.\n", file);
    else {
        size_t blank_sz = (flnz(heap->last - 1) + 1) * indent;
        char buffer[blank_sz+len+2];
        memset(buffer, ' ', blank_sz);

        aheap_dumper_visit(file, heap, holder, prn, buffer, 0,
                           buffer+blank_sz, indent, len);
    }
}
#else /* !DUMPER || __KERNEL__ */

#define aheap_dump(file, heap, prn, indent, len) do { } while(0)

#endif /* !DUMPER || __KERNEL__ */

#endif /* AHEAP_DUMP_H */

  reply	other threads:[~2007-02-27 20:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 18:14 [Xenomai-help] task not being scheduled Jeff Weber
2007-02-27 18:30 ` Jan Kiszka
2007-02-27 18:31   ` Jan Kiszka
2007-02-27 20:04   ` Jeff Weber
2007-02-27 20:29     ` Jan Kiszka
2007-02-27 20:59       ` Gilles Chanteperdrix [this message]
2007-02-27 21:09       ` Jeff Weber
2007-02-27 21:31         ` Gilles Chanteperdrix
2007-02-28 13:50       ` Jeff Weber
2007-02-28 13:58         ` [Xenomai-core] " Philippe Gerum
2007-02-28 14:11         ` Jan Kiszka
2007-02-28 14:20           ` Gilles Chanteperdrix
2007-02-28 15:31             ` Jeff Weber
2007-03-01 16:51               ` [Xenomai-core] " Gilles Chanteperdrix
2007-03-08 19:26               ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17892.39850.482375.823627@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=jweber@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.