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: Fri, 14 Mar 2025 14:14:47 +0100 (CET)	[thread overview]
Message-ID: <alpine.LSU.2.21.2503141411010.4442@pobox.suse.cz> (raw)
In-Reply-To: <20250306-ftrace-sftest-livepatch-v1-2-a6f1dfc30e17@gmail.com>

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.

Miroslav

  reply	other threads:[~2025-03-14 13:14 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 [this message]
2025-03-14 19:00     ` Filipe Xavier
2025-03-17  9:07       ` Miroslav Benes
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.2503141411010.4442@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