Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: laijs@cn.fujitsu.com (Lai Jiangshan)
Subject: [ltt-dev] [PATCH 11/13] implement ltt-ascii
Date: Sat, 17 Jan 2009 10:57:39 +0800	[thread overview]
Message-ID: <49714923.2040106@cn.fujitsu.com> (raw)
In-Reply-To: <20090116031359.GB9885@Krystal>

Mathieu Desnoyers wrote:
>>>> +struct dentry *ltt_txt_create(struct ltt_trace_struct *trace,
>>>> +		struct ltt_channel_struct *ltt_channel)
>>>> +{
>>>> +	struct dentry *entry = debugfs_create_file(ltt_channel->channel_name,
>>>> +			S_IRUSR | S_IRGRP, trace->dentry.txt_root, ltt_channel,
>>>> +			&ltt_txt_fops);
>>>> +
>>> We should handle the error case here. And make sure the ltt_txt_remove
>>> won't forget to put the channel on error.
>>>
>> when the error case here, we return NULL, and nothing done.
>> What we need to handle?
>>
> 
> debugfs_create_file() can return -ENODEV if not enabled in the kernel.
> Clearly this should never happen because our build depends on it. But
> still, I'd be more comfortable dealing with the IS_ERR() case (if new
> return values are added to debugfs in the future especially).
> 

I remember that LTT selects DEBUG_FS, so it's OK.

Most code use one of the styles:
0       -- fail    other --    success
-Eerrno -- fail    other --    success

but debugfs_create_file() is mussed up.

Lai.





      reply	other threads:[~2009-01-17  2:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13  9:09 Lai Jiangshan
2009-01-15 20:02 ` Mathieu Desnoyers
2009-01-16  1:29   ` Lai Jiangshan
2009-01-16  3:14     ` Mathieu Desnoyers
2009-01-17  2:57       ` Lai Jiangshan [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=49714923.2040106@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox