Skip to content

Commit

Permalink
Merge pull request #299 from sdimitro/update_repo_60
Browse files Browse the repository at this point in the history
Fix Regressions
  • Loading branch information
sdimitro authored Dec 20, 2022
2 parents 5a63d1a + 1f5021b commit f8c8d8d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sdb/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,9 @@ def _help_message(input_type: drgn.Type = None) -> str:
if input_type is not None:
msg += f"no walker found for input of type {input_type}\n"
msg += "The following types have walkers:\n"
msg += f"\t{'WALKER':-20s} {'TYPE':-20s}\n"
msg += f"\t{'WALKER':<20s} {'TYPE':<20s}\n"
for type_, class_ in Walker.allWalkers.items():
msg += f"\t{class_.names[0]:-20s} {type_:-20s}\n"
msg += f"\t{class_.names[0]:<20s} {type_:<20s}\n"
return msg

def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]:
Expand Down
6 changes: 4 additions & 2 deletions sdb/commands/linux/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import drgn
import sdb

from drgn.helpers.linux.pid import find_pid, find_task


class FindPid(sdb.Command):
"""
Expand Down Expand Up @@ -56,7 +58,7 @@ def _init_parser(cls, name: str) -> argparse.ArgumentParser:

def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]:
for pid in self.args.pid:
yield drgn.helpers.linux.pid.find_pid(sdb.get_prog(), pid)
yield find_pid(sdb.get_prog(), pid)


class FindTask(sdb.Command):
Expand Down Expand Up @@ -87,4 +89,4 @@ def _init_parser(cls, name: str) -> argparse.ArgumentParser:

def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]:
for pid in self.args.pid:
yield drgn.helpers.linux.pid.find_task(sdb.get_prog(), pid)
yield find_task(sdb.get_prog(), pid)
2 changes: 1 addition & 1 deletion sdb/commands/spl/spl_kmem_caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class SplKmemCacheWalker(sdb.Walker):
EXAMPLES
Print all the objects in the ddt_cache:
sdb> spl_kmem_caches | filter obj.skc_name == "ddt_cache" | spl_cache
sdb> spl_kmem_caches | filter 'obj.skc_name == "ddt_cache"' | spl_cache
(void *)0xffffa08937e80040
(void *)0xffffa08937e86180
(void *)0xffffa08937e8c2c0
Expand Down
11 changes: 10 additions & 1 deletion sdb/commands/zfs/btree.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,17 @@ def _helper(self, node: drgn.Object) -> Iterable[drgn.Object]:
if not node:
return

#
# We check both members of the node because of the change introdcued in
# https://github.com/delphix/zfs/commit/c0bf952c846100750f526c2a32ebec17694a201b
#
try:
recurse = int(node.bth_first) == -1
except AttributeError:
recurse = node.bth_core

count = node.bth_count
if node.bth_core:
if recurse:
# alterate recursive descent on the children and generating core objects
core = drgn.cast('struct zfs_btree_core *', node)
for i in range(count):
Expand Down

0 comments on commit f8c8d8d

Please sign in to comment.