Skip to content

BOT: build-kernel: Add logging for debugging issues#16

Open
PLukas2018 wants to merge 1 commit into
masterfrom
kernel-logging
Open

BOT: build-kernel: Add logging for debugging issues#16
PLukas2018 wants to merge 1 commit into
masterfrom
kernel-logging

Conversation

@PLukas2018

Copy link
Copy Markdown
Owner

No description provided.

Sometimes when running `diffkemp build-kernel` command to build
snapshots of a kernel, the `build-kernel` can be unable to compile the
source files of functions to LLVM IR. In these cases the output
contains the following:

```
<function-name>: source not found
```

This information is not enough to find the reason why the compilation
failed and manual debugging is necessary. For this reason, this commit
introduces logging for `diffkemp build-kernel` command to speed up the
debugging process by logging certain informations.

For logging is used python logging module [1].
The detail of logging is based on how DiffKemp is run:
- `diffkemp build-kernel`: Logs error messages (not used right
  now),
- `diffkemp -v build-kernel`: Logs warning messages (not used right
  now),
- `diffkemp -d build-kernel`: Logs information messages (not used right
  now),
- `diffkemp -dd build-kernel`: Logs debug messages (used in this
  commit).
The level of logging detail is created for a future use and to be
partly consistent with `diffkemp compare` command.

When running `diffkemp build-kernel` command for:
- `__bpf_get_stackid` function
- on repo [2]
- on commit `e17d62fedd10ae56e2426858bd0757da544dbc73`

the previous output was (and current without `-dd` option is):

```
__bpf_get_stackid: source not found
```

when the `-dd` option is provided, the following can be extracted from
the output (which helps to solve the problem).

```
In file included from ./include/linux/nodemask.h:94:
./include/linux/random.h:24:39: error: use of undeclared identifier 'latent_entropy'; did you mean 'add_latent_entropy'?
   24 |         add_device_randomness((const void *)&latent_entropy, sizeof(latent_entropy));
      |                                              ^~~~~~~~~~~~~~
      |                                              add_latent_entropy
./include/linux/random.h:21:20: note: 'add_latent_entropy' declared here
   21 | static inline void add_latent_entropy(void)
      |                    ^
./include/linux/random.h:24:62: error: use of undeclared identifier 'latent_entropy'; did you mean 'add_latent_entropy'?
   24 |         add_device_randomness((const void *)&latent_entropy, sizeof(latent_entropy));
      |                                                                     ^~~~~~~~~~~~~~
      |                                                                     add_latent_entropy
./include/linux/random.h:21:20: note: 'add_latent_entropy' declared here
   21 | static inline void add_latent_entropy(void)
      |                    ^
```

[1] https://docs.python.org/3/library/logging.html
[2] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
@PLukas2018

Copy link
Copy Markdown
Owner Author

\evaluate --rebuild

@diffkemp-dev-bot

Copy link
Copy Markdown

EqBench

description TN FP TP FN compare runtime
default optimization 56 91 123 2 330s $$\color{red}+2$$
-O2 optimization 97 50 121 4 330s $$\color{red}+5$$
Details
Details for default optimization

Details for default optimization

Details for -O2 optimization

Details for -O2 optimization

@diffkemp-dev-bot diffkemp-dev-bot Bot added the Success: EqBench stable EqBench experiment: same results were gained as on the master branch. label Jan 11, 2026
@diffkemp-dev-bot

Copy link
Copy Markdown

RHEL functions

versions equal not equal unknown errors total differences compare runtime
8.0-8.1 359 87 75 0 100 1129s
8.1-8.2 330 163 80 0 147 1016s $$\color{red}+105$$
8.2-8.3 413 185 89 0 185 2503s $$\color{green}-27$$
8.3-8.4 442 159 90 0 180 1776s $$\color{red}+140$$
8.4-8.5 439 171 90 0 158 1962s $$\color{red}+20$$
Details
Details for 8.0-8.1

Details for 8.0-8.1

Details for 8.1-8.2

Details for 8.1-8.2

Details for 8.2-8.3

Details for 8.2-8.3

Details for 8.3-8.4

Details for 8.3-8.4

Details for 8.4-8.5

Details for 8.4-8.5

@diffkemp-dev-bot diffkemp-dev-bot Bot added the Success: RHEL functions stable RHEL KABI functions: same results were gained as on the master branch. label Jan 11, 2026
@diffkemp-dev-bot

Copy link
Copy Markdown

RHEL sysctl

versions equal not equal unknown errors total differences compare runtime
8.0-8.1 236 39 0 0 48 1606s $$\color{green}-5$$
8.1-8.2 222 52 0 0 89 929s $$\color{red}+9$$
8.2-8.3 222 49 0 0 98 1400s $$\color{red}+1$$
8.3-8.4 213 60 0 0 85 862s $$\color{red}+3$$
8.4-8.5 230 57 0 0 66 1144s $$\color{green}-6$$
Details
Details for 8.0-8.1

Details for 8.0-8.1

Details for 8.1-8.2

Details for 8.1-8.2

Details for 8.2-8.3

Details for 8.2-8.3

Details for 8.3-8.4

Details for 8.3-8.4

Details for 8.4-8.5

Details for 8.4-8.5

@diffkemp-dev-bot diffkemp-dev-bot Bot added the Success: RHEL sysctl stable RHEL KABI sysctl: same results were gained as on the master branch. label Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Success: EqBench stable EqBench experiment: same results were gained as on the master branch. Success: RHEL functions stable RHEL KABI functions: same results were gained as on the master branch. Success: RHEL sysctl stable RHEL KABI sysctl: same results were gained as on the master branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant