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]
Message-ID: <87ppne566j.fsf@sejong.aot.lge.com>
Date:	Mon, 27 Jan 2014 14:45:24 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>,
	Arun Sharma <asharma@...com>,
	Rodrigo Campos <rodrigo@...g.com.ar>,
	Andi Kleen <andi@...stfloor.org>,
	David Ahern <dsahern@...il.com>,
	Stephane Eranian <eranian@...gle.com>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 01/21] perf tools: Introduce struct hist_entry_iter

On Thu, 23 Jan 2014 15:56:54 +0100, Jiri Olsa wrote:
> On Thu, Jan 23, 2014 at 09:13:45AM +0900, Namhyung Kim wrote:
>> There're some duplicate code when adding hist entries.  They are
>> different in that some have branch info or mem info but generally do
>> same thing.  So introduce new struct hist_entry_iter and add callbacks
>> to customize each case in general way.
>> 
>
> SNIP
>
>>  
>> -	if (sort__mode == SORT_MODE__BRANCH) {
>> -		ret = report__add_branch_hist_entry(tool, &al, sample, evsel);
>> -		if (ret < 0)
>> -			pr_debug("problem adding lbr entry, skipping event\n");
>> -	} else if (rep->mem_mode == 1) {
>> -		ret = report__add_mem_hist_entry(tool, &al, sample, evsel, event);
>> -		if (ret < 0)
>> -			pr_debug("problem adding mem entry, skipping event\n");
>> -	} else {
>> -		if (al.map != NULL)
>> -			al.map->dso->hit = 1;
>> -
>> -		ret = report__add_hist_entry(tool, evsel, &al, sample);
>> -		if (ret < 0)
>> -			pr_debug("problem incrementing symbol period, skipping event\n");
>> -	}
>> +	if (sort__mode == SORT_MODE__BRANCH)
>> +		iter.ops = &hist_iter_branch;
>> +	else if (rep->mem_mode == 1)
>
> nit.. mem_mode is bool

Ah, right!  As you can see the old code already did it. ;-p

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