From: Colin Patrick McCabe Date: Tue, 9 Nov 2010 22:32:49 +0000 (-0800) Subject: ps-ceph.pl: display Ceph tests X-Git-Tag: v0.24~213 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f14dd259c8b5baae82877955191d58c28d71274;p=ceph.git ps-ceph.pl: display Ceph tests Signed-off-by: Colin McCabe --- diff --git a/src/ps-ceph.pl b/src/ps-ceph.pl index 849d24d0a163..f4e83d7eb02d 100755 --- a/src/ps-ceph.pl +++ b/src/ps-ceph.pl @@ -12,6 +12,21 @@ use strict; # Foundation. See file COPYING. # +sub is_ceph_proc { + my $cmdline = @_[0]; + return 1 if $cmdline =~ /\bceph\b/; + return 1 if $cmdline =~ /\bcfuse\b/; + return 1 if $cmdline =~ /\bcmds\b/; + return 1 if $cmdline =~ /\bcmon\b/; + return 1 if $cmdline =~ /\bcosd\b/; + return 1 if $cmdline =~ /\bosdmaptool\b/; + return 1 if $cmdline =~ /\brados\b/; + return 1 if $cmdline =~ /test_/; + return 1 if $cmdline =~ /\bvstart.sh\b/; + + return 0; +} + opendir PROC, "/proc"; while(my $pid = readdir PROC) { next if $pid =~ /\D/; # not a pid @@ -20,6 +35,7 @@ while(my $pid = readdir PROC) { my $cmdline = ; $cmdline =~ s/[^\x20-\x7e]/ /g; close CMDLINE; - next unless $cmdline =~ /\b(ceph|cfuse|cmds|cmon|cosd|osdmaptool|rados|vstart\.sh)\b/; - print "$pid\t$cmdline\n"; + if (is_ceph_proc($cmdline)) { + print "$pid\t$cmdline\n"; + } }