| 44 | | |
| 45 | | my $got_malloc = 0; |
| 46 | | foreach my $stat_key (keys %{$misc_stats->{'total'}}) { |
| 47 | | if ($stat_key =~ /^malloc/) { |
| 48 | | $got_malloc = 1; |
| 49 | | last; |
| 50 | | } |
| 51 | | } |
| 52 | | ok(! $got_malloc, 'no malloc stats in misc stats'); |
| 53 | | |
| 54 | | my $malloc_stats = $memd->stats('malloc'); |
| 55 | | ok($malloc_stats, 'got malloc stats'); |
| 56 | | isa_ok($malloc_stats, 'HASH', 'malloc stats'); |
| 57 | | isa_ok($malloc_stats->{'total'}, 'HASH', 'malloc stats total'); |
| 58 | | isa_ok($misc_stats->{'hosts'}, 'HASH', 'malloc stats hosts'); |
| 59 | | isa_ok($misc_stats->{'hosts'}{$testaddr}, 'HASH', |
| 60 | | "malloc stats host $testaddr"); |
| 61 | | |
| 62 | | $got_malloc = 0; |
| 63 | | foreach my $stat_key (keys %{$malloc_stats->{'total'}}) { |
| 64 | | if ($stat_key =~ /^malloc/) { |
| 65 | | $got_malloc = 1; |
| 66 | | last; |
| 67 | | } |
| 68 | | } |
| 69 | | ok($got_malloc, 'malloc stats in malloc stats'); |
| 70 | | |
| 71 | | my $got_misc = 0; |
| 72 | | foreach my $stat_key (@misc_stats_keys) { |
| 73 | | if (exists $malloc_stats->{'total'}{$stat_key}) { |
| 74 | | $got_misc = 1; |
| 75 | | last; |
| 76 | | } |
| 77 | | } |
| 78 | | ok(! $got_misc, 'no misc stats in malloc stats'); |