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: <87pq9043tk.fsf@gmail.com>
Date:	Sat, 16 Jun 2012 07:18:15 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Steven Rostedt <rostedt@...dmis.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>,
	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Namhyung Kim <namhyung.kim@....com>
Subject: Re: [PATCH 3/3] tools lib traceevent: Introduce pevent_strerror

Steven Rostedt <rostedt@...dmis.org> writes:
> On Fri, 2012-06-15 at 18:04 +0900, Namhyung Kim wrote:
>> > If you need the code to be thread safe, have all errors do:
>> >
>> > 	ret = pevent_foo();
>> > 	if (ret < 0) {
>> > 		pevent_strerr_val(ret, buf, buflen);
>> >
>> >
>> > For programs that do not need to be thread safe, then:
>> >
>> > 	ret = pevent_foo();
>> > 	if (ret < 0) {
>> > 		pevent_strerr(pevent, buf, buflen);
>> >
>> 
>> Do we really need these two? I think having a single API is just
>> enough, IMHO.
>
> Hmm, maybe not. I guess I was confused about the need to pass the pevent
> into the function. I think we only need the return val. Or is there
> other data in the future that you envision will require needing pevent
> passed in?
>

I was thinking about a way to provide additional information in case of
a parse error by saving them into the pevent. But it turned out to make
the API non-thread-safe. :/ I couldn't find a good way yet.

So, for now, passing the return value only would be enough. But I think
passing pevent into a function name started by pevent_ looks natural. :)

Thanks,
Namhyung

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