From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: John Stultz <jstultz@google.com>, ltp@lists.linux.it
Subject: Re: [LTP] [RFC PATCH 2/2] sched_football: Rewrite into new API
Date: Fri, 12 Jul 2024 15:22:05 +0200 [thread overview]
Message-ID: <20240712132205.GA145191@pevik> (raw)
In-Reply-To: <ZpERtIxWiodTJiYS@rei>
Hi Cyril,
First, thanks for having a look.
> Hi!
> > Combining LTP librealtime (librttest.c) and LTP library is somehow
> > experimental. -lltp was needed to be added to CFLAGS but yet on musl
> > it fails to find the function on runtime:
> > tst_test.c:985: TBROK: No test function specified
> That should not happen, you get this message something went horribly
> wrong and the test_all function pointer ended up NULL in the test
> library. Which gcc version was it, I would expect that this would be
> more compiler specific than libc specific.
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/13.2.1/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-13-20231014/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --enable-checking=release --disable-cet --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-default-ssp --enable-languages=c,c++,d,objc,go,fortran,ada --enable-link-serialization=2 --enable-linker-build-id --disable-libssp --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues --with-system-zlib --with-linker-hash-style=gnu --with-pkgversion='Alpine 13.2.1_git20231014'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.1 20231014 (Alpine 13.2.1_git20231014)
Hm, after doing make clean of the library everything magically worked. I'm sorry
for the noise.
$ make V=1
gcc -I/home/foo/ltp/testcases/realtime/include -I/home/foo/ltp/testcases/realtime/include -I../../../../include -I../../../../include -I../../../../include/old/ -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -std=gnu99 -D_GNU_SOURCE -L/home/foo/ltp/testcases/realtime/lib -L../../../../lib sched_football.c -lrealtime -lpthread -lrt -lm -lltp -o sched_football
# ./sched_football
tst_test.c:1806: TINFO: LTP version: 20240524-81-g562d1b39b
tst_test.c:1650: TINFO: Timeout per run is 0h 00m 30s
sched_football.c:159: TINFO: players_per_team: 2 game_length: 5
sched_football.c:171: TINFO: Starting 2 offense threads at priority 15
sched_football.c:182: TINFO: Starting 2 defense threads at priority 30
sched_football.c:193: TINFO: Starting 2 fan threads at priority 50
sched_football.c:120: TINFO: Starting referee thread
sched_football.c:123: TINFO: Starting the game (5 sec)
sched_football.c:143: TINFO: Final ball position: 0
sched_football.c:145: TPASS: Expect: final_ball == 0
=> main problem solved, but there are 2 others.
1) realtime suite does not trigger libltp dependency (build system fix required):
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lltp: No such file or directory
I wonder if we should get rid of LTP realtime library for this file. Fixing it
would be obviously better.
2) Running with -i is broken (everywhere, also on glibc)
./sched_football -i2
tst_test.c:1806: TINFO: LTP version: 20240524-93-g17c91c528
tst_test.c:1650: TINFO: Timeout per run is 0h 00m 30s
sched_football.c:159: TINFO: players_per_team: 2 game_length: 5
sched_football.c:171: TINFO: Starting 2 offense threads at priority 15
sched_football.c:182: TINFO: Starting 2 defense threads at priority 30
sched_football.c:193: TINFO: Starting 2 fan threads at priority 50
sched_football.c:120: TINFO: Starting referee thread
sched_football.c:123: TINFO: Starting the game (5 sec)
sched_football.c:143: TINFO: Final ball position: 0
sched_football.c:145: TPASS: Expect: final_ball == 0
sched_football.c:159: TINFO: players_per_team: 2 game_length: 5
sched_football.c:171: TINFO: Starting 2 offense threads at priority 15
Test timeouted, sending SIGKILL!
Something needs to be reset for each run and it's not?
ball is reset: tst_atomic_store(0, &ball);
Kind regards,
Petr
> Otherwise the conversion looks pretty straightforward, mostly about
> option parsing and printf vs tst_res().
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-07-12 13:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 10:43 [LTP] [RFC PATCH 1/2] realtime: Use offsetof() macro from <stddef.h> Petr Vorel
2024-07-11 10:43 ` [LTP] [RFC PATCH 2/2] sched_football: Rewrite into new API Petr Vorel
2024-07-12 11:21 ` Cyril Hrubis
2024-07-12 13:22 ` Petr Vorel [this message]
2024-07-12 14:11 ` Cyril Hrubis
2024-07-12 19:09 ` Petr Vorel
2024-07-15 9:07 ` Cyril Hrubis
2024-07-15 9:52 ` Petr Vorel
2024-07-15 10:38 ` Cyril Hrubis
2024-07-15 12:44 ` Petr Vorel
2024-07-17 14:52 ` Cyril Hrubis
2024-07-17 16:03 ` Petr Vorel
2024-07-12 9:57 ` [LTP] [RFC PATCH 1/2] realtime: Use offsetof() macro from <stddef.h> Cyril Hrubis
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=20240712132205.GA145191@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=jstultz@google.com \
--cc=ltp@lists.linux.it \
/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