-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runq: add prio and runtime #104
Conversation
Orabug: 37187104 Signed-off-by: Richard Li <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use runqueue.curr[0]
, runqueue.curr
not working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see
""" | ||
|
||
# _cpu = drgn.helpers.linux.cpumask.for_each_online_cpu(prog) | ||
for cpus in for_each_online_cpu(prog): | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is only use when print, can we remove it and just use curr_task.value_()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -65,20 +67,31 @@ def _print_cfs_runq(runqueue: Object) -> None: | |||
print(" [no tasks queued]") | |||
|
|||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Let me remove the parameter since now we have a lockup helper.
Orabug: 37187104 Signed-off-by: Richard Li <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Dump prio and runtime as well. Removed min_run_time_seconds parameter since we have another lockup helper pending to merge.