runq: add prio and runtime#104
Conversation
Orabug: 37187104 Signed-off-by: Richard Li <tianqi.li@oracle.com>
| comm = escape_ascii_string(runqueue.curr.comm.string_()) | ||
| pid = runqueue.curr.pid.value_() | ||
| curr_task_addr = runqueue.curr.value_() | ||
| curr_task = runqueue.curr[0] |
There was a problem hiding this comment.
Why use runqueue.curr[0], runqueue.curr not working?
There was a problem hiding this comment.
This change is due to a bug we observed . The pointer object 'runqueue.curr' can change in between when we are getting its attributes, so we need to dereference it first to get the value object for safety.
| runqueue = per_cpu(prog["runqueues"], cpus) | ||
| comm = escape_ascii_string(runqueue.curr.comm.string_()) | ||
| pid = runqueue.curr.pid.value_() | ||
| curr_task_addr = runqueue.curr.value_() |
There was a problem hiding this comment.
This variable is only use when print, can we remove it and just use curr_task.value_()?
There was a problem hiding this comment.
For the same reason, since 'runqueue.curr' could change, we want to get its current address first, followed by de-referencing it via runqueue.curr[0] immediately.
drgn_tools/runq.py
Outdated
|
|
||
|
|
||
| def run_queue(prog: Program) -> None: | ||
| def run_queue(prog: Program, min_run_time_seconds: int = 0) -> None: |
There was a problem hiding this comment.
I see you have another lockup helper to down current task in the runqueue which has been run for long time, and it didn't use this helper, then why we need the second parameter min_run_time_seconds here?
There was a problem hiding this comment.
You are right. Let me remove the parameter since now we have a lockup helper.
Orabug: 37187104 Signed-off-by: Richard Li <tianqi.li@oracle.com>
Dump prio and runtime as well. Removed min_run_time_seconds parameter since we have another lockup helper pending to merge.