diff --git a/sdb/commands/echo.py b/sdb/commands/echo.py index 4ea869d..06ffead 100644 --- a/sdb/commands/echo.py +++ b/sdb/commands/echo.py @@ -39,7 +39,7 @@ def _init_parser(cls, name: str) -> argparse.ArgumentParser: def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]: for obj in objs: - yield obj + yield from obj for addr in self.args.addrs: try: diff --git a/sdb/commands/linux/internal/slub_helpers.py b/sdb/commands/linux/internal/slub_helpers.py index 127dc45..55b93d1 100644 --- a/sdb/commands/linux/internal/slub_helpers.py +++ b/sdb/commands/linux/internal/slub_helpers.py @@ -151,7 +151,7 @@ def util(cache: drgn.Object) -> int: def lookup_cache_by_address(obj: drgn.Object) -> Optional[drgn.Object]: try: - cache = find_containing_slab_cache(obj) + cache = find_containing_slab_cache(prog=sdb.get_prog(), addr=obj) if cache.value_() == 0x0: return None return cache diff --git a/sdb/commands/linux/process.py b/sdb/commands/linux/process.py index 5257acd..a0ccfb7 100644 --- a/sdb/commands/linux/process.py +++ b/sdb/commands/linux/process.py @@ -58,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 find_pid(sdb.get_prog(), pid) + yield find_pid(prog=sdb.get_prog(), ns=sdb.get_prog(), pid=pid) class FindTask(sdb.Command): @@ -90,4 +90,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 find_task(sdb.get_prog(), pid) + yield find_task(prog=sdb.get_prog(), ns=sdb.get_prog(), pid=pid) diff --git a/sdb/commands/linux/stacks.py b/sdb/commands/linux/stacks.py index 8de3ba3..d24a578 100644 --- a/sdb/commands/linux/stacks.py +++ b/sdb/commands/linux/stacks.py @@ -400,7 +400,7 @@ def pretty_print(self, objs: Iterable[drgn.Object]) -> None: def no_input(self) -> Iterable[drgn.Object]: self.validate_context() - yield from filter(self.match_stack, for_each_task(sdb.get_prog())) + yield from filter(self.match_stack, for_each_task(prog=sdb.get_prog(), ns=sdb.get_prog())) class KernelCrashedThread(sdb.Locator, sdb.PrettyPrinter): diff --git a/sdb/commands/linux/threads.py b/sdb/commands/linux/threads.py index 96cceba..b2e1fcd 100644 --- a/sdb/commands/linux/threads.py +++ b/sdb/commands/linux/threads.py @@ -97,4 +97,4 @@ def pretty_print(self, objs: Iterable[drgn.Object]) -> None: table.print_() def no_input(self) -> Iterable[drgn.Object]: - yield from for_each_task(sdb.get_prog()) + yield from for_each_task(prog=sdb.get_prog(), ns=sdb.get_prog()) diff --git a/sdb/commands/tail.py b/sdb/commands/tail.py index d6663d0..60aed13 100644 --- a/sdb/commands/tail.py +++ b/sdb/commands/tail.py @@ -49,4 +49,4 @@ def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]: for obj in objs: queue.append(obj) for obj in queue: - yield obj + yield from obj diff --git a/sdb/commands/zfs/histograms.py b/sdb/commands/zfs/histograms.py index fba410a..723fae5 100644 --- a/sdb/commands/zfs/histograms.py +++ b/sdb/commands/zfs/histograms.py @@ -130,8 +130,7 @@ def print_histogram(hist: drgn.Object, min_bucket = bucket if bucket > max_bucket and count > 0: max_bucket = bucket - if count > max_count: - max_count = count + max_count = max(max_count, count) HISTOGRAM_WIDTH_MAX = 40 max_count = max(max_count, HISTOGRAM_WIDTH_MAX)