Login | Register

The Sense of Logging in the Linux Kernel

Title:

The Sense of Logging in the Linux Kernel

Patel, Keyurbhai Hasmukhbhai (2020) The Sense of Logging in the Linux Kernel. Masters thesis, Concordia University.

[thumbnail of Patel_MSc_F2020.pdf]
Preview
Text (application/pdf)
Patel_MSc_F2020.pdf - Accepted Version
652kB

Abstract

Logging is an important activity in software engineering. Developers use log data for a variety of tasks including debugging, performance analysis, detection of anomalies, and so on. Despite the importance of this data, the practice of logging still suffers from the lack of common guidelines and best practices. Recently, there have been studies that investigate the practice of logging in C/C++ and Java open-source systems. In this thesis, we complement these studies by presenting the first empirical study aimed at understanding the practice of software logging in the Linux kernel, which is perhaps the most elaborate open source development project in the computer industry. We achieve this by analysing the evolution history of the Linux kernel with a focus on three main aspects: the pervasiveness of logging code, the type of changes made to logging statements, and the rationale behind these changes. Our findings show that logging is pervasive as 3.73% of the Linux kernel source is logging code. We also found that 72.36% of the total number of files in the Linux kernel have at least one logging statement, while only 26.12% of functions are logged. Similar to other studies, the if-block gets the lion's share with 57% of the total number of logging statements. However, the distribution of logging statements across the Linux kernel subsystems and their components vary significantly with no apparent reason, suggesting that developers use different criteria when logging. We also observed that the use of logging has been gradually declining in recent years with a reduction of 9.27% from version v4.3 to version v5.3. This may be due to the availability of other alternatives to logging such as the use of tracing (a more structured form of logging) and other dynamic analysis techniques. By manually investigating 900 commits that aim to fix or improve logging code, we found that the majority of changes are to fix spelling/grammar mistakes, fix incorrect log levels, and upgrade logging code to use new logging functions to improve the precision and consistency of log output. Based on these findings, we propose many recommendations such as the use of static analysis tools to detect defective logging code at commit-time, use of automatic spell/grammar checkers, adoption of common writing styles for log messages, a systematic review of logging code, and guidance on the use of log levels. We believe that these recommendations can serve as the basis for developing common logging guidelines, as well as better logging processes, tools, and techniques.

Divisions:Concordia University > Gina Cody School of Engineering and Computer Science > Computer Science and Software Engineering
Item Type:Thesis (Masters)
Authors:Patel, Keyurbhai Hasmukhbhai
Institution:Concordia University
Degree Name:M. Comp. Sc.
Program:Computer Science
Date:18 August 2020
Thesis Supervisor(s):Hamou-Lhadj, Abdelwahab
ID Code:987184
Deposited By: KEYURBHAI HASMUKHBHAI PATEL
Deposited On:30 Jun 2021 15:00
Last Modified:17 Aug 2022 16:41
All items in Spectrum are protected by copyright, with all rights reserved. The use of items is governed by Spectrum's terms of access.

Repository Staff Only: item control page

Downloads per month over past year

Research related to the current document (at the CORE website)
- Research related to the current document (at the CORE website)
Back to top Back to top