Fetch the repository succeeded.
This action will force synchronization from src-anolis-os/bcc, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
From c610314e8f8265317bf54ef518df48809834feba Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Thu, 14 Oct 2021 12:01:01 +0200
Subject: [PATCH] Handle renaming of task_struct_>state field on RHEL 9
There has been some cleanup of task_struct's state field and to catch
any place that has been missed in the conversion, it has been renamed
__state.
---
tools/cpudist.py | 2 +-
tools/offcputime.py | 4 ++--
tools/offwaketime.py | 4 ++--
tools/runqlat.py | 4 ++--
tools/runqslower.py | 4 ++--
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/cpudist.py b/tools/cpudist.py
index eb04f590..ba36ba76 100755
--- a/tools/cpudist.py
+++ b/tools/cpudist.py
@@ -101,7 +101,7 @@ int sched_switch(struct pt_regs *ctx, struct task_struct *prev)
u32 tgid = pid_tgid >> 32, pid = pid_tgid;
#ifdef ONCPU
- if (prev->state == TASK_RUNNING) {
+ if (prev->__state == TASK_RUNNING) {
#else
if (1) {
#endif
diff --git a/tools/offcputime.py b/tools/offcputime.py
index 128c6496..b93e78d2 100755
--- a/tools/offcputime.py
+++ b/tools/offcputime.py
@@ -205,10 +205,10 @@ thread_context = ""
thread_context = "all threads"
thread_filter = '1'
if args.state == 0:
- state_filter = 'prev->state == 0'
+ state_filter = 'prev->__state == 0'
elif args.state:
# these states are sometimes bitmask checked
- state_filter = 'prev->state & %d' % args.state
+ state_filter = 'prev->__state & %d' % args.state
else:
state_filter = '1'
bpf_text = bpf_text.replace('THREAD_FILTER', thread_filter)
diff --git a/tools/offwaketime.py b/tools/offwaketime.py
index 753eee97..722c0381 100755
--- a/tools/offwaketime.py
+++ b/tools/offwaketime.py
@@ -254,10 +254,10 @@ int oncpu(struct pt_regs *ctx, struct task_struct *p) {
else:
thread_filter = '1'
if args.state == 0:
- state_filter = 'p->state == 0'
+ state_filter = 'p->__state == 0'
elif args.state:
# these states are sometimes bitmask checked
- state_filter = 'p->state & %d' % args.state
+ state_filter = 'p->__state & %d' % args.state
else:
state_filter = '1'
bpf_text = bpf_text.replace('THREAD_FILTER', thread_filter)
diff --git a/tools/runqlat.py b/tools/runqlat.py
index b13ff2d1..8e443c3c 100755
--- a/tools/runqlat.py
+++ b/tools/runqlat.py
@@ -116,7 +116,7 @@ int trace_run(struct pt_regs *ctx, struct task_struct *prev)
u32 pid, tgid;
// ivcsw: treat like an enqueue event and store timestamp
- if (prev->state == TASK_RUNNING) {
+ if (prev->__state == TASK_RUNNING) {
tgid = prev->tgid;
pid = prev->pid;
if (!(FILTER || pid == 0)) {
@@ -170,7 +170,7 @@ RAW_TRACEPOINT_PROBE(sched_switch)
u32 pid, tgid;
// ivcsw: treat like an enqueue event and store timestamp
- if (prev->state == TASK_RUNNING) {
+ if (prev->__state == TASK_RUNNING) {
tgid = prev->tgid;
pid = prev->pid;
if (!(FILTER || pid == 0)) {
diff --git a/tools/runqslower.py b/tools/runqslower.py
index 6df98d9f..ba71e5d3 100755
--- a/tools/runqslower.py
+++ b/tools/runqslower.py
@@ -112,7 +112,7 @@ int trace_run(struct pt_regs *ctx, struct task_struct *prev)
u32 pid, tgid;
// ivcsw: treat like an enqueue event and store timestamp
- if (prev->state == TASK_RUNNING) {
+ if (prev->__state == TASK_RUNNING) {
tgid = prev->tgid;
pid = prev->pid;
u64 ts = bpf_ktime_get_ns();
@@ -178,7 +178,7 @@ RAW_TRACEPOINT_PROBE(sched_switch)
long state;
// ivcsw: treat like an enqueue event and store timestamp
- bpf_probe_read_kernel(&state, sizeof(long), (const void *)&prev->state);
+ bpf_probe_read_kernel(&state, sizeof(long), (const void *)&prev->__state);
if (state == TASK_RUNNING) {
bpf_probe_read_kernel(&tgid, sizeof(prev->tgid), &prev->tgid);
bpf_probe_read_kernel(&pid, sizeof(prev->pid), &prev->pid);
--
2.31.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。