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

libbpf-tools: Allow offcputime to run on kernels without BPF trampoline #5131

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

chenhengqi
Copy link
Collaborator

For kernels without BPF trampoline, let's use raw tracepoint instead.

While at it, also fix a compilation error for gethostlatency.

Fix the following compilation error with GCC 8.5.0:
    gethostlatency.c: In function ‘attach_uprobes.isra.2’:
    gethostlatency.c:157:58: error: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size between 4074 and 4084 [-Werror=format-truncation=]
         snprintf(proc_path, sizeof(proc_path), "/proc/%d/root%s", target_pid, buf);
                                                              ^~               ~~~
    gethostlatency.c:157:5: note: ‘snprintf’ output between 13 and 4118 bytes into a destination of size 4096
         snprintf(proc_path, sizeof(proc_path), "/proc/%d/root%s", target_pid, buf);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

Signed-off-by: Hengqi Chen <[email protected]>
Another compatibility game, allow offcputime to run on kernels
without BPF trampoline using raw tracepoint.

Signed-off-by: Hengqi Chen <[email protected]>
@yonghong-song yonghong-song merged commit d9eec93 into iovisor:master Nov 9, 2024
12 checks passed
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