Re: [PATCH v2 bpf-next] selftests/bpf: Add an option for a debug shell in vmtest.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 29, 2021 at 6:46 AM KP Singh <kpsingh@xxxxxxxxxx> wrote:
>
> On Fri, Mar 26, 2021 at 5:48 AM Andrii Nakryiko
> <andrii.nakryiko@xxxxxxxxx> wrote:
> >
> > On Mon, Mar 22, 2021 at 6:47 PM KP Singh <kpsingh@xxxxxxxxxx> wrote:
> > >
> > > The newly introduced -s command line option starts an interactive shell.
> > > If a command is specified, the shell is started after the command
> > > finishes executing. It's useful to have a shell especially when
> > > debugging failing tests or developing new tests.
> > >
> > > Since the user may terminate the VM forcefully, an extra "sync" is added
> > > after the execution of the command to persist any logs from the command
> > > into the log file.
> > >
> > > Signed-off-by: KP Singh <kpsingh@xxxxxxxxxx>
> > > ---
> >
> > I run:
> >
> > ./vmtest.sh -s
> >
> > And I get test_progs executed, not bash. What do I do wrong?...
>
> It does not seem to happen for me [classic, works on my machine :P]
>
> tools/testing/selftests/bpf$ ./vmtest.sh -s
> [...]
> + /etc/rcS.d/S50-startup
> bash: cannot set terminal process group (84): Inappropriate ioctl for device
> bash: no job control in this shell
> [root@(none) /]#
>
> To help debug this:
>
> Can you check the contents of /etc/rcS.d/S50-startup on the image,
> here's what mine looks like:
>
> [root@(none) /]# cat /etc/rcS.d/S50-startup
> #!/bin/bash
> bash

Couldn't do it, because it would only run test_progs, no matter which
command I specified (that didn't happen before, strange). E.g.,
running `./vmtest.sh -- cat /etc/rcS.d/S50-startup` gives this:

starting pid 83, tty '': '/etc/init.d/rcS'
[    1.070838] random: fast init done
+ for path in /etc/rcS.d/S*
+ '[' -x /etc/rcS.d/S10-mount ']'
+ /etc/rcS.d/S10-mount
+ /bin/mount proc /proc -t proc
+ /bin/mount devtmpfs /dev -t devtmpfs
mount: mounting devtmpfs on /dev failed: Resource busy
+ true
+ /bin/mount sysfs /sys -t sysfs
+ /bin/mount bpffs /sys/fs/bpf -t bpf
+ /bin/mount debugfs /sys/kernel/debug -t debugfs
+ echo 'Listing currently mounted file systems'
Listing currently mounted file systems
+ /bin/mount
/dev/root on / type ext4 (rw,relatime)
devtmpfs on /dev type devtmpfs
(rw,relatime,size=1004288k,nr_inodes=251072,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /sys/fs/bpf type bpf (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
+ for path in /etc/rcS.d/S*
+ '[' -x /etc/rcS.d/S40-network ']'
+ /etc/rcS.d/S40-network
+ ip link set lo up
+ for path in /etc/rcS.d/S*
+ '[' -x /etc/rcS.d/S50-startup ']'
+ /etc/rcS.d/S50-startup
./test_progs

And there was a bunch of messages like this before kernel started:

error: Macro %global is a built-in (%define)
error: Macro %global is a built-in (%define)
warning: file /etc/rpm/macros.perl: 2 invalid macro definitions

Don't know if related.

>
> 2. Also, can you delete the cache in the home directory
> (~/.bpf_selftests by default) and try again?
>

But this solved the issue. So must be something in cached data.

> >
> > >  tools/testing/selftests/bpf/vmtest.sh | 39 +++++++++++++++++++--------
> > >  1 file changed, 28 insertions(+), 11 deletions(-)
> > >
> >
> > [...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux