Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
c0a63525
Commit
c0a63525
authored
Oct 29, 2016
by
Sasha Goldshtein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uthreads: Add man page and companion examples file
parent
7160f8a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
0 deletions
+122
-0
man/man8/uthreads.8
man/man8/uthreads.8
+64
-0
tools/uthreads_example.txt
tools/uthreads_example.txt
+58
-0
No files found.
man/man8/uthreads.8
0 → 100644
View file @
c0a63525
.TH uthreads 8 "2016-11-07" "USER COMMANDS"
.SH NAME
uthreads \- Trace thread creation events in Java or pthreads.
.SH SYNOPSIS
.B uthreads [-h] [-l {java}] [-v] pid
.SH DESCRIPTION
This traces thread creation events in Java processes, or pthread creation
events in any process. When a thread is created, its name or start address
is printed.
Since this uses BPF, only the root user can use this tool.
.SH REQUIREMENTS
CONFIG_BPF and bcc.
.SH OPTIONS
.TP
\-l {java}
The language to trace (currently only Java is supported). When no language is
specified, only pthread creations are traced.
.TP
\-v
Print the resulting BPF program, for debugging purposes.
.TP
pid
The process id to trace.
.SH EXAMPLES
.TP
Trace Java thread creations:
#
.B uthreads -l java 148
.TP
Trace pthread creations:
#
.B uthreads 1802
.SH FIELDS
.TP
TIME
The event's time in seconds from the beginning of the trace.
.TP
ID
The thread's ID. The information in this column depends on the runtime.
.TP
TYPE
Event type -- thread start, stop, or pthread event.
.TP
DESCRIPTION
The thread's name or start address function name.
.SH OVERHEAD
Thread start and stop events are usually not very frequent, which makes this
tool's overhead negligible.
.SH SOURCE
This is from bcc.
.IP
https://github.com/iovisor/bcc
.PP
Also look in the bcc distribution for a companion _example.txt file containing
example usage, output, and commentary for this tool.
.SH OS
Linux
.SH STABILITY
Unstable - in development.
.SH AUTHOR
Sasha Goldshtein
.SH SEE ALSO
ustat(8), trace(8)
tools/uthreads_example.txt
0 → 100644
View file @
c0a63525
Demonstrations of uthreads.
uthreads traces thread creation events in Java or raw pthreads, and prints
details about the newly created thread. For Java threads, the thread name is
printed; for pthreads, the thread's start function is printed, if there is
symbol information to resolve it.
For example, trace all Java thread creation events:
# ./uthreads -l java 27420
Tracing thread events in process 27420 (language: java)... Ctrl-C to quit.
TIME ID TYPE DESCRIPTION
18.596 R=9/N=0 start SIGINT handler
18.596 R=4/N=0 stop Signal Dispatcher
^C
The ID column in the preceding output shows the thread's runtime ID and native
ID, when available. The accuracy of this information depends on the Java
runtime.
Next, trace only pthread creation events in some native application:
# ./uthreads 27450
Tracing thread events in process 27450 (language: none)... Ctrl-C to quit.
TIME ID TYPE DESCRIPTION
0.924 27462 pthread primes_thread
0.927 27463 pthread primes_thread
0.928 27464 pthread primes_thread
0.928 27465 pthread primes_thread
^C
The thread name ("primes_thread" in this example) is resolved from debuginfo.
If symbol information is not present, the thread's start address is printed
instead.
USAGE message:
# ./uthreads -h
usage: uthreads.py [-h] [-l {java}] [-v] pid
Trace thread creation/destruction events in high-level languages.
positional arguments:
pid process id to attach to
optional arguments:
-h, --help show this help message and exit
-l {java}, --language {java}
language to trace (none for pthreads only)
-v, --verbose verbose mode: print the BPF program (for debugging
purposes)
examples:
./uthreads -l java 185 # trace Java threads in process 185
./uthreads 12245 # trace only pthreads in process 12245
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment