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: <87lhyrce1z.fsf@sejong.aot.lge.com>
Date:	Wed, 08 Jan 2014 13:06:48 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/5] tools lib traceevent: Add state member to struct trace_seq

Hi Jiri,

On Tue, 7 Jan 2014 14:05:58 +0100, Jiri Olsa wrote:
> On Tue, Jan 07, 2014 at 12:00:09PM +0900, Namhyung Kim wrote:
>
> SNIP
>
>>  void trace_seq_init(struct trace_seq *s);
>> diff --git a/tools/lib/traceevent/trace-seq.c b/tools/lib/traceevent/trace-seq.c
>> index d7f2e68bc5b9..1747aa50ecb0 100644
>> --- a/tools/lib/traceevent/trace-seq.c
>> +++ b/tools/lib/traceevent/trace-seq.c
>> @@ -32,8 +32,9 @@
>>  #define TRACE_SEQ_POISON	((void *)0xdeadbeef)
>>  #define TRACE_SEQ_CHECK(s)						\
>>  do {									\
>> -	if ((s)->buffer == TRACE_SEQ_POISON)			\
>> -		die("Usage of trace_seq after it was destroyed");	\
>> +	if (WARN_ONCE((s)->buffer == TRACE_SEQ_POISON,			\
>> +		      "Usage of trace_seq after it was destroyed"))	\
>> +		(s)->state = TRACE_SEQ__BUFFER_POISONED;		\
>>  } while (0)
>>  
>>  /**
>> @@ -46,6 +47,7 @@ void trace_seq_init(struct trace_seq *s)
>>  	s->readpos = 0;
>>  	s->buffer_size = TRACE_SEQ_BUF_SIZE;
>>  	s->buffer = malloc_or_die(s->buffer_size);
>> +	s->state = TRACE_SEQ__GOOD;
>>  }
>>  
>>  /**
>> @@ -81,7 +83,7 @@ static void expand_buffer(struct trace_seq *s)
>>  	s->buffer_size += TRACE_SEQ_BUF_SIZE;
>>  	s->buffer = realloc(s->buffer, s->buffer_size);
>>  	if (!s->buffer)
>> -		die("Can't allocate trace_seq buffer memory");
>> +		s->state = TRACE_SEQ__MEM_ALLOC_FAILED;
>
> and also here?
>
> 	if (WARN_ONCE(!s->buffer))
> 		s->state = TRACE_SEQ__MEM_ALLOC_FAILED;

Ah, will fix.

>
> otherwise the whole series seems ok,

Thanks for your review!
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