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

support symbol resolution of short-lived process. #2144

Merged
merged 2 commits into from
Jan 23, 2019

Conversation

vijunag
Copy link
Contributor

@vijunag vijunag commented Jan 16, 2019

Support symbol resolution for short-lived processes (#2014)
New command line options have been added to tools/trace.py to support the new BUILD_ID stackmap. List of symbol files can be added to the script to resolve symbols from build id as reported by the kernel in the stack trace. A comma separated list of symbol files can be passed to the script as shown below.

Eg invocation to trace inet_pton(as mentioned in #2014)
python tools/trace.py -s /lib/x86_64-linux-gnu/libc.so.6,/bin/ping 'p:c:inet_pton' -U

Added build_id support for BPF stackmap.
A separate build_id stackmap can be created with the help of new macro BPF_STACK_TRACE_BUILDID
The kernel BPF reports stacktrace in the structure bpf_stack_build_id.
Changes have been made to BPF modules to support resolving symbols mentioned in the above format.
An example tool is also available in tools/stack_buildid_example.py
Copy link
Collaborator

@yonghong-song yonghong-song left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since a new flag is introduced, the example file and man page needs changes as well.

@yonghong-song
Copy link
Collaborator

@brendangregg Now bcc core has stackmap buildid support. This patch tries to amend trace.py for short lived processes. What do you think for trace.py? What else in bcc we may utilize buildid support? profile.py?

@vijunag
Copy link
Contributor Author

vijunag commented Jan 19, 2019

Since a new flag is introduced, the example file and man page needs changes as well.

Updated the man file.

@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

Copy link
Collaborator

@yonghong-song yonghong-song left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, only two minor comments. Could you add an example in trace_example.txt? Thanks!

New command line options have been added to tools/trace.py to support the new BUILD_ID stackmap.
List of symbol files can be added to the script to resolve symbols from build id as reported by the kernel
in the stack trace

Updated man page and added an example usage
@vijunag
Copy link
Contributor Author

vijunag commented Jan 23, 2019

Please note that test bed failures are not due to this change.

@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@yonghong-song
Copy link
Collaborator

Thanks. The change looks good to me.

@yonghong-song yonghong-song merged commit 9924e64 into iovisor:master Jan 23, 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
New command line options have been added to tools/trace.py to support the 
new BUILD_ID stackmap. List of symbol files can be added to the script to 
resolve symbols from build id as reported by the kernel in the stack trace
Updated man page and added an example usage
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
New command line options have been added to tools/trace.py to support the 
new BUILD_ID stackmap. List of symbol files can be added to the script to 
resolve symbols from build id as reported by the kernel in the stack trace
Updated man page and added an example usage
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