mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-27 16:12:04 +00:00
Port improved pt-pmp
- Added test case for option --tids
This commit is contained in:
42
t/pt-pmp/pt-pmp-threads.t
Normal file
42
t/pt-pmp/pt-pmp-threads.t
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
|
||||||
|
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
|
||||||
|
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
|
||||||
|
};
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings FATAL => 'all';
|
||||||
|
use English qw(-no_match_vars);
|
||||||
|
|
||||||
|
use PerconaTest;
|
||||||
|
use Test::More;
|
||||||
|
|
||||||
|
my $sample = "$trunk/t/pt-pmp/samples/stacktrace001.in";
|
||||||
|
|
||||||
|
ok(
|
||||||
|
no_diff(
|
||||||
|
"$trunk/bin/pt-pmp -t ^25 $sample",
|
||||||
|
"t/pt-pmp/samples/stacktrace001_t25.out",
|
||||||
|
),
|
||||||
|
'-t ^25 prints stack traces for threads those numbers start from 25'
|
||||||
|
) or diag($test_diff);
|
||||||
|
|
||||||
|
ok(
|
||||||
|
no_diff(
|
||||||
|
"$trunk/bin/pt-pmp -t 21201,23846 $sample",
|
||||||
|
"t/pt-pmp/samples/stacktrace001_t21201_23846.out",
|
||||||
|
),
|
||||||
|
'-t 21201,23846 prints stack traces for threads 21201,23846'
|
||||||
|
) or diag($test_diff);
|
||||||
|
|
||||||
|
ok(
|
||||||
|
no_diff(
|
||||||
|
"$trunk/bin/pt-pmp -t 21201,237.8 $sample",
|
||||||
|
"t/pt-pmp/samples/stacktrace001_t21201_237_8.out",
|
||||||
|
),
|
||||||
|
'-t 21201,237.8 prints stack traces for threads 21201, 23798, 23728'
|
||||||
|
) or diag($test_diff);
|
||||||
|
|
||||||
|
done_testing;
|
1
t/pt-pmp/samples/stacktrace001_t21201_237_8.out
Normal file
1
t/pt-pmp/samples/stacktrace001_t21201_237_8.out
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3 __lll_mutex_lock_wait(libpthread.so.0),_L_mutex_lock_1133(libpthread.so.0),pthread_mutex_lock(libpthread.so.0),safe_mutex_lock,open_table,open_tables,open_and_lock_tables,mysql_execute_command,mysql_parse,dispatch_command,handle_one_connection,start_thread(libpthread.so.0),clone(libc.so.6)
|
2
t/pt-pmp/samples/stacktrace001_t21201_23846.out
Normal file
2
t/pt-pmp/samples/stacktrace001_t21201_23846.out
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1 __lll_mutex_lock_wait(libpthread.so.0),_L_mutex_lock_1133(libpthread.so.0),pthread_mutex_lock(libpthread.so.0),safe_mutex_lock,open_table,open_tables,open_and_lock_tables,mysql_execute_command,mysql_parse,dispatch_command,handle_one_connection,start_thread(libpthread.so.0),clone(libc.so.6)
|
||||||
|
1 __lll_mutex_lock_wait(libpthread.so.0),_L_mutex_lock_1133(libpthread.so.0),pthread_mutex_lock(libpthread.so.0),safe_mutex_lock,close_thread_tables,dispatch_command,handle_one_connection,start_thread(libpthread.so.0),clone(libc.so.6)
|
4
t/pt-pmp/samples/stacktrace001_t25.out
Normal file
4
t/pt-pmp/samples/stacktrace001_t25.out
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
7 read(libpthread.so.0),vio_read(unistd.h:35),my_real_read,my_net_read,handle_one_connection,start_thread(libpthread.so.0),clone(libc.so.6)
|
||||||
|
2 pthread_cond_wait,safe_cond_wait,end_thread,handle_one_connection,start_thread(libpthread.so.0),clone(libc.so.6)
|
||||||
|
1 __lll_mutex_lock_wait(libpthread.so.0),_L_mutex_lock_1133(libpthread.so.0),pthread_mutex_lock(libpthread.so.0),safe_mutex_lock,open_table,open_tables,open_and_lock_tables,mysql_execute_command,mysql_parse,dispatch_command,handle_one_connection,start_thread(libpthread.so.0),clone(libc.so.6)
|
||||||
|
1 __lll_mutex_lock_wait(libpthread.so.0),_L_mutex_lock_1133(libpthread.so.0),pthread_mutex_lock(libpthread.so.0),safe_mutex_lock,close_thread_tables,dispatch_command,handle_one_connection,start_thread(libpthread.so.0),clone(libc.so.6)
|
Reference in New Issue
Block a user