Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754877AbbLKMJF (ORCPT ); Fri, 11 Dec 2015 07:09:05 -0500 Received: from mout.web.de ([212.227.15.4]:56541 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754003AbbLKMJC (ORCPT ); Fri, 11 Dec 2015 07:09:02 -0500 To: LKML Cc: kernel-janitors@vger.kernel.org, Julia Lawall , "Derek M. Jones" From: SF Markus Elfring Subject: Source code review around jump label usage X-Enigmail-Draft-Status: N1110 Message-ID: <566ABCD9.1060404@users.sourceforge.net> Date: Fri, 11 Dec 2015 13:08:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:9rO1SypRA4vA0t5iWfcjmuP/zM9niHTJmebnnPJpjvZNCOdjQEa YC/SY/dnCvNDAUybd8GlqcF/auJ2T0TV/jjs/cwXGHebP56DH1cLNSXNkEY6Vav6brp9jUQ uAOsJDfKP8afERtKa+3Vu01rLqLCxliYAicTomkZneuUFE7VVkpxsnru9GJjV+PUannuO2E /feVSXAa0T/tqvajW/8Og== X-UI-Out-Filterresults: notjunk:1;V01:K0:dPcLOtjLrIs=:nYGmyxpF2Clq9MPI0gUigr JEsMQhZXs2B10GD+vRg9e2sXpi5V/VnejkG3STH2P52GL5EcQ8MLcIwxji8JV21cxLY9EgNvl ULRiGalhYrgsl5C24ab66AfjYmcE1sBQKsU20rYwFdpmmTQy8z6U+T9dlMAawTQTp0+9NBc/T 9+FBfzAn0FFQdjS1u0qeWOJB0naf8AI9lQcl6v3M8EZPo19MNz0PEbjrBe9LQHRHtJ6Q7PXjv oWR59sqp52FriExyRHwmg+T+bQT1JDc6o8qIPGsIjnbVY0bFXI/6/PZTsRyojG5bzZoz38tea tkjc19BymvL/+GnN0s/PmmPe1SfK7x0CQx6s96lsoA63LKNg+LdE1vCIY6gPmwzGrOc1h1h1D pMo7pFWjbX4A//Bv4zZgcUXU941KN7gVWxeih+Jopya79kBQh0AezubMN5JF63RbChzU8B14w dz53yXfLdbVd0KZx8YJYrlGIGmFreaCQSVWq5LI4w9sST7oOL0AGr//70Weiyx5kkrvKqsjun TEpsBVvq8NJjMSWjR5JYn+iNkejBPX+8C8102HQFXcbIm+SRqNa7dhJkogLL+IbL+CCyL0Puo FqpAA2wNJNck4jxPtD5yefxZuVk6ggKBGgIe5duxz3OtsCEtYEpPyobKWDNuwjv+5xgMJA0cf Yijbl9WgIsGlA44lUOpB43h05P+jxu45zy34CZG0b3SmANf/Aztuq7FqBA2mDTWdyWLWxB0Oa KAk9LBKFxYrYIDbpr9HYornNkNjXFlwB6PHDDxcvpD1AfGUm3OCmjbwChLBgnFQ0aOg7kqTnT jvG0pJI Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6305 Lines: 105 Hello, I have tried another specific analysis out on the source files of "Linux next-20151211" with help of the software "Coccinelle 1.0.4". I have taken a more detailed look on the use of the goto statement and corresponding jump labels. Can statistics like the following support software evolution and further constructive considerations? ╔═════════════════════════════════════════╤═══════════╗ ║ target │ incidence ║ ╠═════════════════════════════════════════╪═══════════╣ ║ out │ 9782 ║ ║ done │ 1344 ║ ║ exit │ 950 ║ ║ out_unlock │ 538 ║ ║ unlock │ 509 ║ ║ bail │ 486 ║ ║ error │ 418 ║ ║ retry │ 414 ║ ║ err │ 400 ║ ║ end │ 332 ║ ║ … │ … ║ ║ abts_pending │ 1 ║ ║ abts_err │ 1 ║ ║ absolute_address │ 1 ║ ║ abort2 │ 1 ║ ║ abort_fail │ 1 ║ ║ abort_end │ 1 ║ ║ abituguru_probe_error │ 1 ║ ║ abituguru_detect_no_pwms_exit │ 1 ║ ║ abituguru_detect_bank1_sensor_type_exit │ 1 ║ ╚═════════════════════════════════════════╧═══════════╝ How often are different jump targets used within function implementations? (Functions without jump labels were not searched for this analysis approach.) ╔═════════╤═══════════╗ ║ counter │ incidence ║ ╠═════════╪═══════════╣ ║ 1 │ 18442 ║ ║ 2 │ 2002 ║ ║ 3 │ 356 ║ ║ 4 │ 106 ║ ║ 5 │ 31 ║ ║ 6 │ 7 ║ ║ 7 │ 2 ║ ║ 8 │ 3 ║ ╚═════════╧═══════════╝ How does the text length distribution look like for the used jump targets? ╔════════╤═══════════╗ ║ length │ incidence ║ ╠════════╪═══════════╣ ║ 1 │ 2 ║ ║ 2 │ 29 ║ ║ 3 │ 10640 ║ ║ 4 │ 3564 ║ ║ 5 │ 1714 ║ ║ 6 │ 1162 ║ ║ 7 │ 1245 ║ ║ 8 │ 881 ║ ║ 9 │ 787 ║ ║ 10 │ 1252 ║ ║ … │ … ║ ║ 35 │ 4 ║ ║ 36 │ 1 ║ ║ 37 │ 2 ║ ║ 38 │ 1 ║ ║ 39 │ 1 ║ ╚════════╧═══════════╝ How often are jump targets called within specific function implementations? ╔══════════════════════════╤═════════════════════════════════════════╤══════╤══════════════════════╤═════════╗ ║ function │ source file │ line │ go to │ counter ║ ╠══════════════════════════╪═════════════════════════════════════════╪══════╪══════════════════════╪═════════╣ ║ do_ipv6_setsockopt │ net/ipv6/ipv6_sockglue.c │ 140 │ e_inval │ 52 ║ ║ dvb_register │ drivers/media/pci/cx88/cx88-dvb.c │ 1005 │ frontend_detach │ 43 ║ ║ dvb_init │ drivers/media/pci/saa7134/saa7134-dvb.c │ 1210 │ detach_frontend │ 40 ║ ║ gdbstub_single_step │ arch/mn10300/kernel/gdb-stub.c │ 491 │ fault │ 38 ║ ║ uinput_ioctl_handler │ drivers/input/misc/uinput.c │ 701 │ out │ 32 ║ ║ … │ … │ … │ … │ … ║ ║ kvm_vm_compat_ioctl │ virt/kvm/kvm_main.c │ 2916 │ out │ 1 ║ ║ kvm_vm_ioctl │ virt/kvm/kvm_main.c │ 2742 │ out_free_irq_routing │ 1 ║ ║ kvm_vm_ioctl_create_vcpu │ virt/kvm/kvm_main.c │ 2257 │ vcpu_destroy │ 1 ║ ╚══════════════════════════╧═════════════════════════════════════════╧══════╧══════════════════════╧═════════╝ Do any of these numbers indicate update candidates which correspond to the "one error jump label bug" symptom that is mentioned in the Linux coding style documentation? Regards, Markus -- 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/