Source code review around jump label usage
From: SF Markus Elfring
Date: Fri Dec 11 2015 - 07:09:09 EST
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/