public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib: Move setup_ipc() to the beginning of do_setup()
@ 2022-10-10  8:16 Zhao Gongyi via ltp
  2022-10-20  8:58 ` Richard Palethorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Zhao Gongyi via ltp @ 2022-10-10  8:16 UTC (permalink / raw)
  To: ltp

Move setup_ipc() to the beginning of do_setup() since we
would use the 'results' immediately in do_setup(), otherwise,there
is no Results statistics when calling the tst_brk in do_setup().

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
 lib/tst_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 8ccde1629..02fc6a06e 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1096,6 +1096,8 @@ static void do_cgroup_requires(void)

 static void do_setup(int argc, char *argv[])
 {
+	setup_ipc();
+
 	if (!tst_test)
 		tst_brk(TBROK, "No tests to run");

@@ -1169,8 +1171,6 @@ static void do_setup(int argc, char *argv[])
 	if (tst_test->hugepages.number)
 		tst_reserve_hugepages(&tst_test->hugepages);

-	setup_ipc();
-
 	if (tst_test->bufs)
 		tst_buffers_alloc(tst_test->bufs);

--
2.17.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] lib: Move setup_ipc() to the beginning of do_setup()
@ 2022-10-20 11:58 zhaogongyi via ltp
  0 siblings, 0 replies; 3+ messages in thread
From: zhaogongyi via ltp @ 2022-10-20 11:58 UTC (permalink / raw)
  To: rpalethorpe@suse.de; +Cc: ltp@lists.linux.it

Hi,

> 
> Hello,
> 
> Zhao Gongyi via ltp <ltp@lists.linux.it> writes:
> 
> > Move setup_ipc() to the beginning of do_setup() since we would use the
> > 'results' immediately in do_setup(), otherwise,there is no Results
> > statistics when calling the tst_brk in do_setup().
> >
> > Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
> > ---
> >  lib/tst_test.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/tst_test.c b/lib/tst_test.c index
> > 8ccde1629..02fc6a06e 100644
> > --- a/lib/tst_test.c
> > +++ b/lib/tst_test.c
> > @@ -1096,6 +1096,8 @@ static void do_cgroup_requires(void)
> >
> >  static void do_setup(int argc, char *argv[])  {
> > +	setup_ipc();
> > +
> 
> We can't move it to before checking if tst_test is null.

Actrually, tst_test is not null for ever since we have a definition at lint 375 in tst_test.h:

  static struct tst_test test;

So, is there any problem exist that I did not see?


Regards,
Gongyi


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-20 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10  8:16 [LTP] [PATCH] lib: Move setup_ipc() to the beginning of do_setup() Zhao Gongyi via ltp
2022-10-20  8:58 ` Richard Palethorpe
  -- strict thread matches above, loose matches on Subject: below --
2022-10-20 11:58 zhaogongyi via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox