All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Taeung Song <treeze.taeung@gmail.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH v4 1/4] perf config: Introduce perf_config_set class
Date: Fri, 1 Apr 2016 11:35:01 -0300	[thread overview]
Message-ID: <20160401143501.GF7115@kernel.org> (raw)
In-Reply-To: <56FE4D0A.60200@gmail.com>

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

  reply	other threads:[~2016-04-01 14:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29  0:43 [PATCH v4 1/4] perf config: Introduce perf_config_set class Taeung Song
2016-03-29 16:12 ` Arnaldo Carvalho de Melo
2016-03-29 23:28   ` Taeung Song
2016-03-30  2:09     ` Namhyung Kim
2016-03-30 11:04       ` Taeung Song
2016-03-31 17:31 ` Arnaldo Carvalho de Melo
2016-04-01 10:27   ` Taeung Song
2016-04-01 14:35     ` Arnaldo Carvalho de Melo [this message]
2016-04-02 11:58       ` Taeung Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160401143501.GF7115@kernel.org \
    --to=acme@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=treeze.taeung@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.