From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 719FDB62 for ; Fri, 10 Apr 2015 03:49:36 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 09 Apr 2015 18:49:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,554,1422950400"; d="scan'208";a="678055328" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga001.jf.intel.com with ESMTP; 09 Apr 2015 18:49:35 -0700 Received: from orsmsx157.amr.corp.intel.com (10.22.240.23) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 9 Apr 2015 18:49:34 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by ORSMSX157.amr.corp.intel.com (10.22.240.23) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 9 Apr 2015 18:49:34 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.111]) by fmsmsx117.amr.corp.intel.com ([169.254.3.36]) with mapi id 14.03.0224.002; Thu, 9 Apr 2015 18:49:34 -0700 From: "Wiles, Keith" To: Neil Horman Thread-Topic: [dpdk-dev] tools brainstorming Thread-Index: AQHQYx11uIkL9FTheESuDxqnoTBHMp1DgO2AgAAQtACAAAkVAIAAD1iAgAAZHoCAAIMDAIAAAkYAgAEr94CAAC4wAIAABgcA///F0gCAAIq6gP//w0mA Date: Fri, 10 Apr 2015 01:49:33 +0000 Message-ID: References: <20150408114339.GA22959@hmsreliant.think-freely.org> <0C5AFCA4B3408848ADF2A3073F7D8CC86D58FB64@IRSMSX109.ger.corp.intel.com> <20150408131105.GD22959@hmsreliant.think-freely.org> <0C5AFCA4B3408848ADF2A3073F7D8CC86D58FDBF@IRSMSX109.ger.corp.intel.com> <0FBA33A7-A21E-426F-B44E-32E86F2B23DB@infiniteio.com> <20150408153802.2bc59227@urahara> <20150409191658.GC26201@hmsreliant.think-freely.org> <20150410002649.GB28597@neilslaptop.think-freely.org> In-Reply-To: <20150410002649.GB28597@neilslaptop.think-freely.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.252.195.97] Content-Type: text/plain; charset="Windows-1252" Content-ID: <8F4AA2BB7CB2414BA0A687B98A9C2207@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] tools brainstorming X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2015 01:49:37 -0000 On 4/9/15, 7:26 PM, "Neil Horman" wrote: >On Thu, Apr 09, 2015 at 09:10:19PM +0000, Wiles, Keith wrote: >>=20 >>=20 >> On 4/9/15, 2:38 PM, "Jay Rolette" wrote: >>=20 >> >On Thu, Apr 9, 2015 at 2:16 PM, Neil Horman >>wrote: >> > >> >> On Thu, Apr 09, 2015 at 11:31:39AM -0500, Jay Rolette wrote: >> >> > On Wed, Apr 8, 2015 at 5:38 PM, Stephen Hemminger < >> >> > stephen@networkplumber.org> wrote: >> >> > >> >> > > On Wed, 8 Apr 2015 16:29:54 -0600 >> >> > > Jay Rolette wrote: >> >> > > >> >> > > > "C comments" includes //, right? It's been part of the C >>standard >> >> for a >> >> > > long time now... >> >> > > >> >> > > Yes but. >> >> > > I like to use checkpatch and checkpatch enforces kernel style >>which >> >> does >> >> > > not allow // for >> >> > > comments. >> >> > > >> >> > >> >> > Fork checkpatch and disable that bit? DPDK isn't the kernel, so no >> >> > requirement to follow all of its rules >> >> > >> >> >> >> Doesn't that beg the question, why? I understand the DPDK isn't the >> >> kernel, but >> >> we're not talking about clarity of code, not anything functional to >>that >> >> code. >> >> It seems we would be better served by just taking something that >>works >> >>here >> >> rather than re-inventing the wheel and digging into the minuate of >>what >> >> type of >> >> comments should be allowed (unless there is a compelling reason to >> >>change >> >> it >> >> that supercedes the avilable tools). If not checkpath, then some >>other >> >> tool, >> >> but It seems to me that coding style is one of those things where we >>can >> >> bend to >> >> the tool rather than taking the time to make the tool do exactly >>whats >> >> desired, >> >> at least until someone gets the time to modify it. >> >> >> > >> >Fair question. >> > >> >It depends a bit on how much you want to encourage patch >>contributions. Is >> >it worth adding more pain for folks trying to contribute patches for >> >things >> >like this? >> > >> >Should we force someone to spend time redoing a patch because of which >>way >> >they do their parenthesis? What about number of spaces to indent code? >>// >> >vs /* */ comments? None of these matter functionally and they don't >>affect >> >maintenance generally. >> > >> >If someone is modifying existing code, then yeah, they should follow >>the >> >prevailing style (indention level, brace alignment, etc.) of the file >>they >> >are in. It helps readability, which makes maintenance easier. However, >> >IMO, >> >mixing // and /* */ for comments doesn't affect the readability of the >> >source. >> > >> >I know if I submit a patch and the only feedback is that I should have >> >used >> >/* */ for comments, I'm extremely unlikely spend extra time to resubmit >> >the >> >patch for pedantry. >>=20 >> I looked at checkpatch.pl for few minutes and the code does check for >>C99 >> comments and adding a command line option to allow C99 comments could >> pretty simple. I found the code around line 3048 or search for C99, it >>is >> possible it could accepted back into Linux as long as the default option >> was to not allow C99 comments. >>=20 >> Allowing C99 comments would be nice and the only problem I could see if >> some compiler has a problem with them. I believe all of the compilers we >> support allow C99 comments. >>=20 >> The only other reason to allow them is if we add some open source code >>in >> the future to DPDK which has C99 comments and if would be a pain to have >> to convert that code every time the open source group released a new >> version. It does open that path IMO. >>=20 > >So, this again seems to be bad philosophy in my mind. If we are, to use >your >exmple, accept code into the DPDK in the future with comments that >violate our >selected style, it is then, by definition, in violation of the style >guidelines. Who stated it violated the style guidelines, we do not have a style guideline yet. This why Shiobhan sent out the guidelines in the first place. >If we accept it anyway, or if we allow both styles (by documenting >it/codifying >it a tool to check for/etc) then we dilute the style guide. Maybe in some >cases, such as this, thats ok, but its something to be cogniscent of. >Especially if making the choice to allow both put us in a position of >having to >maintain a tool to do the checking, then I think we need to fall on the >side of >going with what the tool (checkpatch or something else) does, unless we >have a >maintainer stepping up. Sure maintaining a tool for the C99 comment seems pretty easy, if no one want to maintain the tool that is another problem. Whether to support C99 comments is the point not that we have to maintain the tool. At this point checkpatch is a OK tool if you only want Linux kernel coding style and at this point we are not Linux code style. It just so happens the checkpatch provides some checks we seem to agree with. If we really want some type of tool to check every detail of =8Cour=B9 codi= ng style then we most likely need to stop using checkpatch IMO for a tool like astyle, ununcrustify or some tool that provides the best solution. I was suggesting we could use one of these tool to create a common config file for everyone to use and then checkpatch may not be required. At least these other tools beside check patch seem to have a huge number of options to format the automatically instead of the developer having to do that work by hand. > >The bottom line is that style guides enforce style, and tooling makes >contributors condusive to following the style. If we have someone that is >willing to maintain such a tool, then we have a lot of leway in what the >style >is, but if we don't then we really need to follow the style that an >existing >tool provides, because without tooling, contributors aren't likely to >bother >with strict adherence to the style. For tools like astyle or uncrustify we do not have to maintain those tools as they are already being maintained, we just have to use them. It seems a waste to me we are not willing to change because someone may have to make a single change to checkpatch, which we may never have to change again buying we can not get it upstreamed. It is possible we can drop the use of checkpatch and use one of the other tools made just for style formatting. To me checkpatch is a tool that needs to be replaced by tools that are made for code formatting, not just checking. I would assume checkpatch has its place in the Linux kernel and it needs to be used only by the Linux Kernel. I believe it we took the time to format the code to one of the tools and require a developer to use that tool with the provided config file it would be simpler to enforce the coding style. As we patch a file the tool could be applied before the commit. It will effect other patches to that file, but we have to do merges today and it will not change anytime soon. If you applied a tool to format all of the code at some flag day, we would have a bit of churn then it would be over. I would suggest we focus on the coding style and see what it means to the tool/checkpatch. Read the email from Siobhan and then we can talk about the coding style in more meaning full detail. Keith > >Neil > >