public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: Wade Farnsworth <wade_farnsworth@mentor.com>
Cc: systemtap@sourceware.org
Subject: Re: Test suite results for ARM with uprobes
Date: Fri, 16 Dec 2011 19:18:00 -0000	[thread overview]
Message-ID: <20111216182057.GA2526@toonder.wildebeest.org> (raw)
In-Reply-To: <1323876723.3567.33.camel@springer.wildebeest.org>

[-- Attachment #1: Type: text/plain, Size: 1834 bytes --]

On Wed, Dec 14, 2011 at 04:32:03PM +0100, Mark Wielaard wrote:
> On Thu, 2011-12-08 at 08:20 -0700, Wade Farnsworth wrote:
> > >> FAIL: semok/config_number.stp [semantic error: probe point mismatch
> > at
> > >> position 0]
> > >
> > > This one PASSes for me.
> > > What is CONFIG_NR_CPU set to for your kernel?
> > > It is set to 2 for me.
> > >
> > 
> > CONFIG_SMP is not set, so CONFIG_NR_CPU doesn't exist in my config
> > file. 
> >   Maybe stap treats that as being equal to zero?
> 
> Yep it does. Although I am not sure it is meant to. It uses strtoll to
> convert the empty string "", which returns zero, then it checks if errno
> is set and it isn't, even though the man page says "The  implementation
> may also set errno to EINVAL in case no conversion was performed (no
> digits seen, and 0 returned)."
> 
> I don't know what is preferred. I could change the code to barf on an
> empty string in a CONFIG_ numerical comparison, then we would need to
> change the testcase to pick some other CONFIG_ option which is always
> set. I think this is the most sane, but it is a slight change in how
> things worked before (I think by accident).
> 
> Or we could accept that numerical comparisons of CONFIG_ options which
> aren't set compare to zero and then we change the testcase to also
> accept that CONFIG_NR_CPU == 0.
> 
> Opinions?

Even though nobody gave their opinion, I did change mine.
I have added an explicit test for the current behaviour.
Non set CONFIG_options should compare equal to the empty string
and/or zero. That also should make the test work on your setup.

Even though I still think that is kind of ugly, it seems better
to keep current behaviour that people/scripts might already depend
on. And now if we do change it, we at least have a test that points
out the change in behaviour.

Cheers,

Mark

[-- Attachment #2: config_nr_test.patch --]
[-- Type: text/plain, Size: 887 bytes --]

commit 0a51c2a2dea8a2cafa0e642087547f48bfe0fa08
Author: Mark Wielaard <mjw@redhat.com>
Date:   Fri Dec 16 19:14:40 2011 +0100

    Check that unset CONFIG options compare equal the empty string and/or zero.

diff --git a/testsuite/semok/config_number.stp b/testsuite/semok/config_number.stp
index b384c3e..ba3bde7 100755
--- a/testsuite/semok/config_number.stp
+++ b/testsuite/semok/config_number.stp
@@ -1,14 +1,15 @@
 #! stap -p2
 
 # check that number comparisons work in CONFIG checks
+# Note that unset CONFIG options compare equal the empty string and/or zero
 probe
   %( CONFIG_NR_CPUS == 13 %?
     noprobe
   %:
-    %( CONFIG_NR_CPUS < 1 %?
+    %( CONFIG_NR_CPUS != "" && CONFIG_NR_CPUS < 1 %?
       nonoprobe
     %:
-      %( CONFIG_NR_CPUS >= 0 %?
+      %( CONFIG_NR_CPUS >= 0 && CONFIG_NO_SUCH_FOOBAR_CONFIG_OPTION == 0 %?
         begin
       %:
         nononoprobe

      reply	other threads:[~2011-12-16 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06 21:37 Wade Farnsworth
2011-12-07 13:39 ` Mark Wielaard
2011-12-08 19:24   ` Wade Farnsworth
2011-12-14 15:54     ` Mark Wielaard
2011-12-16 19:18       ` Mark Wielaard [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=20111216182057.GA2526@toonder.wildebeest.org \
    --to=mjw@redhat.com \
    --cc=systemtap@sourceware.org \
    --cc=wade_farnsworth@mentor.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).