Port improved pt-pmp

- Added test case for option --tids
This commit is contained in:
Sveta Smirnova
2024-01-18 15:56:33 +03:00
parent 83ba87cc0c
commit fc6e5b3673
4 changed files with 49 additions and 0 deletions

42
t/pt-pmp/pt-pmp-threads.t Normal file
View 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;

View 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)

View 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)

View 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)