|
@@ -76,7 +76,7 @@ func (p *Profile) FilterSamplesByName(focus, ignore, hide, show *regexp.Regexp)
|
76
|
76
|
// FilterTagsByName filters the tags in a profile and only keeps
|
77
|
77
|
// tags that match show and not hide.
|
78
|
78
|
func (p *Profile) FilterTagsByName(show, hide *regexp.Regexp) (sm, hm bool) {
|
79
|
|
- matchShow := func(name string) bool {
|
|
79
|
+ matchRemove := func(name string) bool {
|
80
|
80
|
matchShow := show == nil || show.MatchString(name)
|
81
|
81
|
matchHide := hide != nil && hide.MatchString(name)
|
82
|
82
|
|
|
@@ -86,16 +86,16 @@ func (p *Profile) FilterTagsByName(show, hide *regexp.Regexp) (sm, hm bool) {
|
86
|
86
|
if matchHide {
|
87
|
87
|
hm = true
|
88
|
88
|
}
|
89
|
|
- return matchShow && !matchHide
|
|
89
|
+ return !matchShow || matchHide
|
90
|
90
|
}
|
91
|
91
|
for _, s := range p.Sample {
|
92
|
92
|
for lab := range s.Label {
|
93
|
|
- if !matchShow(lab) {
|
|
93
|
+ if matchRemove(lab) {
|
94
|
94
|
delete(s.Label, lab)
|
95
|
95
|
}
|
96
|
96
|
}
|
97
|
97
|
for lab := range s.NumLabel {
|
98
|
|
- if !matchShow(lab) {
|
|
98
|
+ if matchRemove(lab) {
|
99
|
99
|
delete(s.NumLabel, lab)
|
100
|
100
|
}
|
101
|
101
|
}
|