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: support to find symbols in different mount namespace #4854

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ethercflow
Copy link
Contributor

Resolving symbols from different mnt namespaces is currently not supported, which is very unfriendly for debugging container environments. So add this ability as perf: torvalds/linux@843ff37.

The test result looks as below (run in root ns to debug non-root ns's task):

sudo ./offcputime -p  1137374
bpf_prog_9435ef55c0230b1b_sched_switch
    bpf_prog_9435ef55c0230b1b_sched_switch
    bpf_trace_run3
    __bpf_trace_sched_switch
    __schedule
    schedule
    futex_wait_queue_me
    futex_wait
    do_futex
    __x64_sys_futex
    do_syscall_64
    entry_SYSCALL_64_after_hwframe
    mlockall
    _ZN4absl12lts_2021110224synchronization_internal6Waiter4WaitENS1_13KernelTimeoutE
    AbslInternalPerThreadSemWait_lts_20211102
    _ZN4absl12lts_2021110224synchronization_internal12PerThreadSem4WaitENS1_13KernelTimeoutE
    _ZN4absl12lts_202111025Mutex17DecrementSynchSemEPS1_PNS0_13base_internal14PerThreadSynchENS0_24synchronization_internal13KernelTimeoutE
    _ZN4absl12lts_202111027CondVar10WaitCommonEPNS0_5MutexENS0_24synchronization_internal13KernelTimeoutE
    _ZN4absl12lts_202111027CondVar16WaitWithDeadlineEPNS0_5MutexENS0_4TimeE
    gpr_cv_wait
    _ZL10wait_untilN9grpc_core9TimestampE
    _ZL15timer_main_loopv
    _ZL12timer_threadPv
    _ZZN9grpc_core12_GLOBAL__N_120ThreadInternalsPosixC4EPKcPFvPvES4_PbRKNS_6Thread7OptionsEENKUlS4_E_clES4_
    _ZZN9grpc_core12_GLOBAL__N_120ThreadInternalsPosixC4EPKcPFvPvES4_PbRKNS_6Thread7OptionsEENUlS4_E_4_FUNES4_
    [unknown]
    -                grpc_global_tim (1137523)
        4689072

@ethercflow
Copy link
Contributor Author

@chenhengqi @yonghong-song @davemarchevsky PTAL, thanks!

@KentaTada
Copy link
Contributor

Recently, I have fixed the same issue in #4785. So I'm interested in this PR.
BTW, we need to notice that the license of torvalds/linux@843ff37 is different from libbpf-tools/trace_helpers.c

@ethercflow
Copy link
Contributor Author

Recently, I have fixed the same issue in #4785. So I'm interested in this PR. BTW, we need to notice that the license of torvalds/linux@843ff37 is different from libbpf-tools/trace_helpers.c

Thanks, will modify the license after review done.

@yonghong-song
Copy link
Collaborator

@ethercflow I looked at the code, mostly from high level work flow. It looks fine. But it would be great if you can provide a test/script or something to set up the environment and then to run sudo ./offcputime -p <pid> which exercises the new changes. It would be great!

@ethercflow
Copy link
Contributor Author

@ethercflow I looked at the code, mostly from high level work flow. It looks fine. But it would be great if you can provide a test/script or something to set up the environment and then to run sudo ./offcputime -p <pid> which exercises the new changes. It would be great!

@yonghong-song Thank you for your suggestion, I'll follow up in the near future. :)

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.

3 participants