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: <4A1C9E70.8000609@cn.fujitsu.com>
Date:	Wed, 27 May 2009 09:59:12 +0800
From:	Li Zefan <lizf@...fujitsu.com>
To:	Steven Rostedt <rostedt@...dmis.org>
CC:	Ingo Molnar <mingo@...e.hu>, Jens Axboe <jens.axboe@...cle.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Tom Zanussi <tzanussi@...il.com>,
	"Theodore Ts'o" <tytso@....edu>,
	Steven Whitehouse <swhiteho@...hat.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Jeff Moyer <jmoyer@...hat.com>,
	Christoph Hellwig <hch@...radead.org>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] tracing/events: make __string() more general

Steven Rostedt wrote:
> On Wed, 27 May 2009, Li Zefan wrote:
> 
>> Steven Rostedt wrote:
>>> On Tue, 26 May 2009, Li Zefan wrote:
>>>
>>>> This changes __string(..., src) to __string(..., len), thus makes it more
>>>> general, and then block TRACE_EVENT() can use it.
>>>>
>>>> Also introduce __fetch_str(), which is used in TP_assign() and returns
>>>> the address of the string, while __get_str() is used in TP_print().
>>>>
>>>> [ Impact: TRACE_EVENT api change ]
>>> What's the reason for the change?
>>>
>>> Is it to handle NULL pointers? If so, lets change the ftrace.h to handle
>>> it instead.
>>>
>> No, not for this purpose.
>>
>> With __string(..., src), we need to have a source string, but sometimes no
>> source string is available, and what we know is how big the string will be.
>>
>> Take block trace events for example, I want to convert an unsigned char array
>> into a string, after this patch, this can be done this way:
>>
>> TP_STRUCT_entry(
>> 	__string( cmd, rq->cmd_len * 3 )
>> )
>>
>> TP_fast_assign(
>> 	construct_str( cmd )
> 
> What does the construct_str do?
> 

Ah, it's pseudo code.. Should be construct_str(__entry->cmd, rq),
this helper function convert rq->cmd (unsigned char[]) to a string of
hex dump.

No source string is available, so I'm not calling assign_str() in
TP_fast_assign.

> 
>> )
>>
>> TP_prink("%s\n", get_str(cmd))
>>
>> Seems Christoph also runs into this problem while doing his XFS tracing.
>> (and NULL str ptr that I'm not suffering)
>>
>>> This is why I like the Impact line really be a "rational" line.
>>>  "TRACE_EVENT api change" is meaningless to me.
>>>
>> So what should this impact be. :(
> 
> That's the point. I don't know the purpose of the patch except that it 
> changes the API. But changing the API is the means to the end. I'm still 
> confused by what the end is.
> 
--
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