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: <20120420105349.GB9679@infradead.org>
Date:	Fri, 20 Apr 2012 07:53:49 -0300
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	David Ahern <dsahern@...il.com>
Cc:	Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Namhyung Kim <namhyung@...il.com>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 02/13] perf annotate: Parse instruction

Em Thu, Apr 19, 2012 at 05:55:57PM -0600, David Ahern escreveu:
> On 4/19/12 2:33 PM, Arnaldo Carvalho de Melo wrote:
> >  		dl->offset = offset;
> >  		dl->line = strdup(line);
> >  		if (dl->line == NULL)
> >  			goto out_delete;
> >+
> >+		if (offset != -1) {
> >+			char *name = dl->line, tmp;
> >+
> >+			while (isspace(name[0]))
> >+				++name;
> >+
> >+			if (name[0] == '\0')
> >+				goto out_delete;
> >+
> >+			dl->operands = name + 1;
> >+
> >+			while (dl->operands[0] != '\0'&&
> >+			       !isspace(dl->operands[0]))
> >+				++dl->operands;
> >+
> >+			tmp = dl->operands[0];
> >+			dl->operands[0] = '\0';
> >+			dl->name = strdup(name);
> 
> This strdup seems unnecessary. The parsing seems to be:
> 
> dl->line = "\W*name\W*operands"
>    dl->name = -^    ^- = dl_operands
> 
> so name and operands are 2 different parts of the same buffer.

Yeah, but we still want to do searches in the whole line, sure we could
do that using the name + operands parts, but I got lazy at that point.

- Arnaldo
--
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