Skip to content

Commit 69ed4a4

Browse files
committed
lockup: fix style errors
Until recently the black pre-commit hook was not enforcing. These slipped by in a separate PR. Fix it up so the pre-commit checks are passing again. Signed-off-by: Stephen Brennan <[email protected]>
1 parent 4f32bf6 commit 69ed4a4

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

drgn_tools/lockup.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ def scan_lockup(
5151
print()
5252
nr_processes += 1
5353

54-
print(f"We found {nr_processes} processes running more than {min_run_time_seconds} seconds")
54+
print(
55+
f"We found {nr_processes} processes running more than {min_run_time_seconds} seconds"
56+
)
5557

5658
dump_tasks_waiting_rcu_gp(prog, min_run_time_seconds)
5759

5860

59-
def tasks_waiting_rcu_gp(prog: Program) -> typing.List[typing.Tuple[drgn.Object, drgn.StackFrame]]:
61+
def tasks_waiting_rcu_gp(
62+
prog: Program,
63+
) -> typing.List[typing.Tuple[drgn.Object, drgn.StackFrame]]:
6064
"""
6165
Detects tasks waiting RCU grace period
6266
@@ -66,7 +70,9 @@ def tasks_waiting_rcu_gp(prog: Program) -> typing.List[typing.Tuple[drgn.Object,
6670
return bt_has_any(prog, rcu_gp_fn)
6771

6872

69-
def dump_tasks_waiting_rcu_gp(prog: Program, min_run_time_seconds: int) -> None:
73+
def dump_tasks_waiting_rcu_gp(
74+
prog: Program, min_run_time_seconds: int
75+
) -> None:
7076
"""
7177
Prints tasks waiting on rcu grace period with details
7278
@@ -80,18 +86,23 @@ def dump_tasks_waiting_rcu_gp(prog: Program, min_run_time_seconds: int) -> None:
8086
for t, _ in tasks_waiting:
8187
pending_time = timestamp_str(task_lastrun2now(t))
8288
pid = t.pid.value_()
83-
if pid not in tasks_pids and task_lastrun2now(t) > min_run_time_seconds * 1e9:
89+
if (
90+
pid not in tasks_pids
91+
and task_lastrun2now(t) > min_run_time_seconds * 1e9
92+
):
8493
output.append(
8594
[
8695
hex(t.value_()),
8796
escape_ascii_string(t.comm.string_()),
8897
pid,
89-
pending_time
98+
pending_time,
9099
]
91100
)
92101
tasks_pids.add(pid)
93102
print()
94-
print(f"We found below tasks waiting for rcu grace period over {min_run_time_seconds} seconds:")
103+
print(
104+
f"We found below tasks waiting for rcu grace period over {min_run_time_seconds} seconds:"
105+
)
95106
print_table(output)
96107

97108

0 commit comments

Comments
 (0)