Skip to content

Commit

Permalink
Merge pull request #691 from zacikpa/perf-events-fix
Browse files Browse the repository at this point in the history
scheduler: Do not assume that perf events have type attribute
  • Loading branch information
yarda authored Dec 11, 2024
2 parents 0c33999 + 9935a95 commit cd44cba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tuned/plugins/plugin_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,10 +1098,13 @@ def _thread_code(self, instance):
event = instance._evlist.read_on_cpu(cpu)
if event:
read_events = True
if event.type == perf.RECORD_COMM or \
(self._perf_process_fork_value and event.type == perf.RECORD_FORK):
if isinstance(event, perf.comm_event) or (
self._perf_process_fork_value
and isinstance(event, perf.task_event)
and event.type == perf.RECORD_FORK
):
self._add_pid(instance, int(event.tid), r)
elif event.type == perf.RECORD_EXIT:
elif isinstance(event, perf.task_event) and event.type == perf.RECORD_EXIT:
self._remove_pid(instance, int(event.tid))

@command_custom("cgroup_ps_blacklist", per_device = False)
Expand Down

0 comments on commit cd44cba

Please sign in to comment.