Re: Benchmarks of kernel tracing options (ftrace, ktrace, lttng and perf)

Mathieu Desnoyers
2010-10-28T19:27:15Z

* David Sharp (dhsharp@google.com) wrote:
[...]
> I hope this produces a fair comparison. I've detailed my steps below
> for all of the tracers in case there are improvements to be made.
>
[...]
> Results for amount of time to execute a tracepoint (includes previous results):
> ktrace: 200ns   (old)
> ftrace: 224ns   (old, w/ handcoded tracepoint, not syscall tracing)
> lttng: 449ns    (new)
> perf: 1047ns    (new)
>
> Also interesting:
> ftrace: 587ns   (old, w/ syscall tracing)
> This just shows that syscall tracing is much slower than a normal tracepoint.

Hrm, not quite fair actually. LTTng enables a thread flag that causes
syscall_trace to be called on sycall entry/exit by default. Please try with the
following patch to remove the extra syscall overhead.

Thanks,

Mathieu

for google benchmarks: remove syscall tracing from LTTng modules

Syscall tracing is enabled by default when lttng is tracing, which causes the
full registers to be saved and a sycall_trace call upon syscall entry/exit.

This patch is for testing only.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
ltt-tracer.c | 2 --
1 file changed, 2 deletions(-)

Index: lttng-modules/ltt-tracer.c
===================================================================
--- lttng-modules.orig/ltt-tracer.c
+++ lttng-modules/ltt-tracer.c
@@ -839,7 +839,6 @@ int ltt_trace_alloc(const char *trace_na
if (list_empty(&ltt_traces.head)) {
mod_timer(&ltt_async_wakeup_timer,
jiffies + LTT_PERCPU_TIMER_INTERVAL);
- set_kernel_trace_flag_all_tasks();
}
list_add_rcu(&trace->list, &ltt_traces.head);
synchronize_trace();
@@ -917,7 +916,6 @@ static int _ltt_trace_destroy(struct ltt
list_del_rcu(&trace->list);
synchronize_trace();
if (list_empty(&ltt_traces.head)) {
- clear_kernel_trace_flag_all_tasks();
/*
* We stop the asynchronous delivery of reader wakeup, but
* we must make one last check for reader wakeups pending