From: Li Zefan <lizf@cn.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>, Jens Axboe <jens.axboe@oracle.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Tom Zanussi <tzanussi@gmail.com>, "Theodore Ts'o" <tytso@mit.edu>,
Steven Whitehouse <swhiteho@redhat.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Jeff Moyer <jmoyer@redhat.com>,
Christoph Hellwig <hch@infradead.org>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] tracing/events: make __string() more general
Date: Wed, 27 May 2009 09:59:12 +0800 [thread overview]
Message-ID: <4A1C9E70.8000609@cn.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0905262147470.27902@gandalf.stny.rr.com>
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.
>
next prev parent reply other threads:[~2009-05-27 1:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 4:03 [PATCH v2 0/2] tracing/events: convert block trace points to TRACE_EVENT() Li Zefan
2009-05-26 4:04 ` [PATCH v2 1/2] tracing/events: make __string() more general Li Zefan
2009-05-26 6:02 ` Christoph Hellwig
2009-05-27 1:43 ` Li Zefan
2009-05-27 7:30 ` Christoph Hellwig
2009-05-27 8:12 ` Li Zefan
2009-05-27 9:55 ` Christoph Hellwig
2009-05-26 20:56 ` Steven Rostedt
2009-05-27 1:24 ` Li Zefan
2009-05-27 1:49 ` Steven Rostedt
2009-05-27 1:59 ` Li Zefan [this message]
2009-05-27 2:15 ` Steven Rostedt
2009-05-27 2:33 ` Li Zefan
2009-05-27 2:47 ` Steven Rostedt
2009-05-27 7:22 ` Christoph Hellwig
2009-05-26 4:05 ` [PATCH v2 2/2] tracing/events: convert block trace points to TRACE_EVENT() Li Zefan
2009-06-09 5:43 ` [PATCH v3] " Li Zefan
2009-06-10 9:22 ` [tip:tracing/core] " tip-bot for Li Zefan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A1C9E70.8000609@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=fweisbec@gmail.com \
--cc=hch@infradead.org \
--cc=jens.axboe@oracle.com \
--cc=jmoyer@redhat.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=swhiteho@redhat.com \
--cc=tytso@mit.edu \
--cc=tzanussi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.