python-crash changes to work with OpenEmbedded#46
Open
AlexanderKamensky wants to merge 3 commits intocrash-python:mastercrash-python/crash-python:masterfrom
Open
python-crash changes to work with OpenEmbedded#46AlexanderKamensky wants to merge 3 commits intocrash-python:mastercrash-python/crash-python:masterfrom
AlexanderKamensky wants to merge 3 commits intocrash-python:mastercrash-python/crash-python:masterfrom
Conversation
added 3 commits
November 12, 2020 17:18
On system without CONFIG_NODES_SHIFT in config referncing config["NODE_SHIFT"] returns a NoneType instead of a KeyError, this results in a TypeError execption when NoneType is converted to integer. Catch TypeError exception to fall back to hard coded value Signed-off-by: Alexander Kamensky <alexander.kamensky42@gmail.com>
In Yocto Project 5.8 kernel pycrash produces the following exception:
Loading tasks...crash-python: Failed to open /home/skamensk/oe/20201017/build/vmcore. No method to retrieve last run from task found.
Traceback (most recent call last):
File "<string>", line 38, in <module>
File "./build/lib/crash/session.py", line 33, in __init__
self.kernel.setup_tasks()
File "./build/lib/crash/kernel.py", line 691, in setup_tasks
ltask = LinuxTask(task)
File "./build/lib/crash/types/task.py", line 229, in __init__
self._init_task_types(task_struct)
File "./build/lib/crash/types/task.py", line 269, in _init_task_types
cls._pick_last_run()
File "./build/lib/crash/types/task.py", line 604, in _pick_last_run
raise RuntimeError("No method to retrieve last run from task found.")
RuntimeError: No method to retrieve last run from task found.
It turns out that Yocto Project 5.8 kernel does not enable CONFIG_TASKSTATS
and CONFIG_TASK_DELAY_ACCT as result CONFIG_SCHED_INFO is not selected,
as a result this raises the aformentioned exception because struct sched_info
does not have any fields in this case. To work around this
the raising of the RuntimeError was replaced with a print out that states
which CONFIGS must be enabled and cls._get_last was set to a function that
will always return 0.
'pyps -l' functionality is important but there are plenty of other useful
funcationality even if we cannot figure out last run time of task.
Signed-off-by: Alexander Kamensky <alexander.kamensky42@gmail.com>
In Yocto 5.8 kernel it was observed that pycrash produces the following
exception:
...
File "/home/skamensk/crash-python/20201101/crash-python/build/lib/crash/commands/kmem.py", line 28, in <module>
from crash.types.slab import kmem_cache_get_all, kmem_cache_from_name
...
File "/home/skamensk/crash-python/20201101/crash-python/build/lib/crash/types/slab.py", line 328, in check_kmem_cache_type
cls.percpu_name = find_member_variant(gdbtype, ['cpu_cache', 'array'])
File "/home/skamensk/crash-python/20201101/crash-python/build/lib/crash/util/__init__.py", line 304, in find_member_variant
raise TypeError("Unrecognized '{}': could not find member '{}'"
TypeError: Unrecognized 'struct kmem_cache': could not find member 'cpu_cache'
Yocto Project 5.8 Kernel configured with CONFIG_SLUB. In this case struct
kem_cache does not have field cpu_cache, so lookup of this field fails in
such configuration.
Workaround is to check kernel config if CONFIG_SLUB is enabled and skip slab
specif functionality if that is the case.
TODO: Implement slub analogs for slab operations.
Signed-off-by: Alexander Kamensky <alexander.kamensky42@gmail.com>
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.
Hi Jeff,
I have been working on integrating python-crash tool with OpenEmbedded
distro. I have created meta-krash [1] OpenEmbedded layer that primarily
includes crash-python tool. During my integration I ran into several
issues. For example, OpenEmbedded kernel does not enable CONFIG_NUMA, or
CONFIG_SCHED_INFO and uses CONFIG_SLUB (vs CONFIG_SLAB). To deal with the
differences I have added a few patches.
Although OpenEmbedded layer allows local changes for upstream projects
it would be great if you could look at my changes and possibly merge
them. If you have any comments or remarks it would be greatly appreciated.
Thanks,
Alexander
[1] https://github.com/AlexanderKamensky/meta-kcrash