All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jovi Zhangwei <jovi.zhangwei@gmail.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: Re: [PATCH 14/28] ktap: add runtime/kp_events.[c|h]
Date: Tue, 1 Apr 2014 15:28:00 +0800	[thread overview]
Message-ID: <CAGdX0WFSqzWwbpS4zc6L-_nP7xYRjV4Q8e-sah-iX14KcNgDNw@mail.gmail.com> (raw)
In-Reply-To: <533A63C8.70800@hitachi.com>

On Tue, Apr 1, 2014 at 2:59 PM, Masami Hiramatsu
<masami.hiramatsu.pt@hitachi.com> wrote:
> (2014/03/31 19:14), Jovi Zhangwei wrote:
>> On Mon, Mar 31, 2014 at 5:10 PM, Masami Hiramatsu
>> <masami.hiramatsu.pt@hitachi.com> wrote:
>>> (2014/03/28 22:47), Jovi Zhangwei wrote:
>>>> kp_events.c handle ktap events management(registry, destroy, event callback)
>>>>
>>>> This file is core event management interface between ktap and kernel.
>>>>
>>>> Exposed functions:
>>>> 1). kp_events_init/kp_events_exit
>>>>
>>>> 2). kp_event_create_kprobe
>>>>         create kprobe event, for example:
>>>>                 kdebug.kprobe("SyS_futex", function () {})
>>>>
>>>> 3). kp_event_create_tracepoint
>>>>         create tracepoint event, for example"
>>>>                 kdebug.tracepoint("sys_futex_enter", function () {})
>>>>
>>>> 4). kp_event_create
>>>>         create perf backend event, for example:
>>>>                 trace sched:sched_switch { print(argstr) }
>>>>
>>>>         It call kernel function 'perf_event_create_kernel_counter' to
>>>>         register event(tracepoint/kprobe/uprobe)
>>>>
>>>> 5). kp_event_getarg
>>>>         get argument of event, from arg0 to arg9,
>>>>         only can be called in probe context.
>>>>                 trace sched:sched_switch { print(arg0, arg1) }
>>>>
>>>> 6). kp_event_stringify/kp_event_tostr
>>>>         stringify argstr, sometimes if store argstr as key to table,
>>>>         then it need to stringify firstly, like below:
>>>>                 var s={} trace sched:sched_switch { s[argstr] += 1 }
>>>>         (This is quite rare usage, but ktap support it)
>>>>
>>>> Note:
>>>> Why ktap support 'kdebug.kprobe' and 'kdebug.tracepoint' when
>>>> it already support perf backend event(trace xxx {})?
>>>>
>>>> Because benchmark shows raw kprobe and tracpoint interface is faster
>>>> than perf backed tracing, nearly 10+%, it's more fair to compare
>>>> with Systemtap by raw tracing syntax, not perf backend tracing.
>>>>
>>>
>>> Do we really need it just for a +10% performance? I doubt that.
>>> I think the benefit point of ktap is "dynamic & simple programmable
>>> tracer in kernel", not the good performance at least at this point.
>>> Thus I think we should start ktap only with perf backend.
>>>
>> Yeah, agreed, most people like the perf-backed tracing syntax,
>> that raw trace interface is just for benchmark when I wanted to look
>> overhead compare with stap, the result is very inspiring, ktap table
>> operation overhead is lower than stap.
>>
>> On the performance overhead of dynamic tracing tools(ktap/stap/dtrace),
>> it's interesting enough that dtrace was used in production many year,
>> _but_ IMO the runtime of dtrace is slow after I checked dtrace source
>> code :),  system workload does big matter than tracing tool overhead.
>
> Yeah, I see that less overhead is also required especially for enterprise
> people. I just doubt that it is solved by ktap itself. Should we improve
> perf(or ftrace) to export more effective interfaces for this kind of
> tracers?
>
Yes, I also think it would be better to improve perf/ftrace unified callback
overhead, not to let each tracer(stap/ktap/lttng) develop its own raw
trace callback for performance reason.

Those raw trace interfaces(only designed for benchmark) will be remove
in next version, if we think it's worth to continue.

Thanks.

