linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiaying Zhang <jiayingz@google.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Jason Baron <jbaron@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, fweisbec@gmail.com,
	laijs@cn.fujitsu.com, rostedt@goodmis.org, peterz@infradead.org,
	mathieu.desnoyers@polymtl.ca, mbligh@google.com,
	roland@redhat.com, fche@redhat.com
Subject: Re: [PATCH 0/3] tracepoints: delay argument evaluation
Date: Wed, 20 May 2009 19:15:23 -0700	[thread overview]
Message-ID: <5df78e1d0905201915l6b81ef7cn8d1836faf9e11726@mail.gmail.com> (raw)
In-Reply-To: <4A14B56F.6030109@cn.fujitsu.com>

But if we convert blktrace to use event tracer interface, we can have:

trace_block_bio_complete(md, bio);

TRACE_EVENT(block_bio_complete,
        TP_PROTO(struct mapped_device *md, struct bio *bio),
...
        TP_fast_assign(
                __entry->queue            = md->queue;
...
        ),
);

Jiaying

On Wed, May 20, 2009 at 6:59 PM, Li Zefan <lizf@cn.fujitsu.com> wrote:
> Jiaying Zhang wrote:
>> Is it possible to convert blktrace to use event tracer? Then in this case we
>
> Yes, I'm doing this, see:
>        http://marc.info/?l=linux-kernel&m=124228198011297&w=2
>
>> can pass 'md' as the parameter to trace_block_bio_complete and dereference
>> md->queue during assignment.
>>
>
> But the problem discussed here exists whether you use plain tracepoints
> or TRACE_EVENT.
>
> Though we can add a new tracepoint named trace_md_bio_complete, this is
> not the way to solve it.
>
>> Jiaying
>>
>> On Wed, May 20, 2009 at 8:42 AM, Jason Baron <jbaron@redhat.com> wrote:
>>> On Wed, May 20, 2009 at 09:33:48AM +0200, Ingo Molnar wrote:
>>>> hm, this is really a compiler bug in essence - the compiler should
>>>> delay the construction of arguments into unlikely branches - if the
>>>> arguments are only used there.
>>>>
>>>> We'd basically open-code a clear-cut:
>>>>
>>>>    trace_block_bio_complete(md->queue, bio);
>>>>
>>>> into this form:
>>>>
>>>>    trace(block_bio_complete, md->queue, bio);
>>>>
>>>> .. and this latter form could become moot (and a nuisance) if the
>>>> compiler is fixed.
>>>>
>>>> Have you tried very latest GCC, does it still have this optimization
>>>> problem?
>>>>
>>>> Note that the compiler getting this right would help a _lot_ of
>>>> other inline functions in the kernel as well. Arguments only used
>>>> within unlikely() branches are quite common.
>>>>
>>>>       Ingo
>>> hi,
>>>
>>> I e-mailed the gcc list, where they suggested using a macro, as I've
>>> done. They also suggested filing an enhancement request for this, which
>>> I've done: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40207 It seems
>>> like they agree with the suggestion.
>>>
>>> It still might make sense to make this requirement explicit (by adding
>>> the extra macro), as the tracepoint off case should really be as optimized as
>>> possible.
>>>
>>> thanks,
>>>
>>> -Jason
>>>
>

  reply	other threads:[~2009-05-21  2:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 21:03 [PATCH 0/3] tracepoints: delay argument evaluation Jason Baron
2009-05-19 21:03 ` [PATCH 1/3] tracepoints: add tracepoint_call() to optimize tracepoints disabled Jason Baron
2009-05-19 21:03 ` [PATCH 2/3] tracepoints: convert scheduler tracepoints to 'tracepoint_call' api Jason Baron
2009-05-19 21:03 ` [PATCH 3/3] tracepoints: convert block " Jason Baron
2009-05-19 21:17 ` [PATCH 0/3] tracepoints: delay argument evaluation Mathieu Desnoyers
2009-05-19 22:16   ` Jason Baron
2009-05-19 22:25     ` Roland McGrath
2009-05-19 22:31       ` Steven Rostedt
2009-05-19 22:36   ` Steven Rostedt
2009-05-19 23:52     ` Frederic Weisbecker
2009-05-20  0:33     ` Mathieu Desnoyers
2009-05-20  0:42       ` Steven Rostedt
2009-05-20  7:01       ` Roland McGrath
2009-05-20  7:12 ` Peter Zijlstra
     [not found]   ` <20090520072750.DA9A0FC38D@magilla.sf.frob.com>
2009-05-20  7:38     ` Peter Zijlstra
2009-05-20  9:18       ` Roland McGrath
2009-05-20  7:33 ` Ingo Molnar
2009-05-20 15:42   ` Jason Baron
2009-05-21  1:49     ` Jiaying Zhang
2009-05-21  1:59       ` Li Zefan
2009-05-21  2:15         ` Jiaying Zhang [this message]
2009-05-21  2:41           ` 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=5df78e1d0905201915l6b81ef7cn8d1836faf9e11726@mail.gmail.com \
    --to=jiayingz@google.com \
    --cc=fche@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=jbaron@redhat.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mbligh@google.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).