diff --git a/sdb/commands/echo.py b/sdb/commands/echo.py index 4ea869d..c72be55 100644 --- a/sdb/commands/echo.py +++ b/sdb/commands/echo.py @@ -38,8 +38,7 @@ def _init_parser(cls, name: str) -> argparse.ArgumentParser: return parser def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]: - for obj in objs: - yield obj + yield from objs 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..1d5c575 100644 --- a/sdb/commands/linux/internal/slub_helpers.py +++ b/sdb/commands/linux/internal/slub_helpers.py @@ -151,6 +151,9 @@ def util(cache: drgn.Object) -> int: def lookup_cache_by_address(obj: drgn.Object) -> Optional[drgn.Object]: try: + # The pylint error disabled below is a false positive + # triggered by some updates to drgn's function signatures. + # pylint: disable=no-value-for-parameter cache = find_containing_slab_cache(obj) if cache.value_() == 0x0: return None diff --git a/sdb/commands/linux/process.py b/sdb/commands/linux/process.py index 5257acd..fc3d3a0 100644 --- a/sdb/commands/linux/process.py +++ b/sdb/commands/linux/process.py @@ -58,6 +58,9 @@ def _init_parser(cls, name: str) -> argparse.ArgumentParser: def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]: for pid in self.args.pid: + # The pylint error disabled below is a false positive + # triggered by some updates to drgn's function signatures. + # pylint: disable=no-value-for-parameter yield find_pid(sdb.get_prog(), pid) @@ -90,4 +93,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: + # The pylint error disabled below is a false positive + # triggered by some updates to drgn's function signatures. + # pylint: disable=no-value-for-parameter yield find_task(sdb.get_prog(), pid) diff --git a/sdb/commands/linux/stacks.py b/sdb/commands/linux/stacks.py index 8de3ba3..4855ad1 100644 --- a/sdb/commands/linux/stacks.py +++ b/sdb/commands/linux/stacks.py @@ -400,6 +400,9 @@ def pretty_print(self, objs: Iterable[drgn.Object]) -> None: def no_input(self) -> Iterable[drgn.Object]: self.validate_context() + # The pylint error disabled below is a false positive + # triggered by some updates to drgn's function signatures. + # pylint: disable=no-value-for-parameter yield from filter(self.match_stack, for_each_task(sdb.get_prog())) diff --git a/sdb/commands/linux/threads.py b/sdb/commands/linux/threads.py index 96cceba..ba602f7 100644 --- a/sdb/commands/linux/threads.py +++ b/sdb/commands/linux/threads.py @@ -30,7 +30,10 @@ def _cmdline(obj: drgn.Object) -> str: try: - s = " ".join(map(lambda s: s.decode("utf-8"), cmdline(obj))) + ret = cmdline(obj) + if ret is None: + return "" + s = " ".join(map(lambda s: s.decode("utf-8"), ret)) # # The command line for a given thread can be obnoxiously long, @@ -97,4 +100,7 @@ def pretty_print(self, objs: Iterable[drgn.Object]) -> None: table.print_() def no_input(self) -> Iterable[drgn.Object]: + # The pylint error disabled below is a false positive + # triggered by some updates to drgn's function signatures. + # pylint: disable=no-value-for-parameter yield from for_each_task(sdb.get_prog()) diff --git a/sdb/commands/tail.py b/sdb/commands/tail.py index d6663d0..fd0478f 100644 --- a/sdb/commands/tail.py +++ b/sdb/commands/tail.py @@ -48,5 +48,4 @@ def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]: queue: Deque[drgn.Object] = deque(maxlen=self.args.count) for obj in objs: queue.append(obj) - for obj in queue: - yield obj + yield from queue 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) diff --git a/tests/integration/data/regression_output/dump.202303131823/zfs/zio -r b/tests/integration/data/regression_output/dump.202303131823/zfs/zio -r index dbf9281..925ad25 100644 --- a/tests/integration/data/regression_output/dump.202303131823/zfs/zio -r +++ b/tests/integration/data/regression_output/dump.202303131823/zfs/zio -r @@ -1539,6 +1539,7 @@ 0xffff9ac552bea780 WRITE VDEV_IO_START - - 0xffff9ac5500d1da0 WRITE VDEV_IO_DONE - -62ms 0xffff9ac60f5d4f00 WRITE VDEV_IO_START - -78ms + 0xffff9ac552beac70 WRITE DONE - - 0xffff9ac552bed8e0 WRITE VDEV_IO_START - - 0xffff9ac5500d4520 WRITE VDEV_IO_DONE - -63ms 0xffff9ac60f5d4f00 WRITE VDEV_IO_START - -78ms