From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752149AbcERI2W (ORCPT ); Wed, 18 May 2016 04:28:22 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:43690 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750870AbcERI2T (ORCPT ); Wed, 18 May 2016 04:28:19 -0400 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: andrew.donnellan@au1.ibm.com X-IBM-RcptTo: linux-kbuild@vger.kernel.org;linux-kernel@vger.kernel.org Subject: Re: [kernel-hardening] [PATCH v8 3/4] Add Cyclomatic complexity GCC plugin To: kernel-hardening@lists.openwall.com, linux-kbuild@vger.kernel.org References: <20160513015456.01415979f20a68eb7d2d9290@gmail.com> <20160513015833.cfb5334d075525b27269649c@gmail.com> Cc: pageexec@freemail.hu, spender@grsecurity.net, mmarek@suse.com, keescook@chromium.org, linux@rasmusvillemoes.dk, fengguang.wu@intel.com, dvyukov@google.com, linux-kernel@vger.kernel.org, david.brown@linaro.org, yamada.masahiro@socionext.com From: Andrew Donnellan Message-ID: <573C26DC.6020607@au1.ibm.com> Date: Wed, 18 May 2016 18:25:00 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160513015833.cfb5334d075525b27269649c@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16051808-0009-0000-0000-00000746800E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/05/16 09:58, Emese Revfy wrote: > Add a very simple plugin to demonstrate the GCC plugin infrastructure. This GCC > plugin computes the cyclomatic complexity of each function. ... > +config GCC_PLUGIN_CYC_COMPLEXITY > + bool "Compute the cyclomatic complexity of a function" > + depends on GCC_PLUGINS > + help > + The complexity M of a function's control flow graph is defined as: > + M = E - N + 2P > + where > + > + E = the number of edges > + N = the number of nodes > + P = the number of connected components (exit nodes). > + If this plugin is intended primarily as a demonstration it's probably worth mentioning this in the Kconfig description. -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnellan@au1.ibm.com IBM Australia Limited