more: Jollen 的 Embedded Linux 教育訓練

« getpriority() 與 setpriority() 程式設計 | Home | 座談演講投影片下載 »

是蟲啦,不是警告。

jollen 發表於 October 18, 2006 9:20 PM

是蟲啦,不是警告。在 Linux kernel 的 mailing list 看到一則有意思的張貼,全文如下,Jollen 把重點用紅色標示出來:

* Jeremy Fitzhardinge  wrote:

> A warning is a warning, not a BUG.

> - printk("BUG: warning at %s:%d/%s()n", __FILE__,
> + printk("WARNING at %s:%d %s()n", __FILE__,

i'm not really happy about this change.

Firstly, 
most WARN_ON()s are /bugs/, not warnings ... 
If it's a real
warning, a KERN_INFO printk should be done.

Secondly, the reason i changed it to the 'BUG: ...' format is that i
tried to make it easier for automated tools (and for users) to figure
out that a kernel bug happened.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ 

很重要,一定要看的概念。在 Linux kernel 裡,WARN_ON() 所秀出來的訊息格式為「BUG: xxx」,表示這是一個臭蟲。如果是警告訊息,則是用 loglevel 'KERN_INFO' 來列印訊息。

所以,這位老兄解釋的很清楚,這類的 "warning" 訊息是 kernel 的 "bug",並不是字面上所表示的「警告」訊息!

--jollen

引用通告

如果您想引用這篇文章到您的Blog,
請複製下面的鏈接,並放置到您發表文章的相應界面中。

http://blog.jollen.org/mt-tb.cgi/63

Top | 授權條款 | Jollen's Forum: Blog 評論、討論與搜尋
Copyright(c) 2006 www.jollen.org