All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] tracing: Tracing integration - dynamic ftrace for SystemTap
@ 2009-09-15 10:06 Atsushi Tsuji
  2009-09-15 10:15 ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Atsushi Tsuji @ 2009-09-15 10:06 UTC (permalink / raw)
  To: linux-kernel, rostedt, Ingo Molnar, fweisbec, Frank Ch. Eigler
  Cc: Peter Zijlstra, paulus, systemtap

Hi,

Currently, there are some tracers using in Linux. Each of them are
developed for different users and situations.

Ftrace has own probe mechanism, dynamic ftrace, and various plugins,
and it can be used without particular userland tools. It is suitable
for kernel developer. The performance counters have own userland tool
merged in the kernel tree and it's easy to trace kernel events by using
this tool. It is suitable for people who don't have enough knowledge
of internal kernel. SystemTap has own scripting language and users can
gather kernel internal information suited to their needs by customizing
the script. Since it also has features, the log rotation and the
initscript, to keep collecting information continually, it is suitable
for system administrator and enterprise users.

I think we need to use those tracers as the situation demands, since
no tracer exists to meet anyone's needs and to fit any situation.
Then, we should consider the tracing mechanisms (kprobe, dynamic ftrace
and etc. kernel tracing features) and tracers (user interface)
separately, and all tracers should be able to use each tracing mechanisms.

The mechanism of dynamic ftrace is useful for all tracers. However
only ftrace can currently use it. I think it can be used for other
tracers via register_ and unregister_ftrace_function_probe
function. By using it, the overhead of instrumentation can be reduced
and gathering information, which cannot be traced because of a large
overhead, become available. Also it can enable the performance
counters to count events for all kernel functions.

First, I sent patches to integrate ftrace and SystemTap by just exporting
ftrace API. Also I fixed minor bugs for __unregister_ftrace_function_probe.

The patches doesn't contain the performance counters integration,
since it is still in development. I think following implementations are
needed:
- add new type to perf_id (like PERF_TYPE_FTRACE)
- add event ids to struct dyn_ftrace
- add interfaces to reference event ids by user (via debugfs?)
- add probe function to count ftrace events (call do_perf_swcounter_event)

Those patches are for -tip tree.

Thanks,
Atsushi

Signed-off-by: Atsushi Tsuji <a-tsuji@bk.jp.nec.com>
---
 kernel/trace/ftrace.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)







^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] tracing: Tracing integration - dynamic ftrace for SystemTap
  2009-09-15 10:06 [PATCH 0/2] tracing: Tracing integration - dynamic ftrace for SystemTap Atsushi Tsuji
@ 2009-09-15 10:15 ` Peter Zijlstra
  2009-09-15 10:19   ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2009-09-15 10:15 UTC (permalink / raw)
  To: Atsushi Tsuji
  Cc: linux-kernel, rostedt, Ingo Molnar, fweisbec, Frank Ch. Eigler,
	paulus, systemtap

On Tue, 2009-09-15 at 19:06 +0900, Atsushi Tsuji wrote:
> The patches doesn't contain the performance counters integration,
> since it is still in development. I think following implementations are
> needed:
> - add new type to perf_id (like PERF_TYPE_FTRACE)
> - add event ids to struct dyn_ftrace
> - add interfaces to reference event ids by user (via debugfs?)
> - add probe function to count ftrace events (call do_perf_swcounter_event)

That's long since been done,.. 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] tracing: Tracing integration - dynamic ftrace for SystemTap
  2009-09-15 10:15 ` Peter Zijlstra
@ 2009-09-15 10:19   ` Peter Zijlstra
  2009-09-15 13:28     ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2009-09-15 10:19 UTC (permalink / raw)
  To: Atsushi Tsuji
  Cc: linux-kernel, rostedt, Ingo Molnar, fweisbec, Frank Ch. Eigler,
	paulus, systemtap

On Tue, 2009-09-15 at 12:15 +0200, Peter Zijlstra wrote:
> On Tue, 2009-09-15 at 19:06 +0900, Atsushi Tsuji wrote:
> > The patches doesn't contain the performance counters integration,
> > since it is still in development. I think following implementations are
> > needed:
> > - add new type to perf_id (like PERF_TYPE_FTRACE)
> > - add event ids to struct dyn_ftrace
> > - add interfaces to reference event ids by user (via debugfs?)
> > - add probe function to count ftrace events (call do_perf_swcounter_event)
> 
> That's long since been done,.. 

Or are you talking about the mcount thing? Simply expose the mcount hook
as a regular tracepoint and perf can already use it.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] tracing: Tracing integration - dynamic ftrace for SystemTap
  2009-09-15 10:19   ` Peter Zijlstra
