Including corelens & drgn versions in reports #147
Merged
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.
There are two related issues fixed here:
-o
is used. LKCE does not use report mode, so its reports don't have that information, which is a shame. To fix this, add a "corelens" section to the stdout output whenever more than one module is run. This ensures that the common case ofcorelens VMCORE -M one_module
doesn't get a bunch of extra output that won't be useful for most people.To make the versions even more useful, I've updated the packaging scripts so that the version string reported by corelens is (nearly) identical to the RPM version, if it was installed via the RPM. That can help differentiate between supported & unsupported installations (e.g. running from git or from source).
I'm avoiding adding options like
--verbose
or--quiet
here because the logic is already complicated enough. I'd like to avoid custom flags to add or remove specific kinds of output. Hopefully each of the above modes is intuitive enough that people don't really need to think about it - the output just makes sense.To test this, I've verified that the output for each of the three possible cases (described in the code) and I've also built the RPMs on OL9 and installed. Here's what it looks like for a silly (small) output on my laptop where we're running multiple modules to stdout:
Compared to the below, when it's just one module:
The version "2.0.1" is fake (we haven't released it yet), but it illustrates the idea. The version & release are separated by the
+
sign due to limitations in what Python allows for version names.Orabug: 37503503