Port improved pt-pmp

- Updated documentation for pt-eustack-resolver and pt-pmp
- Added pt-eustack-resolver, pt-pmp and other missed tools into docs/percona-toolkit.pod
- Removed quickstack support from pt-pmp. We do not need to port this
  improvement, because quickstack is not actively developed and does not
  create useful stack traces for Percona Server for MySQL 8.0.
This commit is contained in:
Sveta Smirnova
2024-01-18 02:57:03 +03:00
parent 56eea61dae
commit 83ba87cc0c
3 changed files with 67 additions and 19 deletions

View File

@@ -113,16 +113,20 @@ foreach $lwp (sort {$a<=>$b} keys %sf)
# ############################################################################ # ############################################################################
# Documentation # Documentation
# ############################################################################ # ############################################################################
=pod =pod
=head1 NAME =head1 NAME
pt-eustack-resover - Get stack traces for a selected program with eu-stack and resolve symbols pt-eustack-resolver - Get stack traces for a selected program with C<eu-stack>
and resolve symbols.
=head1 SYNOPSIS =head1 SYNOPSIS
Usage: pt-eustack-resolver <pid> Usage: pt-eustack-resolver <pid>
pt-eustack-resolver collects stack traces for the process with specified C<pid>.
=head1 RISKS =head1 RISKS
Percona Toolkit is mature, proven in the real world, and well tested, Percona Toolkit is mature, proven in the real world, and well tested,
@@ -143,17 +147,17 @@ server. Before using this tool, please:
=head1 DESCRIPTION =head1 DESCRIPTION
pt-eustack-resover is the tool that gets stack traces for a selected program pt-eustack-resolver is the tool that gets stack traces for a selected program
with eu-stack and resolves symbols. This is companion tool for L<pt-pmp>, called with C<eu-stack> and resolves symbols. This is companion tool for L<pt-pmp|pt-pmp.html>, called
when option --dumper=pteu is specified. when option C<--dumper=pteu> is specified.
eu-stack is a tool from elfutils package that prints a stack for each thread in C<eu-stack> is a tool from L<elfutils|https://sourceware.org/elfutils> package that
a process or core file. eu-stack is faster than gdb and smaller overhead on the prints a stack for each thread in a process or core file. C<eu-stack> is faster
diagnosed process. than gdb and have smaller overhead on the diagnosed process.
=head1 OUTPUT =head1 OUTPUT
Stack for each thread, formatted similarly to `gdb thread apply all bt` output. Stack for each thread, formatted similarly to C<gdb thread apply all bt> output.
=head1 ATTENTION =head1 ATTENTION
@@ -162,7 +166,7 @@ parameters are shown in the output.
=head1 SYSTEM REQUIREMENTS =head1 SYSTEM REQUIREMENTS
You need eu-stack from the elfutils package. You need C<eu-stack> from the L<elfutils|https://sourceware.org/elfutils> package.
=head1 BUGS =head1 BUGS

View File

