All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [Xenomai-git] Jan Kiszka : nucleus: Include all heaps in statistics
Date: Mon, 16 Nov 2009 17:55:23 +0100	[thread overview]
Message-ID: <4B0183FB.6030400@domain.hid> (raw)
In-Reply-To: <4B0180A6.80207@domain.hid>

Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Gilles Chanteperdrix wrote:
>>> GIT version control wrote:
>>>> +void xnheap_set_label(xnheap_t *heap, const char *label, ...)
>>>> +{
>>>> +	va_list args;
>>>> +	spl_t s;
>>>> +
>>>> +	va_start(args, label);
>>>> +
>>>> +	xnlock_get_irqsave(&nklock, s);
>>>> +	vsnprintf(heap->label, sizeof(heap->label), label, args);
>>>> +	xnlock_put_irqrestore(&nklock, s);
>>> Why do we need locking here ?
>>>
>> We already registered the heap, so I want to avoid that someone dumping
>> /proc sees an inconsistent string - or even an unterminated one.
> 
> There are other ways to avoid that, but, I am over-reacting to printf.
> But it is not really a printf, it is an snprintf, which is not that heavy.

Right, this was a lazy approach due to the fact that we call snprintf
under nklock already.

Jan

PS: I just force-updated my queue for a cosmetic change
("unlabeled (%p)" -> "unlabeled @0x%p").

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux


      reply	other threads:[~2009-11-16 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1NA3bT-0002c1-7v@domain.hid>
2009-11-16 16:09 ` [Xenomai-core] [Xenomai-git] Jan Kiszka : nucleus: Include all heaps in statistics Gilles Chanteperdrix
2009-11-16 16:36   ` Jan Kiszka
2009-11-16 16:41     ` Gilles Chanteperdrix
2009-11-16 16:55       ` Jan Kiszka [this message]

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=4B0183FB.6030400@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --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.