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-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [Xenomai-git] Jan Kiszka : nucleus: Include all heaps in statistics
Date: Mon, 16 Nov 2009 17:41:10 +0100	[thread overview]
Message-ID: <4B0180A6.80207@domain.hid> (raw)
In-Reply-To: <4B017F7A.4090409@domain.hid>

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.

-- 
                                          Gilles



  reply	other threads:[~2009-11-16 16:41 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 [this message]
2009-11-16 16:55       ` Jan Kiszka

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