Skip to content
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

fix cpuunclaimed.py with cfs_rq structure change #2164

Merged
merged 1 commit into from
Jan 24, 2019
Merged

Conversation

yonghong-song
Copy link
Collaborator

Similar to runqlen.py, make proper adjustment for
cfs_rq_partial structure so it can align with
what the kernel expects.

Signed-off-by: Yonghong Song yhs@fb.com

Similar to runqlen.py, make proper adjustment for
cfs_rq_partial structure so it can align with
what the kernel expects.

Signed-off-by: Yonghong Song <yhs@fb.com>
@brendangregg
Copy link
Member

Thanks, works for me!

We really need BTF for this in the future, right?

@yonghong-song
Copy link
Collaborator Author

Right. With BTF which is able to resolve to correct offset, we do not need to define cfs_rq_partial...

@yonghong-song
Copy link
Collaborator Author

[buildbot, test this please]

@yonghong-song yonghong-song merged commit 77f4f66 into master Jan 24, 2019
navytux added a commit to navytux/bcc that referenced this pull request Feb 7, 2019
* master: (609 commits)
  docs: references_guide.md: add/fix search examples/tools links (iovisor#2186)
  Fix misc file permissions (iovisor#2185)
  sync with latest bpf (iovisor#2184)
  sync with latest libbpf repo (iovisor#2183)
  docs: fix broken link of bpf_log2l(iovisor#2176)
  examples/tracing: some minor fixes
  Fix tools/syscount -l (iovisor#2180)
  examples/tracing/bitehist.py: add example of linear histogram (iovisor#2177)
  cachestat: bring back HITRATIO column
  Fix debuginfo search on Ubuntu
  Add installation instructions for Amazon Linux 1 AMI Sign-Off-By Travis Davies <trdavies@amazon.com>
  [iovisor/bcc] trace: Incorrect symbol offsets when using build_id (iovisor#2161) (iovisor#2162)
  profile: exclude CPU idle stacks by default (iovisor#2166)
  fix cpuunclaimed.py with cfs_rq structure change (iovisor#2164)
  tools: rename "deadlock_detector" to "deadlock" (iovisor#2152) (iovisor#2160)
  use libbpf api in bpf_attach_xdp (iovisor#2158)
  support symbol resolution of short-lived process.  (iovisor#2144)
  profile.py: return kernel annotations for folded stacks
  use libbpf APIs from libbpf.c (iovisor#2156)
  ddos_detector.py to monitor DDOS attacks (iovisor#2140)
  ...
palexster pushed a commit to palexster/bcc that referenced this pull request Jul 7, 2019
Similar to runqlen.py, make proper adjustment for
cfs_rq_partial structure so it can align with
what the kernel expects.

Signed-off-by: Yonghong Song <yhs@fb.com>
ismhong pushed a commit to ismhong/bcc that referenced this pull request May 8, 2023
runqlen / cpuunclaimed add check_runnable_weight_field() as workaround to
check runnable_weight presents in struct cfs_rq in kernel/sched/sched.h by
trying to access runnable_weight field of struct
sched_entity in include/linux/sched.h. Please check more details in PR iovisor#1510
and iovisor#2164.

Unfortunately, the runnable_weight field of struct cfs_rq is removed, but the
runnable_weight field of struct sched_entity is remained by following patchset
series from Linux version 5.7.0.

- https://yhbt.net/lore/all/20200214152729.6059-4-vincent.guittot@linaro.org/
- https://yhbt.net/lore/all/20200214152729.6059-5-vincent.guittot@linaro.org/

Please also check the source of Linux below.

- include/linux/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/include/linux/sched.h#L475
- kernel/sched/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/kernel/sched/sched.h#L502

This PR checks runnable_weight field exists by using kernel_struct_has_field()
if target system with BTF enabled, otherwise fallback to legacy on-the-fly
compiling check. In the meantime, add Linux version 5.7.0 check in
structure definition cfs_rq_partial to prevent issue if target system
w/o BTF enabled and Linux version > 5.7.

Please check more details in iovisor#4602.

Signed-off-by: Ism Hong <ism.hong@realtek.com>
ismhong pushed a commit to ismhong/bcc that referenced this pull request May 8, 2023
runqlen / cpuunclaimed add check_runnable_weight_field() as workaround to
check runnable_weight presents in struct cfs_rq in kernel/sched/sched.h by
trying to access runnable_weight field of struct
sched_entity in include/linux/sched.h. Please check more details in PR iovisor#1510
and iovisor#2164.

Unfortunately, the runnable_weight field of struct cfs_rq is removed, but the
runnable_weight field of struct sched_entity is remained by following patchset
series from Linux version 5.7.0.

- https://yhbt.net/lore/all/20200214152729.6059-4-vincent.guittot@linaro.org/
- https://yhbt.net/lore/all/20200214152729.6059-5-vincent.guittot@linaro.org/

Please also check the source of Linux below.

- include/linux/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/include/linux/sched.h#L475
- kernel/sched/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/kernel/sched/sched.h#L502

This PR checks runnable_weight field exists by using kernel_struct_has_field()
if target system with BTF enabled, otherwise fallback to legacy on-the-fly
compiling check. In the meantime, add Linux version 5.7.0 check in
structure definition cfs_rq_partial to prevent issue if target system
w/o BTF enabled and Linux version > 5.7.

Please check more details in iovisor#4602.

Signed-off-by: Ism Hong <ism.hong@realtek.com>
ismhong pushed a commit to ismhong/bcc that referenced this pull request May 16, 2023
runqlen / cpuunclaimed add check_runnable_weight_field() as workaround to
check runnable_weight presents in struct cfs_rq in kernel/sched/sched.h by
trying to access runnable_weight field of struct
sched_entity in include/linux/sched.h. Please check more details in PR iovisor#1510
and iovisor#2164.

Unfortunately, the runnable_weight field of struct cfs_rq is removed, but the
runnable_weight field of struct sched_entity is remained by following patchset
series from Linux version 5.7.0.

- https://yhbt.net/lore/all/20200214152729.6059-4-vincent.guittot@linaro.org/
- https://yhbt.net/lore/all/20200214152729.6059-5-vincent.guittot@linaro.org/

Please also check the source of Linux below.

- include/linux/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/include/linux/sched.h#L475
- kernel/sched/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/kernel/sched/sched.h#L502

This PR checks runnable_weight field exists by using kernel_struct_has_field()
if target system with BTF enabled, otherwise fallback to legacy on-the-fly
compiling check. In the meantime, add Linux version 5.7.0 check in
structure definition cfs_rq_partial to prevent issue if target system
w/o BTF enabled and Linux version > 5.7.

Please check more details in iovisor#4602.

Signed-off-by: Ism Hong <ism.hong@realtek.com>
yonghong-song pushed a commit that referenced this pull request May 19, 2023
runqlen / cpuunclaimed add check_runnable_weight_field() as workaround to
check runnable_weight presents in struct cfs_rq in kernel/sched/sched.h by
trying to access runnable_weight field of struct
sched_entity in include/linux/sched.h. Please check more details in PR #1510
and #2164.

Unfortunately, the runnable_weight field of struct cfs_rq is removed, but the
runnable_weight field of struct sched_entity is remained by following patchset
series from Linux version 5.7.0.

- https://yhbt.net/lore/all/20200214152729.6059-4-vincent.guittot@linaro.org/
- https://yhbt.net/lore/all/20200214152729.6059-5-vincent.guittot@linaro.org/

Please also check the source of Linux below.

- include/linux/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/include/linux/sched.h#L475
- kernel/sched/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/kernel/sched/sched.h#L502

This PR checks runnable_weight field exists by using kernel_struct_has_field()
if target system with BTF enabled, otherwise fallback to legacy on-the-fly
compiling check. In the meantime, add Linux version 5.7.0 check in
structure definition cfs_rq_partial to prevent issue if target system
w/o BTF enabled and Linux version > 5.7.

Please check more details in #4602.

Signed-off-by: Ism Hong <ism.hong@realtek.com>
captain5050 pushed a commit to captain5050/bcc that referenced this pull request Oct 12, 2023
runqlen / cpuunclaimed add check_runnable_weight_field() as workaround to
check runnable_weight presents in struct cfs_rq in kernel/sched/sched.h by
trying to access runnable_weight field of struct
sched_entity in include/linux/sched.h. Please check more details in PR iovisor#1510
and iovisor#2164.

Unfortunately, the runnable_weight field of struct cfs_rq is removed, but the
runnable_weight field of struct sched_entity is remained by following patchset
series from Linux version 5.7.0.

- https://yhbt.net/lore/all/20200214152729.6059-4-vincent.guittot@linaro.org/
- https://yhbt.net/lore/all/20200214152729.6059-5-vincent.guittot@linaro.org/

Please also check the source of Linux below.

- include/linux/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/include/linux/sched.h#L475
- kernel/sched/sched.h
    - https://elixir.bootlin.com/linux/v5.7/source/kernel/sched/sched.h#L502

This PR checks runnable_weight field exists by using kernel_struct_has_field()
if target system with BTF enabled, otherwise fallback to legacy on-the-fly
compiling check. In the meantime, add Linux version 5.7.0 check in
structure definition cfs_rq_partial to prevent issue if target system
w/o BTF enabled and Linux version > 5.7.

Please check more details in iovisor#4602.

Signed-off-by: Ism Hong <ism.hong@realtek.com>
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
Similar to runqlen.py, make proper adjustment for
cfs_rq_partial structure so it can align with
what the kernel expects.

Signed-off-by: Yonghong Song <yhs@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants