Skip to content

Commit

Permalink
Fix regressions
Browse files Browse the repository at this point in the history
pylint: mainly caused by drgn signature changes
mypy: caused by drgn signature and behavior change
pytest: commit 92fc92b regression
  • Loading branch information
sdimitro committed Nov 11, 2024
1 parent 92fc92b commit 3b92772
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sdb/commands/linux/internal/slub_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions sdb/commands/linux/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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)
3 changes: 3 additions & 0 deletions sdb/commands/linux/stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))


Expand Down
8 changes: 7 additions & 1 deletion sdb/commands/linux/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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())
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b92772

Please sign in to comment.