cregit-Linux · how code gets into the kernel

4 min read Original article ↗

Contributors to the Linux Kernel


Linux source code

The following source code files from the linux kernel have been transformed using cregit and arranged in the same file system ordering that the kernel uses. Each file corresponds to a C source code file (extensions .c and .h).

The source code in these files has been coloured such that it identifies the contributor who inserted that code. Inside each file, the code is divided into functions, and summaries of contributors are provided for each author. An overall summary of contributors is included at the end of the source code.

For example, the following is a snipped from the file kernel/profile.c. Specifically the function create_proc_profile. The different colours allows to identify that most of the code was contributed by William Lee Irwin III, followed by Srivatsa S. Bhat. Dave Hensen contributed only one token: ENOMEM and David Howells 2: proc_set_size and (. This function has exactly 100 tokens.


int __ref create_proc_profile(void) /* false positive from hotcpu_notifier */ { struct proc_dir_entry *entry; int err = 0; if (!prof_on) return 0; cpu_notifier_register_begin(); if (create_hash_tables()) { err = -ENOMEM; goto out; } entry = proc_create("profile", S_IWUSR | S_IRUGO, NULL, &proc_profile_operations); if (!entry) goto out; proc_set_size(entry, (1 + prof_len) * sizeof(atomic_t)); __hotcpu_notifier(profile_cpu_callback, 0); out: cpu_notifier_register_done(); return err; }

Contributors

william lee irwin iiiwilliam lee irwin iii5858.00%
srivatsa s. bhatsrivatsa s. bhat2626.00%
paolo ciarrocchipaolo ciarrocchi55.00%
david howellsdavid howells44.00%
denis v. lunevdenis v. lunev44.00%
al viroal viro22.00%
dave hansendave hansen11.00%

How to navigate a cregit source file

The cregit version of a source code file has two interactive features that provide feedback about who the contributors are:

  • Mouse-over. If you stop the mouse on top of a token, you will get a summary of the information of the commit that added this token. This information is:
    • Its commit id
    • Its git-author (the value of the Author field of the commit)
    • Its git-author-date (the value of the field Author Date of the commit)
    • Summary log of the commit
  • Left-click on a token. This action will open a new window with the details of the commit (in github). You can keep this window open and it will keep reloading the files.

The following releases are available

Limitations

There are several limitations in the creation of these files. The most important are:

  • cregit uses the same algorithm as git blame (with default options) to determine who contributed a given token. Hence, the same limitations that apply to git-blame apply to cregit’s output.
  • We use srcML to tokenize the source code, specifically its C parser. This is an island parser, and does not do true C compilation (e.g. it does not expand macros).
  • What is a token? In general, a token is what the C syntax considers a token, with some exceptions:
    • The right hand side of a preprocessor macro is always considered one single token.
    • Comments are considered one token and are attributed to the last person who modified such token.

Team

cregit has been created by Alexandre Courouble, Isabella Ferreira and Bram Adams from the Polytechnique of Montreal in Canada, Kate Stewart from the Linux Foundation, Jason Lim, Kevin Chen and Daniel German of University of Victoria in Canada.


Acknowledgements

  • cregit uses srcMl to parse the source code.
  • Jason Lim developed the improved interface to the source code, including the colour maps of the source code (4.19 and after).
  • Kevin Chen developed the improved interface to the directories (5.1 and after).
  • Ali Bahrani contributed to the parsing of rust files (version 6.10 and after).
  • Alexandre Carouble and Isabella Ferreira contribute to the matching between code reviews discussions and commits.

Disclaimers

This information provided to help linux developers understand the historical contributions to the kernel. The data on this site may be updated as new information becomes available without prior warning. Identification of inaccuracies in the attribution from developers is welcome and appreciated.

Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.


For further information about cregit and this site, please contact Daniel German (dmg@uvic.ca).