From 68a4540a3d910f83416fdffa3cc3cba6d8638a11 Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Mon, 1 Sep 2025 18:17:04 +0300 Subject: [PATCH 1/5] PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter - Implemented feature - Started working on the test --- bin/pt-stalk | 97 +++++++++++++++++++++++++++++--------------- lib/bash/collect.sh | 79 +++++++++++++++++++++--------------- t/pt-stalk/pt-2289.t | 79 ++++++++++++++++++++++++++++++++++++ 3 files changed, 189 insertions(+), 66 deletions(-) create mode 100644 t/pt-stalk/pt-2289.t diff --git a/bin/pt-stalk b/bin/pt-stalk index c52a801a..c3faf5a1 100755 --- a/bin/pt-stalk +++ b/bin/pt-stalk @@ -971,8 +971,10 @@ collect_mysql_data_one() { fi fi - $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & - mysqladmin_pid=$! + if ! [ "${OPT_SKIP_COLLECTION}" =~ "mysqladmin" ]; then + $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & + mysqladmin_pid=$! + fi ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \ | sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') @@ -1014,18 +1016,25 @@ collect_system_data() { collect_mysql_data_loop() { - + if ! [ "${OPT_SKIP_COLLECTION}" =~ "processlist" ]; then (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \ >> "$d/$p-processlist" & - (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SELECT * FROM performance_schema.threads\G") \ - >> "$d/$p-threads" & - - if [ "$have_lock_waits_table" ]; then - (echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" & - (echo $ts; transactions) >>"$d/$p-transactions" & fi - if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ]; then + (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SELECT * FROM performance_schema.threads\G") \ + >> "$d/$p-threads" & + + if [ "$have_lock_waits_table" ]; then + if ! [ "${OPT_SKIP_COLLECTION}" =~ "lock-waits" ]; then + (echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" & + fi + if ! [ "${OPT_SKIP_COLLECTION}" =~ "transactions" ]; then + (echo $ts; transactions) >>"$d/$p-transactions" & + fi + fi + + if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ] \ + && ! [ "${OPT_SKIP_COLLECTION}" =~ "ps-locks-transactions" ]; then ps_locks_transactions "$d/$p-ps-locks-transactions" fi @@ -1252,20 +1261,22 @@ innodb_status() { local innostat="" - $CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \ - >> "$d/$p-innodbstatus$n" - grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || { - if [ -d /proc -a -d /proc/$mysqld_pid ]; then - for fd in /proc/$mysqld_pid/fd/*; do - file $fd | grep deleted >/dev/null && { - grep 'INNODB' $fd >/dev/null && { - cat $fd > "$d/$p-innodbstatus$n" - break + if ! [ "${OPT_SKIP_COLLECTION}" =~ "innodbstatus" ]; then + $CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \ + >> "$d/$p-innodbstatus$n" + grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || { + if [ -d /proc -a -d /proc/$mysqld_pid ]; then + for fd in /proc/$mysqld_pid/fd/*; do + file $fd | grep deleted >/dev/null && { + grep 'INNODB' $fd >/dev/null && { + cat $fd > "$d/$p-innodbstatus$n" + break + } } - } - done - fi - } + done + fi + } + fi } rocksdb_status() { @@ -1274,7 +1285,7 @@ rocksdb_status() { has_rocksdb=`$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINES" | grep -i 'rocksdb'` exit_code=$? - if [ $exit_code -eq 0 ]; then + if [ $exit_code -eq 0 ] && ! [ "${OPT_SKIP_COLLECTION}" =~ "rocksdbstatus" ]; then $CMD_MYSQL $EXT_ARGV -e "SHOW ENGINE ROCKSDB STATUS\G" \ >> "$d/$p-rocksdbstatus$n" || rm -f "$d/$p-rocksdbstatus$n" fi @@ -1356,17 +1367,19 @@ collect_mysql_variables() { echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;" - echo -e "\n$sql\n" >> $outfile - $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile + if ! [ "${OPT_SKIP_COLLECTION}" =~ "thread-variables" ]; then + sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;" + echo -e "\n$sql\n" >> $outfile + $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;" - echo -e "\n$sql\n" >> $outfile - $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile + sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;" + echo -e "\n$sql\n" >> $outfile + $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; " - echo -e "\n$sql\n" >> $outfile - $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile + sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; " + echo -e "\n$sql\n" >> $outfile + $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile + fi } @@ -1727,6 +1740,18 @@ main() { log 'Both options --system-only and --mysql-only specified, collecting only disk-space, hostname, output, and trigger metrics'; fi + if [ "$OPT_SKIP_COLLECTION" ]; then + local supported_skips="ps-locks-transactions,thread-variables,innodbstatus,lock-waits,mysqladmin,processlist,rocksdbstatus,transactions" + IFS=',' read -ra skips <<< "$OPT_SKIP_COLLECTION" + for skip in "${skips[@]}"; do + echo "$supported_skips" | grep -q "$skip" + if [ $? -ne 0 ]; then + log "Invalid --skip-collection value: $skip, exiting." + exit 1 + fi + done + fi + # Note: $$ is the parent's PID, but we're a child proc. # Bash 4 has $BASHPID but we can't rely on that. Consequently, # we don't know our own PID. See the usage of $! below. @@ -2391,6 +2416,12 @@ How long to sleep between collection loop cycles. This is useful with C<--no-stalk> to do long collections. For example, to collect data every minute for an hour, specify: C<--no-stalk --run-time 3600 --sleep-collect 60>. +=item --skip-collection + +type: array + +A comma-separated list of collection types to skip. Valid values are: C<"ps-locks-transactions,thread-variables,innodbstatus,lock-waits,mysqladmin,processlist,rocksdbstatus,transactions">. + =item --socket short form: -S; type: string diff --git a/lib/bash/collect.sh b/lib/bash/collect.sh index 9ae0f3db..6648616d 100644 --- a/lib/bash/collect.sh +++ b/lib/bash/collect.sh @@ -243,8 +243,10 @@ collect_mysql_data_one() { # get and keep a connection to the database; in troubled times # the database tends to exceed max_connections, so reconnecting # in the loop tends not to work very well. - $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & - mysqladmin_pid=$! + if ! [ "${OPT_SKIP_COLLECTION}" =~ "mysqladmin" ]; then + $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & + mysqladmin_pid=$! + fi ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \ | sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') @@ -289,18 +291,25 @@ collect_mysql_data_loop() { # SHOW FULL PROCESSLIST duplicates information in performance_schema.threads we collecting now # Keeping it for backward compatibility and may remove in the future - + if ! [ "${OPT_SKIP_COLLECTION}" =~ "processlist" ]; then (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \ >> "$d/$p-processlist" & - (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SELECT * FROM performance_schema.threads\G") \ - >> "$d/$p-threads" & - - if [ "$have_lock_waits_table" ]; then - (echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" & - (echo $ts; transactions) >>"$d/$p-transactions" & fi - if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ]; then + (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SELECT * FROM performance_schema.threads\G") \ + >> "$d/$p-threads" & + + if [ "$have_lock_waits_table" ]; then + if ! [ "${OPT_SKIP_COLLECTION}" =~ "lock-waits" ]; then + (echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" & + fi + if ! [ "${OPT_SKIP_COLLECTION}" =~ "transactions" ]; then + (echo $ts; transactions) >>"$d/$p-transactions" & + fi + fi + + if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ] \ + && ! [ "${OPT_SKIP_COLLECTION}" =~ "ps-locks-transactions" ]; then ps_locks_transactions "$d/$p-ps-locks-transactions" fi @@ -538,20 +547,22 @@ innodb_status() { local innostat="" - $CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \ - >> "$d/$p-innodbstatus$n" - grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || { - if [ -d /proc -a -d /proc/$mysqld_pid ]; then - for fd in /proc/$mysqld_pid/fd/*; do - file $fd | grep deleted >/dev/null && { - grep 'INNODB' $fd >/dev/null && { - cat $fd > "$d/$p-innodbstatus$n" - break + if ! [ "${OPT_SKIP_COLLECTION}" =~ "innodbstatus" ]; then + $CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \ + >> "$d/$p-innodbstatus$n" + grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || { + if [ -d /proc -a -d /proc/$mysqld_pid ]; then + for fd in /proc/$mysqld_pid/fd/*; do + file $fd | grep deleted >/dev/null && { + grep 'INNODB' $fd >/dev/null && { + cat $fd > "$d/$p-innodbstatus$n" + break + } } - } - done - fi - } + done + fi + } + fi } rocksdb_status() { @@ -560,7 +571,7 @@ rocksdb_status() { has_rocksdb=`$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINES" | grep -i 'rocksdb'` exit_code=$? - if [ $exit_code -eq 0 ]; then + if [ $exit_code -eq 0 ] && ! [ "${OPT_SKIP_COLLECTION}" =~ "rocksdbstatus" ]; then $CMD_MYSQL $EXT_ARGV -e "SHOW ENGINE ROCKSDB STATUS\G" \ >> "$d/$p-rocksdbstatus$n" || rm -f "$d/$p-rocksdbstatus$n" fi @@ -646,17 +657,19 @@ collect_mysql_variables() { echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;" - echo -e "\n$sql\n" >> $outfile - $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile + if ! [ "${OPT_SKIP_COLLECTION}" =~ "thread-variables" ]; then + sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;" + echo -e "\n$sql\n" >> $outfile + $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;" - echo -e "\n$sql\n" >> $outfile - $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile + sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;" + echo -e "\n$sql\n" >> $outfile + $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; " - echo -e "\n$sql\n" >> $outfile - $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile + sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; " + echo -e "\n$sql\n" >> $outfile + $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile + fi } diff --git a/t/pt-stalk/pt-2289.t b/t/pt-stalk/pt-2289.t new file mode 100644 index 00000000..f9313ddd --- /dev/null +++ b/t/pt-stalk/pt-2289.t @@ -0,0 +1,79 @@ +#!/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 threads; +use English qw(-no_match_vars); +use Test::More; +use Time::HiRes qw(sleep); + +use PerconaTest; +use DSNParser; +use Sandbox; +require VersionParser; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $dbh = $sb->get_dbh_for('source'); + +if ( !$dbh ) { + plan skip_all => 'Cannot connect to sandbox source'; +} + +my $cnf = "/tmp/12345/my.sandbox.cnf"; +my $pid_file = "/tmp/pt-stalk.pid.$PID"; +my $log_file = "/tmp/pt-stalk.log.$PID"; +my $dest = "/tmp/pt-stalk.collect.$PID"; +my $int_file = "/tmp/pt-stalk-after-interval-sleep"; +my $pid; +my $output; +my $retval; + +sub cleanup { + diag(`rm $pid_file $log_file $int_file 2>/dev/null`); + diag(`rm -rf $dest 2>/dev/null`); +} + +# ########################################################################### +# Test that it collects all data when no --skip-collection is given. +# ########################################################################### + +cleanup(); + +$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 -- --defaults-file=$cnf >$log_file 2>&1"); + +PerconaTest::wait_until(sub { !-f $pid_file }); + +is( + $retval >> 8, + 0, + "Parent exit 0" +); + +ok( + -d $dest, + "Creates --dest (collect) dir" +); + +# ps-locks-transactions,thread-variables,innodbstatus,lock-waits,mysqladmin,processlist,rocksdbstatus,transactions +ok( + glob("$dest/*-ps-locks-transactions"), + "Collects *-ps-locks-transactions" +) or diag(`ls $dest`); + + +# ############################################################################# +# Done. +# ############################################################################# + +cleanup(); +diag(`rm -rf $dest 2>/dev/null`); +$sb->wipe_clean($dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; From 66d20ae6da0e257f1eba33f9269dcdc49de7187d Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Wed, 3 Sep 2025 00:41:06 +0300 Subject: [PATCH 2/5] PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter - Adjusted the implementation - Created test cases --- bin/pt-stalk | 21 +++--- lib/bash/collect.sh | 16 ++--- t/pt-stalk/pt-2289.t | 166 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 184 insertions(+), 19 deletions(-) diff --git a/bin/pt-stalk b/bin/pt-stalk index c3faf5a1..790158a8 100755 --- a/bin/pt-stalk +++ b/bin/pt-stalk @@ -971,7 +971,7 @@ collect_mysql_data_one() { fi fi - if ! [ "${OPT_SKIP_COLLECTION}" =~ "mysqladmin" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "mysqladmin" ]]; then $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & mysqladmin_pid=$! fi @@ -1016,7 +1016,7 @@ collect_system_data() { collect_mysql_data_loop() { - if ! [ "${OPT_SKIP_COLLECTION}" =~ "processlist" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "processlist" ]]; then (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \ >> "$d/$p-processlist" & fi @@ -1025,16 +1025,16 @@ collect_mysql_data_loop() { >> "$d/$p-threads" & if [ "$have_lock_waits_table" ]; then - if ! [ "${OPT_SKIP_COLLECTION}" =~ "lock-waits" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "lock-waits" ]]; then (echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" & fi - if ! [ "${OPT_SKIP_COLLECTION}" =~ "transactions" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "transactions" ]]; then (echo $ts; transactions) >>"$d/$p-transactions" & fi fi if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ] \ - && ! [ "${OPT_SKIP_COLLECTION}" =~ "ps-locks-transactions" ]; then + && ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "ps-locks-transactions" ]]; then ps_locks_transactions "$d/$p-ps-locks-transactions" fi @@ -1261,7 +1261,7 @@ innodb_status() { local innostat="" - if ! [ "${OPT_SKIP_COLLECTION}" =~ "innodbstatus" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "innodbstatus" ]]; then $CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \ >> "$d/$p-innodbstatus$n" grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || { @@ -1285,7 +1285,7 @@ rocksdb_status() { has_rocksdb=`$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINES" | grep -i 'rocksdb'` exit_code=$? - if [ $exit_code -eq 0 ] && ! [ "${OPT_SKIP_COLLECTION}" =~ "rocksdbstatus" ]; then + if [ $exit_code -eq 0 ] && ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "rocksdbstatus" ]]; then $CMD_MYSQL $EXT_ARGV -e "SHOW ENGINE ROCKSDB STATUS\G" \ >> "$d/$p-rocksdbstatus$n" || rm -f "$d/$p-rocksdbstatus$n" fi @@ -1367,7 +1367,7 @@ collect_mysql_variables() { echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - if ! [ "${OPT_SKIP_COLLECTION}" =~ "thread-variables" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "thread-variables" ]]; then sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;" echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile @@ -1741,11 +1741,12 @@ main() { fi if [ "$OPT_SKIP_COLLECTION" ]; then - local supported_skips="ps-locks-transactions,thread-variables,innodbstatus,lock-waits,mysqladmin,processlist,rocksdbstatus,transactions" + local supported_skips=(ps-locks-transactions thread-variables innodbstatus lock-waits mysqladmin processlist rocksdbstatus transactions) IFS=',' read -ra skips <<< "$OPT_SKIP_COLLECTION" + OPT_SKIP_COLLECTION=("${skips[*]}") for skip in "${skips[@]}"; do echo "$supported_skips" | grep -q "$skip" - if [ $? -ne 0 ]; then + if ! [[ " ${supported_skips[@]} " =~ " ${skip} " ]]; then log "Invalid --skip-collection value: $skip, exiting." exit 1 fi diff --git a/lib/bash/collect.sh b/lib/bash/collect.sh index 6648616d..b7507815 100644 --- a/lib/bash/collect.sh +++ b/lib/bash/collect.sh @@ -243,7 +243,7 @@ collect_mysql_data_one() { # get and keep a connection to the database; in troubled times # the database tends to exceed max_connections, so reconnecting # in the loop tends not to work very well. - if ! [ "${OPT_SKIP_COLLECTION}" =~ "mysqladmin" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "mysqladmin" ]]; then $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & mysqladmin_pid=$! fi @@ -291,7 +291,7 @@ collect_mysql_data_loop() { # SHOW FULL PROCESSLIST duplicates information in performance_schema.threads we collecting now # Keeping it for backward compatibility and may remove in the future - if ! [ "${OPT_SKIP_COLLECTION}" =~ "processlist" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "processlist" ]]; then (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \ >> "$d/$p-processlist" & fi @@ -300,16 +300,16 @@ collect_mysql_data_loop() { >> "$d/$p-threads" & if [ "$have_lock_waits_table" ]; then - if ! [ "${OPT_SKIP_COLLECTION}" =~ "lock-waits" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "lock-waits" ]]; then (echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" & fi - if ! [ "${OPT_SKIP_COLLECTION}" =~ "transactions" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "transactions" ]]; then (echo $ts; transactions) >>"$d/$p-transactions" & fi fi if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ] \ - && ! [ "${OPT_SKIP_COLLECTION}" =~ "ps-locks-transactions" ]; then + && ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "ps-locks-transactions" ]]; then ps_locks_transactions "$d/$p-ps-locks-transactions" fi @@ -547,7 +547,7 @@ innodb_status() { local innostat="" - if ! [ "${OPT_SKIP_COLLECTION}" =~ "innodbstatus" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "innodbstatus" ]]; then $CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \ >> "$d/$p-innodbstatus$n" grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || { @@ -571,7 +571,7 @@ rocksdb_status() { has_rocksdb=`$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINES" | grep -i 'rocksdb'` exit_code=$? - if [ $exit_code -eq 0 ] && ! [ "${OPT_SKIP_COLLECTION}" =~ "rocksdbstatus" ]; then + if [ $exit_code -eq 0 ] && ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "rocksdbstatus" ]]; then $CMD_MYSQL $EXT_ARGV -e "SHOW ENGINE ROCKSDB STATUS\G" \ >> "$d/$p-rocksdbstatus$n" || rm -f "$d/$p-rocksdbstatus$n" fi @@ -657,7 +657,7 @@ collect_mysql_variables() { echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - if ! [ "${OPT_SKIP_COLLECTION}" =~ "thread-variables" ]; then + if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "thread-variables" ]]; then sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;" echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile diff --git a/t/pt-stalk/pt-2289.t b/t/pt-stalk/pt-2289.t index f9313ddd..c560fc3a 100644 --- a/t/pt-stalk/pt-2289.t +++ b/t/pt-stalk/pt-2289.t @@ -46,9 +46,38 @@ sub cleanup { cleanup(); +# We need these to collect lock-waits +sub start_thread_pt_1897_1 { + # this must run in a thread because we need to have an active session + # with open transaction + my ($dsn_opts) = @_; + my $dp = new DSNParser(opts=>$dsn_opts); + my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); + my $dbh = $sb->get_dbh_for('source'); + $sb->load_file('source', "t/pt-stalk/samples/PT-1897-1.sql"); +} +my $thr1 = threads->create('start_thread_pt_1897_1', $dsn_opts); +$thr1->detach(); +threads->yield(); +sleep 1; + +sub start_thread_pt_1897_2 { + # this must run in a thread because we need to have an active session + # with waiting transaction + my ($dsn_opts) = @_; + my $dp = new DSNParser(opts=>$dsn_opts); + my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); + my $dbh = $sb->get_dbh_for('source'); + $sb->load_file('source', "t/pt-stalk/samples/PT-1897-2.sql"); +} +my $thr2 = threads->create('start_thread_pt_1897_2', $dsn_opts); +$thr2->detach(); +threads->yield(); + $retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 -- --defaults-file=$cnf >$log_file 2>&1"); -PerconaTest::wait_until(sub { !-f $pid_file }); +sleep 35; +PerconaTest::kill_program(pid_file => $pid_file); is( $retval >> 8, @@ -67,6 +96,141 @@ ok( "Collects *-ps-locks-transactions" ) or diag(`ls $dest`); +ok( + glob("$dest/*-innodbstatus*"), + "Collects *-innodbstatus*" +) or diag(`ls $dest`); + +ok( + glob("$dest/*-lock-waits"), + "Collects *-lock-waits" +) or diag(`ls $dest`); + +ok( + glob("$dest/*-mysqladmin"), + "Collects *-mysqladmin" +) or diag(`ls $dest`); + +ok( + glob("$dest/*-processlist"), + "Collects *-processlist" +) or diag(`ls $dest`); + +ok( + glob("$dest/*-transactions"), + "Collects *-transactions" +) or diag(`ls $dest`); + +# thread-variables +ok( + glob("$dest/*-variables"), + "Collects *-variables" +) or diag(`ls $dest`); + +$output = `cat $dest/*-variables 2>/dev/null`; +like( + $output, + qr/select \* from performance_schema\.variables_by_thread/, + "Thread variables collected" +); # or diag($output); + +SKIP: { + skip "These tests require MyRocks", 1 if ( !$sb->has_engine('source', 'ROCKSDB') ) ; + + # rocksdbstatus + ok( + glob("$dest/*-rocksdbstatus*"), + "Collects *-rocksdbstatus" + ) or diag(`ls $dest`); + + cleanup(); + + $retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection rocksdbstatus -- --defaults-file=$cnf >$log_file 2>&1"); + + sleep 5; + PerconaTest::kill_program(pid_file => $pid_file); + + ok( + ! glob("$dest/*-rocksdbstatus*"), + "Does not collect *-rocksdbstatus" + ) or diag(`ls $dest`); +} + +cleanup(); + +$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection processlist -- --defaults-file=$cnf >$log_file 2>&1"); + +sleep 5; +PerconaTest::kill_program(pid_file => $pid_file); + +ok( + ! glob("$dest/*-processlist"), + "Does not collect *-processlist" +) or diag(`ls $dest`); + +cleanup(); + +$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection ps-locks-transactions,thread-variables,innodbstatus,mysqladmin,processlist,transactions -- --defaults-file=$cnf >$log_file 2>&1"); + +sleep 5; +PerconaTest::kill_program(pid_file => $pid_file); + +ok( + ! glob("$dest/*-ps-locks-transactions"), + "Does not collect *-ps-locks-transactions" +) or diag(`ls $dest`); + +ok( + glob("$dest/*-variables"), + "Collects *-variables" +) or diag(`ls $dest`); + +$output = `cat $dest/*-variables 2>/dev/null`; +unlike( + $output, + qr/select \* from performance_schema\.variables_by_thread/, + "Thread variables not collected" +); # or diag($output); + +ok( + ! glob("$dest/*-innodbstatus"), + "Does not collect *-innodbstatus" +) or diag(`ls $dest`); + +ok( + ! glob("$dest/*-mysqladmin"), + "Does not collect *-mysqladmin" +) or diag(`ls $dest`); + +ok( + ! glob("$dest/*-processlist"), + "Does not collect *-processlist" +) or diag(`ls $dest`); + +ok( + ! glob("$dest/*-transactions"), + "Does not collect *-transactions" +) or diag(`ls $dest`); + +#Unsupported skip-collection value +cleanup(); + +$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection ps-locks-transactions,thread-variables,innodbstatus,mysqladmin,processlist,transaction -- --defaults-file=$cnf >$log_file 2>&1"); + +sleep 5; +PerconaTest::kill_program(pid_file => $pid_file); + +is( + $retval >> 8, + 1, + "Parent exit 1 on unsupported --skip-collection value" +); + +like( + `cat $log_file`, + qr/Invalid --skip-collection value: transaction, exiting./, + "Rejects unsupported --skip-collection value" +); # ############################################################################# # Done. From cdc24c10f0ba12a495ea583760cfef8705315056 Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Fri, 5 Sep 2025 16:08:43 +0300 Subject: [PATCH 3/5] PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter - Implemented _should_skip function as was suggested --- bin/pt-stalk | 55 +++++++++++++++++++++++++++----------------- lib/bash/collect.sh | 29 ++++++++++++++++------- t/pt-stalk/pt-2289.t | 19 +++++++++++++++ 3 files changed, 74 insertions(+), 29 deletions(-) diff --git a/bin/pt-stalk b/bin/pt-stalk index 790158a8..780e5a1f 100755 --- a/bin/pt-stalk +++ b/bin/pt-stalk @@ -971,7 +971,7 @@ collect_mysql_data_one() { fi fi - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "mysqladmin" ]]; then + if ! _should_skip "mysqladmin"; then $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & mysqladmin_pid=$! fi @@ -1016,7 +1016,7 @@ collect_system_data() { collect_mysql_data_loop() { - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "processlist" ]]; then + if ! _should_skip "processlist"; then (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \ >> "$d/$p-processlist" & fi @@ -1025,16 +1025,16 @@ collect_mysql_data_loop() { >> "$d/$p-threads" & if [ "$have_lock_waits_table" ]; then - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "lock-waits" ]]; then + if ! _should_skip "lock-waits"; then (echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" & fi - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "transactions" ]]; then + if ! _should_skip "transactions"; then (echo $ts; transactions) >>"$d/$p-transactions" & fi fi if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ] \ - && ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "ps-locks-transactions" ]]; then + && ! _should_skip "ps-locks-transactions"; then ps_locks_transactions "$d/$p-ps-locks-transactions" fi @@ -1261,7 +1261,7 @@ innodb_status() { local innostat="" - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "innodbstatus" ]]; then + if ! _should_skip "innodbstatus"; then $CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \ >> "$d/$p-innodbstatus$n" grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || { @@ -1285,7 +1285,7 @@ rocksdb_status() { has_rocksdb=`$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINES" | grep -i 'rocksdb'` exit_code=$? - if [ $exit_code -eq 0 ] && ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "rocksdbstatus" ]]; then + if [ $exit_code -eq 0 ] && ! _should_skip "rocksdbstatus"; then $CMD_MYSQL $EXT_ARGV -e "SHOW ENGINE ROCKSDB STATUS\G" \ >> "$d/$p-rocksdbstatus$n" || rm -f "$d/$p-rocksdbstatus$n" fi @@ -1367,7 +1367,7 @@ collect_mysql_variables() { echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "thread-variables" ]]; then + if ! _should_skip "thread-variables"; then sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;" echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile @@ -1383,6 +1383,19 @@ collect_mysql_variables() { } +_should_skip() { + local name=$1 + + for item in "${OPT_SKIP_COLLECTION[@]}"; do + echo $item >> /tmp/sveta + if [ "$item" == "$name" ]; then + return 0 + fi + done + + return 1 +} + # ########################################################################### # End collect package # ########################################################################### @@ -1740,19 +1753,6 @@ main() { log 'Both options --system-only and --mysql-only specified, collecting only disk-space, hostname, output, and trigger metrics'; fi - if [ "$OPT_SKIP_COLLECTION" ]; then - local supported_skips=(ps-locks-transactions thread-variables innodbstatus lock-waits mysqladmin processlist rocksdbstatus transactions) - IFS=',' read -ra skips <<< "$OPT_SKIP_COLLECTION" - OPT_SKIP_COLLECTION=("${skips[*]}") - for skip in "${skips[@]}"; do - echo "$supported_skips" | grep -q "$skip" - if ! [[ " ${supported_skips[@]} " =~ " ${skip} " ]]; then - log "Invalid --skip-collection value: $skip, exiting." - exit 1 - fi - done - fi - # Note: $$ is the parent's PID, but we're a child proc. # Bash 4 has $BASHPID but we can't rely on that. Consequently, # we don't know our own PID. See the usage of $! below. @@ -1810,6 +1810,19 @@ if [ "${0##*/}" = "$TOOL" ] \ fi fi + if [ "$OPT_SKIP_COLLECTION" ]; then + local supported_skips=(ps-locks-transactions thread-variables innodbstatus lock-waits mysqladmin processlist rocksdbstatus transactions) + IFS=',' read -ra skips <<< "$OPT_SKIP_COLLECTION" + OPT_SKIP_COLLECTION=("${skips[@]}") + for skip in "${skips[@]}"; do + echo "$supported_skips" | grep -q "$skip" + if ! [[ " ${supported_skips[@]} " =~ " ${skip} " ]]; then + log "Invalid --skip-collection value: $skip, exiting." + exit 1 + fi + done + fi + if [ -z "$OPT_STALK" -a "$OPT_COLLECT" ]; then # Not stalking; do immediate collect once. OPT_CYCLES=0 diff --git a/lib/bash/collect.sh b/lib/bash/collect.sh index b7507815..00fd5005 100644 --- a/lib/bash/collect.sh +++ b/lib/bash/collect.sh @@ -243,7 +243,7 @@ collect_mysql_data_one() { # get and keep a connection to the database; in troubled times # the database tends to exceed max_connections, so reconnecting # in the loop tends not to work very well. - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "mysqladmin" ]]; then + if ! _should_skip "mysqladmin"; then $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & mysqladmin_pid=$! fi @@ -291,7 +291,7 @@ collect_mysql_data_loop() { # SHOW FULL PROCESSLIST duplicates information in performance_schema.threads we collecting now # Keeping it for backward compatibility and may remove in the future - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "processlist" ]]; then + if ! _should_skip "processlist"; then (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \ >> "$d/$p-processlist" & fi @@ -300,16 +300,16 @@ collect_mysql_data_loop() { >> "$d/$p-threads" & if [ "$have_lock_waits_table" ]; then - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "lock-waits" ]]; then + if ! _should_skip "lock-waits"; then (echo $ts; lock_waits "$d/lock_waits.running") >>"$d/$p-lock-waits" & fi - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "transactions" ]]; then + if ! _should_skip "transactions"; then (echo $ts; transactions) >>"$d/$p-transactions" & fi fi if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ] \ - && ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "ps-locks-transactions" ]]; then + && ! _should_skip "ps-locks-transactions"; then ps_locks_transactions "$d/$p-ps-locks-transactions" fi @@ -547,7 +547,7 @@ innodb_status() { local innostat="" - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "innodbstatus" ]]; then + if ! _should_skip "innodbstatus"; then $CMD_MYSQL $EXT_ARGV -e "SHOW /*!40100 ENGINE*/ INNODB STATUS\G" \ >> "$d/$p-innodbstatus$n" grep "END OF INNODB" "$d/$p-innodbstatus$n" >/dev/null || { @@ -571,7 +571,7 @@ rocksdb_status() { has_rocksdb=`$CMD_MYSQL $EXT_ARGV -e "SHOW ENGINES" | grep -i 'rocksdb'` exit_code=$? - if [ $exit_code -eq 0 ] && ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "rocksdbstatus" ]]; then + if [ $exit_code -eq 0 ] && ! _should_skip "rocksdbstatus"; then $CMD_MYSQL $EXT_ARGV -e "SHOW ENGINE ROCKSDB STATUS\G" \ >> "$d/$p-rocksdbstatus$n" || rm -f "$d/$p-rocksdbstatus$n" fi @@ -657,7 +657,7 @@ collect_mysql_variables() { echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile - if ! [[ "${OPT_SKIP_COLLECTION[@]}" =~ "thread-variables" ]]; then + if ! _should_skip "thread-variables"; then sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;" echo -e "\n$sql\n" >> $outfile $CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile @@ -673,6 +673,19 @@ collect_mysql_variables() { } +_should_skip() { + local name=$1 + + for item in "${OPT_SKIP_COLLECTION[@]}"; do + echo $item >> /tmp/sveta + if [ "$item" == "$name" ]; then + return 0 + fi + done + + return 1 +} + # ########################################################################### # End collect package # ########################################################################### diff --git a/t/pt-stalk/pt-2289.t b/t/pt-stalk/pt-2289.t index c560fc3a..f11c6155 100644 --- a/t/pt-stalk/pt-2289.t +++ b/t/pt-stalk/pt-2289.t @@ -232,6 +232,25 @@ like( "Rejects unsupported --skip-collection value" ); +cleanup(); + +$retval = system("$trunk/bin/pt-stalk --no-stalk --pid $pid_file --log $log_file --dest $dest --iterations 1 --skip-collection 'mysqladmin and' -- --defaults-file=$cnf >$log_file 2>&1"); + +sleep 5; +PerconaTest::kill_program(pid_file => $pid_file); + +is( + $retval >> 8, + 1, + "Parent exit 1 on unsupported --skip-collection value" +); + +like( + `cat $log_file`, + qr/Invalid --skip-collection value: mysqladmin and, exiting./, + "Rejects unsupported --skip-collection value" +); + # ############################################################################# # Done. # ############################################################################# From 919970abe9f44e0956f34692a39ea79bca102653 Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Sat, 6 Sep 2025 21:51:12 +0300 Subject: [PATCH 4/5] PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter - Modified t/pt-stalk/pt-stalk.t, so it calls function purge_samples with the correct number of parameters - Fixed purge_samples, so it can work if variable OPT_PREFIX is not defined --- bin/pt-stalk | 12 ++++++------ t/pt-stalk/pt-stalk.t | 6 ++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bin/pt-stalk b/bin/pt-stalk index 780e5a1f..b69b288f 100755 --- a/bin/pt-stalk +++ b/bin/pt-stalk @@ -1550,7 +1550,7 @@ purge_samples() { local retention_size="$4" # Delete collect files which more than --retention-time days old. - if [ -n "$OPT_PREFIX" ]; then + if [ -n "${OPT_PREFIX:-}" ]; then find "$dir" -maxdepth 1 -type f -mtime +$retention_time -name "$OPT_PREFIX-*" -exec rm -f '{}' \; else find "$dir" -maxdepth 1 -type f -mtime +$retention_time -regextype posix-egrep -regex "$dir/[0-9]{4}(_[0-9]{2}){5}-.*" -exec rm -f '{}' \; @@ -1749,10 +1749,6 @@ stalk() { main() { trap sigtrap SIGHUP SIGINT SIGTERM - if [ "$OPT_SYSTEM_ONLY" ] && [ "$OPT_MYSQL_ONLY" ]; then - log 'Both options --system-only and --mysql-only specified, collecting only disk-space, hostname, output, and trigger metrics'; - fi - # Note: $$ is the parent's PID, but we're a child proc. # Bash 4 has $BASHPID but we can't rely on that. Consequently, # we don't know our own PID. See the usage of $! below. @@ -1796,6 +1792,10 @@ if [ "${0##*/}" = "$TOOL" ] \ mk_tmpdir parse_options "$0" "${@:-""}" + if [ "$OPT_SYSTEM_ONLY" ] && [ "$OPT_MYSQL_ONLY" ]; then + log 'Both options --system-only and --mysql-only specified, collecting only disk-space, hostname, output, and trigger metrics'; + fi + # Verify and set TRIGGER_FUNCTION based on --function. if ! set_trg_func "$OPT_FUNCTION"; then option_error "Invalid --function value: $OPT_FUNCTION" @@ -1811,7 +1811,7 @@ if [ "${0##*/}" = "$TOOL" ] \ fi if [ "$OPT_SKIP_COLLECTION" ]; then - local supported_skips=(ps-locks-transactions thread-variables innodbstatus lock-waits mysqladmin processlist rocksdbstatus transactions) + supported_skips=( "ps-locks-transactions" "thread-variables" "innodbstatus" "lock-waits" "mysqladmin" "processlist" "rocksdbstatus" "transactions" ) IFS=',' read -ra skips <<< "$OPT_SKIP_COLLECTION" OPT_SKIP_COLLECTION=("${skips[@]}") for skip in "${skips[@]}"; do diff --git a/t/pt-stalk/pt-stalk.t b/t/pt-stalk/pt-stalk.t index 87c383cc..f2142154 100644 --- a/t/pt-stalk/pt-stalk.t +++ b/t/pt-stalk/pt-stalk.t @@ -393,18 +393,16 @@ my $tempdir = tempdir( CLEANUP => 1 ); my $script = <<"EOT"; . $trunk/bin/pt-stalk -purge_samples $tempdir 10000 2>&1 +purge_samples $tempdir 10000 0 0 2>&1 EOT -$output = `$script`; +$output = `bash -c "$script"`; unlike( $output, qr/\Qfind: warning: you have specified the -depth option/, "Bug 942114: no bad find usage" ); - - # ########################################################################### # Test that it handles floating point values # ########################################################################### From bfeaa98379733a7221dbc65d295f5b022f02c9fc Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Wed, 10 Sep 2025 18:19:03 +0300 Subject: [PATCH 5/5] PT-2289 - Allow pt-stalk do disable ps-lock-transactions data collection via parameter - Fixed typo found during review --- bin/pt-stalk | 1 - lib/bash/collect.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/bin/pt-stalk b/bin/pt-stalk index b69b288f..28ce1d7c 100755 --- a/bin/pt-stalk +++ b/bin/pt-stalk @@ -1387,7 +1387,6 @@ _should_skip() { local name=$1 for item in "${OPT_SKIP_COLLECTION[@]}"; do - echo $item >> /tmp/sveta if [ "$item" == "$name" ]; then return 0 fi diff --git a/lib/bash/collect.sh b/lib/bash/collect.sh index 00fd5005..73b8126f 100644 --- a/lib/bash/collect.sh +++ b/lib/bash/collect.sh @@ -677,7 +677,6 @@ _should_skip() { local name=$1 for item in "${OPT_SKIP_COLLECTION[@]}"; do - echo $item >> /tmp/sveta if [ "$item" == "$name" ]; then return 0 fi