Jovi

  reply	other threads:[~2014-04-01  7:28 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 13:47 [RFC PATCH 00/28] ktap: A lightweight dynamic tracing tool for Linux Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 01/28] ktap: add README file Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 02/28] ktap: add ktap tutorial Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 03/28] ktap: add sample scripts Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 04/28] ktap: add basic ktap types definition Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 05/28] ktap: add bytecode definition Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 06/28] ktap: add include/ktap_arch.h and error header file Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 07/28] ktap: add runtime/ktap.[c|h] Jovi Zhangwei
2014-03-28 18:38   ` Andi Kleen
2014-03-29  7:32     ` Jovi Zhangwei
2014-03-29 17:04       ` Greg Kroah-Hartman
2014-03-30  7:26         ` Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 08/28] ktap: add runtime/kp_bcread.[c|h] Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 09/28] ktap: add runtime/kp_vm.[c|h] Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 10/28] ktap: add runtime/kp_str.[c|h] and runtime/kp_mempool.[c|h] Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 11/28] ktap: add runtime/kp_tab.[c|h] Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 12/28] ktap: add runtime/kp_obj.[c|h] Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 13/28] ktap: add runtime/kp_transport.[c|h] Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 14/28] ktap: add runtime/kp_events.[c|h] Jovi Zhangwei
2014-03-31  9:10   ` Masami Hiramatsu
2014-03-31 10:14     ` Jovi Zhangwei
2014-04-01  6:59       ` Masami Hiramatsu
2014-04-01  7:28         ` Jovi Zhangwei [this message]
2014-04-01  8:05           ` Masami Hiramatsu
2014-03-28 13:47 ` [PATCH 15/28] ktap: add built-in functions and library (runtime/lib_*.c) Jovi Zhangwei
2014-03-28 18:51   ` Andi Kleen
2014-03-29  4:15     ` Jovi Zhangwei
2014-03-30  0:58       ` Andi Kleen
2014-03-31  2:01         ` Jovi Zhangwei
2014-03-31 13:13           ` Andi Kleen
2014-04-02  1:44             ` Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 16/28] ktap: add runtime/amalg.c Jovi Zhangwei
2014-03-28 18:52   ` Andi Kleen
2014-03-29  7:38     ` Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 17/28] ktap: add userspace/kp_main.c Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 18/28] ktap: add compiler(userspace/kp_lex.[c|h] and userspace/kp_parse.[c|h]) Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 19/28] ktap: add userspace/symbol.[c|h] Jovi Zhangwei
2014-04-01  7:28   ` Masami Hiramatsu
2014-03-28 13:47 ` [PATCH 20/28] ktap: add userspace/kp_parse_events.c Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 21/28] ktap: add userspace/kp_reader.c Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 22/28] ktap: add userspace/kp_bcwrite.c Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 23/28] ktap: add userspace/kp_util.c Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 24/28] ktap: add Makefile Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 25/28] ktap: add Kconfig Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 26/28] ktap: add testsuite Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 27/28] ktap: add vim syntax file Jovi Zhangwei
2014-03-28 13:47 ` [PATCH 28/28] ktap: add COPYRIGHT file Jovi Zhangwei
2014-03-28 16:08 ` [RFC PATCH 00/28] ktap: A lightweight dynamic tracing tool for Linux Greg Kroah-Hartman
2014-03-29  1:46   ` Jovi Zhangwei
2014-03-31  7:17 ` Ingo Molnar
2014-03-31 10:01   ` Jovi Zhangwei
2014-03-31 21:29     ` Alexei Starovoitov
2014-04-01  4:47       ` Jovi Zhangwei
2014-04-02  4:57         ` Alexei Starovoitov
2014-04-02  6:37           ` Jovi Zhangwei
2014-04-02  7:43             ` Ingo Molnar
2014-04-02  8:49               ` Jovi Zhangwei
2014-04-04  7:36                 ` Ingo Molnar
2014-04-08  6:50                   ` Jovi Zhangwei
2014-04-14 15:11                     ` Ingo Molnar
2014-04-14 15:28                       ` Daniel Borkmann
2014-04-02  7:42           ` Ingo Molnar
2014-04-07 13:55             ` Peter Zijlstra
2014-04-08  7:40               ` Masami Hiramatsu
2014-04-08  9:08                 ` Peter Zijlstra
2014-04-02  7:36         ` Ingo Molnar
2014-03-31 20:06   ` Daniel Borkmann
2014-03-31  9:18 ` Masami Hiramatsu

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=CAGdX0WFSqzWwbpS4zc6L-_nP7xYRjV4Q8e-sah-iX14KcNgDNw@mail.gmail.com \
    --to=jovi.zhangwei@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@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 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.