aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/pstack_testrunner
blob: 1e23951d82a714e665fb5e2d31c8854c7848b70f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl -w
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

use strict;

my @pids = `ps auxww | grep "./testrunner" | grep -v grep`;
foreach (@pids) {
    s/^\S+\s+(\d+)\s+.*$/$1/;
    chomp;
}

foreach my $pid (@pids) {
    my $cmd = "pstack $pid";
    system($cmd) == 0 or die "Failed to run '$cmd'";
}