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:	Fri, 1 Apr 2016 11:35:01 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Taeung Song <treeze.taeung@...il.com>
Cc:	Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
	Namhyung Kim <namhyung@...nel.org>,
	linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v4 1/4] perf config: Introduce perf_config_set class

Em Fri, Apr 01, 2016 at 07:27:22PM +0900, Taeung Song escreveu:
> On 04/01/2016 02:31 AM, Arnaldo Carvalho de Melo wrote:
> >Em Tue, Mar 29, 2016 at 09:43:13AM +0900, Taeung Song escreveu:
> >>+static int collect_config(const char *var, const char *value,
> >>+			  void *perf_config_set)
> >>+{
> >>+	int ret = -1;
> >>+	char *ptr, *key;
> >>+	char *section_name, *name;
> >>+	struct perf_config_section *section = NULL;
> >>+	struct perf_config_item *config_item = NULL;
> >>+	struct perf_config_set *perf_configs = perf_config_set;
> >>+	struct list_head *sections = &perf_configs->sections;

> >>+	key = ptr = strdup(var);
> >>+	if (!key) {
> >>+		pr_err("%s: strdup failed\n", __func__);

> >pr_debug()
 
> I'll change pr_err to pr_debug.
> But why do use pr_debug at only this part ?

Well, ideally one would propagate the errors from library level code to
the code in the tool, i.e. closer to builtin-foo.c, where it would
decide how to present it to the user.

For extra messages, that may help a more advanced user or to be sent to
the tool developers, use pr_debug().

<SNIP>
 
> >>+struct perf_config_section {
> >>+	char *name;
> >>+	struct list_head config_items;

> >s/config_items/items/g

> >>+	struct list_head list;

> >s/list/node/g
> >>+};
> >>+
> >>+struct perf_config_set {
> >>+	struct list_head sections;

> >See? Here you did it right, no point in having it as "config_sections"

> I'll rename it to 'config_sections'.

I meant to keep this one like it is, i.e. perf_config_set->sections, and
use the same principle: shorter names, removing useless stuff like
"config_", that in this case can be implied by the name of the class,
and apply it to the perf_config_section case, making it
perf_config_section->items, ok?

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