Skip to content

Commit

Permalink
tweak event warning
Browse files Browse the repository at this point in the history
  • Loading branch information
brendangregg committed Aug 17, 2017
1 parent 2b0ba56 commit f43f98b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion stackcollapse-perf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ sub remember_stack {
my $tidy_generic = 1; # clean up function names a little
my $target_pname; # target process name from perf invocation
my $event_filter = ""; # event type filter, defaults to first encountered event
my $event_defaulted = 0; # whether we defaulted to an event (none provided)
my $event_warning = 0; # if we printed a warning for the event

my $show_inline = 0;
my $show_context = 0;
Expand Down Expand Up @@ -221,8 +223,15 @@ sub inline {
# event type. Merging together different types, such as
# instructions and cycles, produces misleading results.
$event_filter = $event;
print STDERR "Filtering for events of type: $event\n";
$event_defaulted = 1;
} elsif ($event ne $event_filter) {
if ($event_defaulted and $event_warning == 0) {
# only print this warning if necessary:
# when we defaulted and there was
# multiple event types.
print STDERR "Filtering for events of type: $event\n";
$event_warning = 1;
}
next;
}
}
Expand Down

0 comments on commit f43f98b

Please sign in to comment.