linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Nicolas Sterchele <nicolas@sterchelen.net>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: Record until a function call
Date: Wed, 5 May 2021 09:04:12 -0400	[thread overview]
Message-ID: <20210505090412.6618623e@gandalf.local.home> (raw)
In-Reply-To: <YJJJF6bu84uZ/B39@groot>

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


      reply	other threads:[~2021-05-05 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  7:28 Record until a function call Nicolas Sterchele
2021-05-05 13:04 ` Steven Rostedt [this message]

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=20210505090412.6618623e@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=nicolas@sterchelen.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).