@ 2009-09-15 13:28     ` Steven Rostedt
  2009-09-15 13:36       ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2009-09-15 13:28 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Atsushi Tsuji, linux-kernel, Ingo Molnar, fweisbec,
	Frank Ch. Eigler, paulus, systemtap

On Tue, 2009-09-15 at 12:19 +0200, Peter Zijlstra wrote:
> On Tue, 2009-09-15 at 12:15 +0200, Peter Zijlstra wrote:
> > On Tue, 2009-09-15 at 19:06 +0900, Atsushi Tsuji wrote:
> > > The patches doesn't contain the performance counters integration,
> > > since it is still in development. I think following implementations are
> > > needed:
> > > - add new type to perf_id (like PERF_TYPE_FTRACE)
> > > - add event ids to struct dyn_ftrace
> > > - add interfaces to reference event ids by user (via debugfs?)
> > > - add probe function to count ftrace events (call do_perf_swcounter_event)
> > 
> > That's long since been done,.. 
> 
> Or are you talking about the mcount thing? Simply expose the mcount hook
> as a regular tracepoint and perf can already use it.
> 

Peter,

I'm not sure what you mean by exposing the mcount hook as a tracepoint.
Or you mean make it a special file in debug/tracing/events/ that lets
you enable it as a profile trace?


-- Steve


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] tracing: Tracing integration - dynamic ftrace for SystemTap
  2009-09-15 13:28     ` Steven Rostedt
@ 2009-09-15 13:36       ` Peter Zijlstra
  2009-09-16  8:08         ` Atsushi Tsuji
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2009-09-15 13:36 UTC (permalink / raw)
  To: rostedt
  Cc: Atsushi Tsuji, linux-kernel, Ingo Molnar, fweisbec,
	Frank Ch. Eigler, paulus, systemtap

On Tue, 2009-09-15 at 09:28 -0400, Steven Rostedt wrote:
> On Tue, 2009-09-15 at 12:19 +0200, Peter Zijlstra wrote:
> > On Tue, 2009-09-15 at 12:15 +0200, Peter Zijlstra wrote:
> > > On Tue, 2009-09-15 at 19:06 +0900, Atsushi Tsuji wrote:
> > > > The patches doesn't contain the performance counters integration,
> > > > since it is still in development. I think following implementations are
> > > > needed:
> > > > - add new type to perf_id (like PERF_TYPE_FTRACE)
> > > > - add event ids to struct dyn_ftrace
> > > > - add interfaces to reference event ids by user (via debugfs?)
> > > > - add probe function to count ftrace events (call do_perf_swcounter_event)
> > > 
> > > That's long since been done,.. 
> > 
> > Or are you talking about the mcount thing? Simply expose the mcount hook
> > as a regular tracepoint and perf can already use it.
> > 

> I'm not sure what you mean by exposing the mcount hook as a tracepoint.
> Or you mean make it a special file in debug/tracing/events/ that lets
> you enable it as a profile trace?

Either make it a single tracepoint on which you can apply filters or
make it generate a tracepoint per mcount site, I don't really mind ;-)

If kprobes can live in the same space, then surely the function tracer
can too ;-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] tracing: Tracing integration - dynamic ftrace for SystemTap
  2009-09-15 13:36       ` Peter Zijlstra
@ 2009-09-16  8:08         ` Atsushi Tsuji
  0 siblings, 0 replies; 6+ messages in thread
From: Atsushi Tsuji @ 2009-09-16  8:08 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: rostedt, linux-kernel, Ingo Molnar, fweisbec, Frank Ch. Eigler,
	paulus, systemtap

Peter Zijlstra wrote:
> On Tue, 2009-09-15 at 09:28 -0400, Steven Rostedt wrote:
>> On Tue, 2009-09-15 at 12:19 +0200, Peter Zijlstra wrote:
>>> On Tue, 2009-09-15 at 12:15 +0200, Peter Zijlstra wrote:
>>>> On Tue, 2009-09-15 at 19:06 +0900, Atsushi Tsuji wrote:
>>>>> The patches doesn't contain the performance counters integration,
>>>>> since it is still in development. I think following implementations are
>>>>> needed:
>>>>> - add new type to perf_id (like PERF_TYPE_FTRACE)
>>>>> - add event ids to struct dyn_ftrace
>>>>> - add interfaces to reference event ids by user (via debugfs?)
>>>>> - add probe function to count ftrace events (call do_perf_swcounter_event)
>>>> That's long since been done,.. 
>>> Or are you talking about the mcount thing? Simply expose the mcount hook
>>> as a regular tracepoint and perf can already use it.
>>>
> 
>> I'm not sure what you mean by exposing the mcount hook as a tracepoint.
>> Or you mean make it a special file in debug/tracing/events/ that lets
>> you enable it as a profile trace?
> 
> Either make it a single tracepoint on which you can apply filters or
> make it generate a tracepoint per mcount site, I don't really mind ;-)
> 
> If kprobes can live in the same space, then surely the function tracer
> can too ;-)

Thank you for your comments.

I understood that I need to make the mechanism to dynamically add tracepoints using
a mcount hook. I'll try to make it.

Thanks,
Atsushi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-16  8:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-15 10:06 [PATCH 0/2] tracing: Tracing integration - dynamic ftrace for SystemTap Atsushi Tsuji
2009-09-15 10:15 ` Peter Zijlstra
2009-09-15 10:19   ` Peter Zijlstra
2009-09-15 13:28     ` Steven Rostedt
2009-09-15 13:36       ` Peter Zijlstra
2009-09-16  8:08         ` Atsushi Tsuji

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.