BOT: build-kernel: Add logging for debugging issues#16
Open
PLukas2018 wants to merge 1 commit into
Open
Conversation
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
Owner
Author
|
\evaluate --rebuild |
EqBench
DetailsDetails for default optimizationDetails for default optimizationDetails for -O2 optimizationDetails for -O2 optimization |
RHEL functions
DetailsDetails for 8.0-8.1Details for 8.0-8.1Details for 8.1-8.2Details for 8.1-8.2Details for 8.2-8.3Details for 8.2-8.3Details for 8.3-8.4Details for 8.3-8.4Details for 8.4-8.5Details for 8.4-8.5 |
RHEL sysctl
DetailsDetails for 8.0-8.1Details for 8.0-8.1Details for 8.1-8.2Details for 8.1-8.2Details for 8.2-8.3Details for 8.2-8.3Details for 8.3-8.4Details for 8.3-8.4Details for 8.4-8.5Details for 8.4-8.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.