All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Eugene Loh <eugene.loh@oracle.com>
Cc: Kris Van Hees <kris.van.hees@oracle.com>,
	Nick Alcock <nick.alcock@oracle.com>,
	dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH] tests: add test for buggy deduplicator
Date: Tue, 18 Mar 2025 15:01:39 -0400	[thread overview]
Message-ID: <Z9nDEyCTQxsTf3iq@oracle.com> (raw)
In-Reply-To: <38e69a45-1a32-50c1-0eef-bcdf8cf10348@oracle.com>

On Tue, Mar 18, 2025 at 02:59:45PM -0400, Eugene Loh wrote:
> But if it is a dependency, it would be nice to know there is a problem.

I believe we would already know there is a problem because of other tests
failing.

> On 3/18/25 14:17, Kris Van Hees wrote:
> > This seems like a test that would belong in the kernel tree rather than in
> > DTrace?  It seems like a weird tst to have included in DTrace because if it
> > fails, we cannot do anything about it in DTrace anyway.
> > 
> > I'd rather leave out tests that exercise things that are not DTrace itself.
> > 
> > On Thu, Jan 09, 2025 at 04:47:10PM +0000, Nick Alcock wrote:
> > > Some early prototype deduplicators dedupped types in one dict (more or less)
> > > rather than putting conflicting types and module types into
> > > sub-dictionaries.  Fail if the running kernel is such a kernel.
> > > 
> > > Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
> > > ---
> > >   dtrace.spec                  |  2 +-
> > >   test/smoke/tst.ctf-intact.sh | 58 ++++++++++++++++++++++++++++++++++++
> > >   2 files changed, 59 insertions(+), 1 deletion(-)
> > >   create mode 100755 test/smoke/tst.ctf-intact.sh
> > > 
> > > diff --git a/dtrace.spec b/dtrace.spec
> > > index 902ad7d8bb980..cf960f14b55c7 100644
> > > --- a/dtrace.spec
> > > +++ b/dtrace.spec
> > > @@ -151,7 +151,7 @@ Requires:     %{name}-devel = %{version}-%{release} perl gcc java
> > >   Requires:     java-1.8.0-openjdk-devel perl-IO-Socket-IP xfsprogs
> > >   Requires:     exportfs vim-minimal %{name}%{?_isa} = %{version}-%{release}
> > >   Requires:     coreutils wireshark %{glibc32}
> > > -Requires:     perf time bc nfs-utils
> > > +Requires:     perf time bc nfs-utils binutils
> > >   Autoreq:      0
> > >   Group:	      Development/System
> > > diff --git a/test/smoke/tst.ctf-intact.sh b/test/smoke/tst.ctf-intact.sh
> > > new file mode 100755
> > > index 0000000000000..d737a2b162fcb
> > > --- /dev/null
> > > +++ b/test/smoke/tst.ctf-intact.sh
> > > @@ -0,0 +1,58 @@
> > > +#!/bin/bash
> > > +#
> > > +# Oracle Linux DTrace.
> > > +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
> > 2024 -> 2025
> > 
> > > +# Licensed under the Universal Permissive License v 1.0 as shown at
> > > +# http://oss.oracle.com/licenses/upl.
> > > +#
> > > +
> > > +#
> > > +# This script verifies that the CTF, if present, is non-corrupt: in
> > > +# particular, that it has at least one child with
> > The rest of the comment is missing?
> > 
> > > +#
> > > +
> > > +ctf="/lib/modules/$(uname -r)/kernel/vmlinux.ctfa"
> > > +
> > > +if [[ ! -f "$ctf" ]]; then
> > > +    echo "CTF not found in expected location of $ctf" >&2
> > > +    exit 67
> > > +fi
> > > +
> > > +# If this is not an ELF file, turn it into one so objdump works.
> > > +if ! [[ "$(file "$ctf")" =~ ELF ]]; then
> > > +    objcopy --add-section=.ctf="$ctf" /bin/true $tmpdir/ctf
> > > +    ctf=$tmpdir/ctf
> > > +fi
> > > +
> > > +# Dump the CTF
> > > +objdump --ctf --ctf-parent=shared_ctf "$ctf" 2>/dev/null | \
> > > +    awk '
> > > +BEGIN {
> > > +    intypes=0;
> > > +}
> > > +
> > > +/^  Strings:|^CTF archive member:/ {
> > > +    intypes = 0;
> > > +}
> > > +# Scan for each member, capture its name.
> > > +/^CTF archive member: / {
> > > +    member=gensub (/CTF archive member: (.*):/,"\\1", "g");
> > > +    next;
> > > +}
> > > +# See if any non-shared dicts have any types in.
> > > +/^  Types:/ {
> > > +    if (member != "shared_ctf") {
> > > +        intypes=1;
> > > +    }
> > > +}
> > > +/^    0x/ {
> > > +    if (intypes) {
> > > +        exit (0);
> > > +    }
> > > +}
> > > +END {
> > > +    if (!intypes) {
> > > +        printf ("No non-shared-dict types found: probably buggy deduplicator.\n");
> > > +        exit (1);
> > > +    }
> > > +}'
> > > -- 
> > > 2.47.1.279.g84c5f4e78e
> > > 

      reply	other threads:[~2025-03-18 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 16:47 [PATCH] tests: add test for buggy deduplicator Nick Alcock
2025-01-09 17:09 ` [DTrace-devel] " Kris Van Hees
2025-03-18 18:17 ` Kris Van Hees
2025-03-18 18:59   ` Eugene Loh
2025-03-18 19:01     ` Kris Van Hees [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=Z9nDEyCTQxsTf3iq@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=eugene.loh@oracle.com \
    --cc=nick.alcock@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.