lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Feb 2016 23:00:54 +0900
From:	Namhyung Kim <namhyung@...il.com>
To:	Jiri Olsa <jolsa@...hat.com>, Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Jiri Olsa <jolsa@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Andi Kleen <andi@...stfloor.org>,
	Stephane Eranian <eranian@...gle.com>,
	Wang Nan <wangnan0@...wei.com>
Subject: Re: [PATCH 13/23] perf hists: Support filtering in hierarchy mode

Hi Jiri,

2016-02-10 (수), 12:51 +0100, Jiri Olsa:
> On Fri, Feb 05, 2016 at 10:01:45PM +0900, Namhyung Kim wrote:
> 
> SNIP
> 
> > +			parent = parent->parent_he;
> > +		}
> > +	}
> > +
> >  	if (h->filtered)
> >  		return;
> >  
> > @@ -1592,28 +1613,122 @@ static void hists__filter_by_type(struct hists *hists, int type, filter_fn_t fil
> >  	}
> >  }
> >  
> > +static void hists__filter_hierarchy(struct hists *hists, int type, const void *arg)
> > +{
> > +	struct rb_node *nd;
> > +	struct rb_root tmp = RB_ROOT;
> > +	bool saved_unfolded;
> > +
> > +	hists->stats.nr_non_filtered_samples = 0;
> > +
> > +	hists__reset_filter_stats(hists);
> > +	hists__reset_col_len(hists);
> > +
> > +	nd = rb_first(&hists->entries);
> > +	while (nd) {
> > +		struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node);
> > +		int ret;
> > +
> > +		ret = hist_entry__filter(h, type, arg);
> > +
> > +		/*
> > +		 * case 1. non-matching type
> > +		 * zero out the period, set filtered and move to child
> > +		 */
> > +		if (ret < 0) {
> > +			memset(&h->stat, 0, sizeof(h->stat));
> > +			h->filtered |= (1 << type);
> > +
> > +			/* force to go down in the hierarchy */
> > +			saved_unfolded = h->unfolded;
> > +			h->unfolded = true;
> > +
> > +			nd = rb_hierarchy_next(&h->rb_node);
> > +			h->unfolded = saved_unfolded;
> > +		}
> > +		/*
> > +		 * case 2. matched (filter out)
> > +		 * set filtered and move to next
> > +		 */
> > +		else if (ret == 1) {
> 
> slightly confused in here.. so ret == 1 means we matched
> but for example hist_entry__sym_filter:
> 
> +       return sym && (!he->ms.sym || !strstr(he->ms.sym->name, sym));
> 
> returns 1 if we DONT match the symbol

Yes, this was confusing.  I meant it's a matching *type* but
the filter is not matched.


> 
> I always got confused by non/filtered stuff.. I think we should change
> the those names, but haven't come with anything so far..

Yeah, me too.. Filter can have both semantics - opt-in and opt-out.
It also made me hard to choose a good name.

Thanks,
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