From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607Ab2L1Vbm (ORCPT ); Fri, 28 Dec 2012 16:31:42 -0500 Received: from perches-mx.perches.com ([206.117.179.246]:51171 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754080Ab2L1Vbk (ORCPT ); Fri, 28 Dec 2012 16:31:40 -0500 Message-ID: <1356730299.31130.27.camel@joe-AO722> Subject: Re: how to look for source code in kernel From: Joe Perches To: Al Viro Cc: "Eric W. Biederman" , anish singh , amit mehta , Henrique Rodrigues , kishore kumar , Jonathan Neusch??fer , linux-kernel@vger.kernel.org, Kernelnewbies@kernelnewbies.org Date: Fri, 28 Dec 2012 13:31:39 -0800 In-Reply-To: <20121228160927.GY4939@ZenIV.linux.org.uk> References: <20121227184034.GA2982@debian.debian> <87a9syhbma.fsf@xmission.com> <20121228160927.GY4939@ZenIV.linux.org.uk> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.6.0-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2012-12-28 at 16:09 +0000, Al Viro wrote: > On Thu, Dec 27, 2012 at 11:36:13PM -0800, Eric W. Biederman wrote: > > But then I am probably peculiar keeping an index of the source code in > > my head. When I need to look for something and I don't know where to > > find it I do. > > > > git-ls-files | xargs fgrep 'struct f2fs_inode' > > What's wrong with git grep? Positive: it loads multiple cpus with very little file I/O Negative: it doesn't use -P very well. it won't spans lines like: struct name { with git grep -P "\bstruct\s+\w+\s*{" (the last grep that does I believe is 2.54)