[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54B69B12.50409@gmail.com>
Date: Wed, 14 Jan 2015 09:36:34 -0700
From: David Ahern <dsahern@...il.com>
To: Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>
CC: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Jiri Olsa <jolsa@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Subject: Re: [PATCH v2 2/4] perf tools: Add link argument to dso__find_symbol_by_name()
On 1/14/15 4:18 AM, Namhyung Kim wrote:
> @@ -414,10 +414,24 @@ static struct symbol *symbols__find_by_name(struct rb_root *symbols,
> else if (cmp > 0)
> n = n->rb_right;
> else
> - return &s->sym;
> + break;
> }
>
> - return NULL;
> + if (n == NULL)
> + return NULL;
> +
> + /* return first symbol that has same name (if any) */
> + for (n = rb_prev(n); n; n = rb_prev(n)) {
> + struct symbol_name_rb_node *tmp;
> +
> + tmp = rb_entry(n, struct symbol_name_rb_node, rb_node);
> + if (strcmp(tmp->sym.name, s->sym.name))
strcmp() == 0?
> + break;
> +
> + s = tmp;
> + }
> +
> + return &s->sym;
> }
>
> struct symbol *dso__find_symbol(struct dso *dso,
--
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