[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130401202937.GA1022@krava.redhat.com>
Date: Mon, 1 Apr 2013 22:29:37 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Andi Kleen <andi@...stfloor.org>,
David Ahern <dsahern@...il.com>
Subject: Re: [PATCH 5/9] perf sort: Separate out memory-specific sort keys
On Mon, Apr 01, 2013 at 08:35:21PM +0900, Namhyung Kim wrote:
SNIP
> +
> int sort_dimension__add(const char *tok)
> {
> unsigned int i;
> @@ -964,6 +971,33 @@ int sort_dimension__add(const char *tok)
> return 0;
> }
>
> + for (i = 0; i < ARRAY_SIZE(memory_sort_dimensions); i++) {
> + struct sort_dimension *sd = &memory_sort_dimensions[i];
> +
> + if (strncasecmp(tok, sd->name, strlen(tok)))
> + continue;
> +
> + if (sort__mode != SORT_MODE__MEMORY)
> + return -EINVAL;
> +
> + if (sd->entry == &sort_mem_daddr_sym)
> + sort__has_sym = 1;
> +
> + if (sd->taken)
> + return 0;
> +
> + if (sd->entry->se_collapse)
> + sort__need_collapse = 1;
> +
> + if (list_empty(&hist_entry__sort_list))
> + sort__first_dimension = i + __SORT_MEMORY_MODE;
> +
> + list_add_tail(&sd->entry->list, &hist_entry__sort_list);
> + sd->taken = 1;
> +
> + return 0;
nice idea, I wonder some of the above code be put into function
and used also in previous loop, no big deal though
jirka
--
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