From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753554AbcHQDjr (ORCPT ); Tue, 16 Aug 2016 23:39:47 -0400 Received: from smtprelay0112.hostedemail.com ([216.40.44.112]:36980 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751284AbcHQDjq (ORCPT ); Tue, 16 Aug 2016 23:39:46 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6691:8957:10004:10400:10848:11232:11658:11783:11914:12043:12050:12296:12517:12519:12740:13069:13073:13161:13229:13311:13357:13439:13894:14659:14721:14819:21080:21324:21433:21451:30012:30029:30030:30034:30051:30054:30064:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: smash84_1522c590de448 X-Filterd-Recvd-Size: 3455 Message-ID: <1471405142.4075.197.camel@perches.com> Subject: Re: [PATCH 0/2] be2iscsi: Logging neatening From: Joe Perches To: Bart Van Assche , Christophe JAILLET , "linux-scsi@vger.kernel.org" Cc: Jayamohan Kallickal , Ketan Mukadam , John Soni Jose , "James E.J. Bottomley" , "Martin K. Petersen" , "linux-kernel@vger.kernel.org" Date: Tue, 16 Aug 2016 20:39:02 -0700 In-Reply-To: References: <1471107782.3467.28.camel@perches.com> <1471191843.4075.39.camel@perches.com> <1471195790.4075.45.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-08-17 at 01:19 +0000, Bart Van Assche wrote: > On 08/14/16 10:29, Joe Perches wrote: > > On Sun, 2016-08-14 at 17:09 +0000, Bart Van Assche wrote: > > > My primary concern is how to enable and disable log messages from user > > > space. [] > > I think you are looking for a system wide equivalent > > for the ethtool/netif_ mechanism. > > > > Nothing like that exists currently. > > > > Some code uses a bitmask/and, other code uses a > > level/comparison. [] > As far as I can see all that the ethtool msglevel API implements is a  > mechanism to query and set the log level from user space. What various  > SCSI drivers implement is not a log level but a log mask mechanism. How  > about the following approach to associate a name with each bit in a log  > mask, to export these names to user space and to make it possible to  > enable/disable messages per log category: > * Introduce a variant of pr_debug() that allows to specify a textual >    representation of the log category (a short string without spaces). > * Make the log category names available in >    /sys/kernel/debug/dynamic_debug/... > * Today dynamic debug allows to enable/disable log messages by >    specifying the source file name, function name, line number, module >    name and/or format string. My proposal is to make it also possible to >    enable/disable log messages based on the log category name. Many of these logging mechanisms are not just debug facilities. Perhaps a dynamic_debug control would be inappropriate. There have also been various custom scsi log level facilities like the blogic_msg for the very old BusLogic blogic_msg. These functions also sometimes write into some device-specific buffer. Perhaps the largest problem, if this is to be scsi only rather than system wide, is finding out what and how the various bits in a mask should be used.