All of lore.kernel.org
 help / color / mirror / Atom feed
* Record until a function call
@ 2021-05-05  7:28 Nicolas Sterchele
  2021-05-05 13:04 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Sterchele @ 2021-05-05  7:28 UTC (permalink / raw)
  To: linux-trace-devel

Hi there,

I did not find any options permitting to record a trace until a function has been called.

For instance, you want to record every function calls of a specific
process until a specific function has been called.
Before doing this development, I would like to have your thoughts on
this use case? Or if it is already possible?

thx.

-- 
Nicolas Sterchele
/ni.kɔ.lɑ/ /stɛrʃɛl/
@sterchelen

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

* Re: Record until a function call
  2021-05-05  7:28 Record until a function call Nicolas Sterchele
@ 2021-05-05 13:04 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2021-05-05 13:04 UTC (permalink / raw)
  To: Nicolas Sterchele; +Cc: linux-trace-devel

On Wed, 5 May 2021 09:28:23 +0200
Nicolas Sterchele <nicolas@sterchelen.net> wrote:

> Hi there,
> 
> I did not find any options permitting to record a trace until a function has been called.
> 
> For instance, you want to record every function calls of a specific
> process until a specific function has been called.
> Before doing this development, I would like to have your thoughts on
> this use case? Or if it is already possible?
> 
> thx.
> 

# trace-cmd start -p function -l '<stop-func>:traceoff '

Where "<stop-func>" is the function you want to stop at.

Note, when trying this out, I realized that there's a bug in the kernel
that it will ignore the "<stop-func>:traceoff" command if it doesn't have a
white space at the end. That's because its been tested with:

 # echo "<stop-func>:traceoff" > /sys/kernel/tracing/set_ftrace_filter

and the above command will write just the string, which the kernel will
think there's more to come, but not finish it if the file is closed. That
is:

 # echo -n "<stop-func>:traceoff" > /sys/kernel/tracing/set_ftrace_filter

will not work (the -n tells echo to not add a new line).

I'll have to fix that.

To clear it:

  # trace-cmd reset


-- Steve


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

end of thread, other threads:[~2021-05-05 13:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05  7:28 Record until a function call Nicolas Sterchele
2021-05-05 13:04 ` Steven Rostedt

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.