linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: open list <linux-kernel@vger.kernel.org>,
	linux-trace-kernel@vger.kernel.org,
	Linux-Next Mailing List <linux-next@vger.kernel.org>,
	lkft-triage@lists.linaro.org,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Arnd Bergmann <arnd@arndb.de>,
	Anders Roxell <anders.roxell@linaro.org>
Subject: Re: selftests: ftrace: event filter function - test event filtering on functions [FAIL]
Date: Sun, 19 Mar 2023 00:27:58 +0900	[thread overview]
Message-ID: <20230319002758.84a3893c88f6bfbf7ff9ad85@kernel.org> (raw)
In-Reply-To: <CA+G9fYv5G5Hows6Ex=1NMgSW3wtieKNNsFPBTpaLcF-bzaUtrw@mail.gmail.com>

Hi Naresh,

On Wed, 15 Mar 2023 14:41:51 +0530
Naresh Kamboju <naresh.kamboju@linaro.org> wrote:

> Hi Masami San,
> 
> 
> On Wed, 15 Mar 2023 at 14:03, Masami Hiramatsu <mhiramat@kernel.org> wrote:
> >
> > Hi Naresh,
> >
> > On Tue, 14 Mar 2023 15:52:44 +0530
> > Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
> >
> > > Results from Linaro’s test farm.
> > >
> > > selftests ftrace failed on qemu-x86_64 and qemu-arm64.
> > > Please find the test log below.
> >
> > Thanks for reporting!
> > Can you share the kernel config which you used for this build?
> > And the kernel is "next-20230314", is that correct?
> 
> I have attached a test log file and Kconfig file.

Thanks! I could reproduced.

The error log is here.
----
+ . /mnt/ftrace/test.d/filter/event-filter-function.tc
+ echo 'Test event filter function name'
Test event filter function name
+ echo 0
+ echo 0
+ echo
+ echo 'call_site.function == exit_mmap'
+ echo 1
+ echo 1
+ ls
+ echo 0
+ + wcgrep -l
 exit_mmap
+ grep kmem_cache_free trace
+ hitcnt=0
+ + wcgrep -l
 -v+  exit_mmap
grep kmem_cache_free trace
+ misscnt=0
+ '[' 0 -eq 0 ]
+ exit_fail
+ exit 1

And the test case is here.
-----
echo 'call_site.function == exit_mmap' > events/kmem/kmem_cache_free/filter
echo 1 > events/kmem/kmem_cache_free/enable
echo 1 > tracing_on
ls > /dev/null
echo 0 > events/kmem/kmem_cache_free/enable

hitcnt=`grep kmem_cache_free trace| grep exit_mmap | wc -l`
misscnt=`grep kmem_cache_free trace| grep -v exit_mmap | wc -l`

if [ $hitcnt -eq 0 ]; then
        exit_fail
fi
-----

The test case expects the `ls > /dev/null` involves 'kmem_cache_free' trace
event, but it doesn't.

BTW, this code is a bit fragile because the function caller can be changed
frequently. I think it should sample the events and use one of them.
Let me fix that.

Thank you,


> 
> >
> > >
> > > Is this expected to fail ? Am I missing anything ?
> >
> > No, it should be a bug. I would like to reproduce it.
> 
> - Naresh


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      reply	other threads:[~2023-03-18 15:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 10:22 selftests: ftrace: event filter function - test event filtering on functions [FAIL] Naresh Kamboju
2023-03-14 13:50 ` Steven Rostedt
2023-03-15  8:32 ` Masami Hiramatsu
2023-03-15  9:11   ` Naresh Kamboju
2023-03-18 15:27     ` Masami Hiramatsu [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=20230319002758.84a3893c88f6bfbf7ff9ad85@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=anders.roxell@linaro.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=sfr@canb.auug.org.au \
    /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).