Live Patching
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Filipe Xavier <felipeaggger@gmail.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	Jiri Kosina <jikos@kernel.org>,  Petr Mladek <pmladek@suse.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	 Shuah Khan <shuah@kernel.org>,
	Marcos Paulo de Souza <mpdesouza@suse.com>,
	 live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org,
	 linux-kernel@vger.kernel.org, felipe_life@live.com
Subject: Re: [PATCH PATCH 2/2] selftests: livepatch: test if ftrace can trace a livepatched function
Date: Mon, 17 Mar 2025 10:07:58 +0100 (CET)	[thread overview]
Message-ID: <alpine.LSU.2.21.2503171006260.4236@pobox.suse.cz> (raw)
In-Reply-To: <6d9b9394-690b-49a3-b8df-7ef510c96c00@gmail.com>

On Fri, 14 Mar 2025, Filipe Xavier wrote:

> On 3/14/25 10:14 AM, Miroslav Benes wrote:
> 
> > Hi,
> >
> >> +start_test "trace livepatched function and check that the live patch
> >> remains in effect"
> >> +
> >> +FUNCTION_NAME="livepatch_cmdline_proc_show"
> >> +
> >> +load_lp $MOD_LIVEPATCH
> >> +trace_function "$FUNCTION_NAME"
> > trace_funtion() calls cleanup_ftrace() to prepare the test. Ok.
> >
> >> +if [[ "$(cat /proc/cmdline)" == "$MOD_LIVEPATCH: this has been live
> >> patched" ]] ; then
> >> +	log "livepatch: ok"
> >> +fi
> >> +
> >> +check_traced_function "$FUNCTION_NAME"
> >> +
> >> +cleanup_tracing
> > Here, I suppose, cleanup_tracing() is called to clean up after the check
> > above so that nothing stays and more tests can be added later. Right?
> > Would it make sense then to call cleanup_tracing() in
> > check_traced_function()? I think it would less error prone.
> > If needed, check_traced_function() can always be upgraded so that it
> > checks for more traced functions.
> 
> In cases where we need to check two or more functions with
> check_traced_function,
> 
> if there is cleanup_tracing, it will not be possible, make sense?
> 
> e.g: function1 call -> function2 call -> function3.

I meant... check_traced_function() (or check_traced_functions() in this 
case) can have multiple arguments. You would loop over them inside and 
then clean up. Or did I misunderstood?

Miroslav

  reply	other threads:[~2025-03-17  9:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 21:51 [PATCH 0/2] selftests: livepatch: test if ftrace can trace a livepatched function Filipe Xavier
2025-03-06 21:51 ` [PATCH PATCH 1/2] selftests: livepatch: add new ftrace helpers functions Filipe Xavier
2025-03-06 21:51 ` [PATCH PATCH 2/2] selftests: livepatch: test if ftrace can trace a livepatched function Filipe Xavier
2025-03-14 13:14   ` Miroslav Benes
2025-03-14 19:00     ` Filipe Xavier
2025-03-17  9:07       ` Miroslav Benes [this message]
2025-03-18 12:31         ` Filipe Xavier
2025-03-12  1:53 ` [PATCH 0/2] " Marcos Paulo de Souza

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=alpine.LSU.2.21.2503171006260.4236@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --cc=felipe_life@live.com \
    --cc=felipeaggger@gmail.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mpdesouza@suse.com \
    --cc=pmladek@suse.com \
    --cc=shuah@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox