From: Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com,
yrl.pp-manager.tt@hitachi.com
Subject: Re: [Qemu-devel] [PATCH 1/2] trace: Add ftrace tracing backend
Date: Tue, 09 Apr 2013 19:47:23 +0900 [thread overview]
Message-ID: <5163F1BB.4070000@hitachi.com> (raw)
In-Reply-To: <20130408141054.GE4429@stefanha-thinkpad.redhat.com>
Hello Stefan,
Thank you for reviewing my patch.
(2013/04/08 23:10), Stefan Hajnoczi wrote:
> On Wed, Apr 03, 2013 at 03:30:58PM +0900, Eiichi Tsukata wrote:
>> diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backend/ftrace.py
>> new file mode 100644
>> index 0000000..e02f0ca
>> --- /dev/null
>> +++ b/scripts/tracetool/backend/ftrace.py
>> @@ -0,0 +1,53 @@
>> +#!/usr/bin/env python
>> +# -*- coding: utf-8 -*-
>> +
>> +"""
>> +Ftrace built-in backend.
>> +"""
>> +
>> +__author__ = "Eiichi Tsukata<eiichi.tsukata.xh@hitachi.com>"
>> +__copyright__ = "Copyright (C) 2013 Hitachi, Ltd."
>> +__license__ = "GPL version 2 or (at your option) any later version"
>> +
>> +__maintainer__ = "Stefan Hajnoczi"
>> +__email__ = "stefanha@linux.vnet.ibm.com"
>
> My email is now stefanha@redhat.com. I can fix this up when merging the
> patch.
I see, I'll fix it up.
>
>> + out('static inline void trace_%(name)s(%(args)s)',
>> + '{',
>> + ' char ftrace_buf[MAX_TRACE_STRLEN];',
>> + ' int unused __attribute__ ((unused));'
>> + ' bool _state = trace_event_get_state(%(event_id)s);',
>> + ' if (_state) {',
>> + ' snprintf(ftrace_buf, MAX_TRACE_STRLEN,',
>> + ' "%(name)s " %(fmt)s "\\n" %(argnames)s);',
>> + ' unused = write(trace_marker_fd, ftrace_buf,',
>> + ' MAX_TRACE_STRLEN);',
>
> Looking at kernel/trace/trace.c:tracing_mark_write() the kernel will
> memcpy() the full number of bytes we give.
>
> You could use the snprintf(3) return value (number of characters
> written, excluding NUL byte).
>
> I think that would waste less trace buffer space.
>
Sounds good.
I'll use snprintf(3) return value in V2 patch and send it soon.
Eiichi
> Stefan
> .
>
next prev parent reply other threads:[~2013-04-09 10:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-03 6:30 [Qemu-devel] [PATCH 0/2] New trace backend: ftrace Eiichi Tsukata
2013-04-03 6:30 ` [Qemu-devel] [PATCH 1/2] trace: Add ftrace tracing backend Eiichi Tsukata
2013-04-08 14:10 ` Stefan Hajnoczi
2013-04-09 10:47 ` Eiichi Tsukata [this message]
2013-04-03 6:30 ` [Qemu-devel] [PATCH 2/2] trace: document frace backend Eiichi Tsukata
2013-04-08 14:12 ` [Qemu-devel] [PATCH 0/2] New trace backend: ftrace Stefan Hajnoczi
-- strict thread matches above, loose matches on Subject: below --
2013-04-03 3:41 Eiichi Tsukata
2013-04-03 3:41 ` [Qemu-devel] [PATCH 1/2] trace: Add ftrace tracing backend Eiichi Tsukata
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=5163F1BB.4070000@hitachi.com \
--to=eiichi.tsukata.xh@hitachi.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
--cc=yrl.pp-manager.tt@hitachi.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.