@@ -619,7 +619,7 @@ aggregate_stacktrace() {
} }
} }
} }
if ( dumper ~ /gdb/ || dumper ~ /qs/ ) { if ( dumper ~ /gdb/ ) {
targ = substr(\$0, index(\$0, \" in \") + 4); targ = substr(\$0, index(\$0, \" in \") + 4);
if ( targ ~ / from / ) { if ( targ ~ / from / ) {
targ = substr(targ, 1, index(targ, \" from \") - 1); targ = substr(targ, 1, index(targ, \" from \") - 1);
@@ -735,14 +735,8 @@ main() {
else else
die "Can't find eu-stack binary from elfutils or pt-eustack-resolver. Exiting" die "Can't find eu-stack binary from elfutils or pt-eustack-resolver. Exiting"
fi fi
elif [ $OPT_DUMPER == "qs" ]; then
if [ `_which quickstack` ]; then
quickstack -l -f -p $OPT_PID >> "$output_file"
else
die "Can't find quickstack binary from https://github.com/yoshinorim/quickstack. Exiting"
fi
fi fi
date +'TS %N.%s %F %T' >> "$output_file" date +'TS %N.%s %F %T' >> "$output_file"
sleep $OPT_INTERVAL sleep $OPT_INTERVAL
done done
@@ -851,7 +845,7 @@ Which binary to trace.
short form: -d; type: string; default: gdb short form: -d; type: string; default: gdb
Which dumper use to get stack traces(gdb: gdb, eu: eu-stack, pteu: pt-eustack-resolver, qs: quickstack). Which dumper use to get stack traces(gdb: gdb, eu: eu-stack, pteu: pt-eustack-resolver).
=item --tids =item --tids
@@ -859,6 +853,28 @@ short form: -t; type: string; default: *
Extract traces only for specific tids. Extract traces only for specific tids.
This option uses regular expressions to select threads. For example, if the
collected stack trace has data for threads:
[New Thread 0x52173940 (LWP 23846)]
[New Thread 0x52132940 (LWP 23845)]
[New Thread 0x520f1940 (LWP 23844)]
[New Thread 0x520b0940 (LWP 23798)]
[New Thread 0x5206f940 (LWP 23776)]
[New Thread 0x5202e940 (LWP 23775)]
[New Thread 0x51fed940 (LWP 23774)]
[New Thread 0x51fac940 (LWP 23728)]
[New Thread 0x51f6b940 (LWP 23727)]
[New Thread 0x51f2a940 (LWP 21264)]
[New Thread 0x51ee9940 (LWP 21263)]
[New Thread 0x51ea8940 (LWP 21201)]
C<-t 21> will print stack traces for threads 21264, 21263, 21201
C<-t 21201,23846> will print stack traces for threads 21201, 23846
C<-t 21201,237.8> will print stack traces for threads 21201, 23798, 23728
=item --help =item --help
Show help and exit. Show help and exit.

View File

@@ -50,6 +50,10 @@ An interactive I/O monitoring tool for GNU/Linux.
Find duplicate indexes and foreign keys on MySQL tables. Find duplicate indexes and foreign keys on MySQL tables.
=item pt-eustack-resolver
Get stack traces for a selected program with eu-stack and resolve symbols.
=item pt-fifo-split =item pt-fifo-split
Split files and pipe lines to a fifo without really splitting. Split files and pipe lines to a fifo without really splitting.
@@ -66,6 +70,10 @@ Convert queries into fingerprints.
Log MySQL foreign key errors. Log MySQL foreign key errors.
=item pt-galera-log-explainer
Filter, aggregate and summarize multiple galera logs together.
=item pt-heartbeat =item pt-heartbeat
Monitor MySQL replication delay. Monitor MySQL replication delay.
@@ -78,6 +86,10 @@ Read queries from a log and analyze how they use indexes.
Watch process IO and print a table of file and I/O activity. Watch process IO and print a table of file and I/O activity.
=item pt-k8s-debug-collector
Collect debug data from a k8s/OpenShift cluster.
=item pt-kill =item pt-kill
Kill MySQL queries that match certain criteria. Kill MySQL queries that match certain criteria.
@@ -94,6 +106,10 @@ Performs checks on MongoDB indexes
Reports query usage statistics by aggregating queries from MongoDB query profiler Reports query usage statistics by aggregating queries from MongoDB query profiler
=item pt-mongodb-summary
Collect information about a MongoDB cluster.
=item pt-mysql-summary =item pt-mysql-summary
Summarize MySQL information nicely. Summarize MySQL information nicely.
@@ -102,6 +118,10 @@ Summarize MySQL information nicely.
ALTER tables without locking them. ALTER tables without locking them.
=item pt-pg-summary
Collect information about a PostgreSQL cluster.
=item pt-pmp =item pt-pmp
Aggregate GDB stack traces for a selected program. Aggregate GDB stack traces for a selected program.
@@ -110,6 +130,10 @@ Aggregate GDB stack traces for a selected program.
Analyze MySQL queries from logs, processlist, and tcpdump. Analyze MySQL queries from logs, processlist, and tcpdump.
=item pt-secure-collect
Collect, sanitize, pack and encrypt data.
=item pt-show-grants =item pt-show-grants
Canonicalize and print MySQL grants so you can effectively replicate, compare and version-control them. Canonicalize and print MySQL grants so you can effectively replicate, compare and version-control them.
@@ -545,7 +569,11 @@ Frank was a full-time Percona Toolkit developer employed by Percona until 2016.
=item Carlos Salguero =item Carlos Salguero
Carlos has been the project's lead developer since 2016. He is hired by Percona. Carlos has been the project's lead developer since 2016 until 2022.
=item Sveta Smirnova
Sveta has been the project's lead developer since 2022.
=item Others =item Others