public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 1/2] tst_memutils.c: Add tst_print_meminfo function
Date: Mon, 18 Dec 2023 05:39:59 +0100	[thread overview]
Message-ID: <20231218043959.GB160518@pevik> (raw)
In-Reply-To: <CAEemH2ehQ6CPakouwECeWQGSvSOe1rhA=HKnk1Uig81Cj7tzTg@mail.gmail.com>

> Li Wang <liwang@redhat.com> wrote:

> >> > +++ b/lib/safe_macros.c

> >> We don't want to add anything to the legacy API (otherwise it would go to
> >> lib/safe_file_ops.c), please add this to lib/tst_safe_macros.c.

> >> BTW I'm slightly confused, what would be the best place for this,
> >> lib/tst_safe_macros.c is being used nowadays for everything. But there is
> >> also



> >> include/tst_safe_file_ops.h, which does not have C file
> >> (lib/tst_safe_file_ops.c) because it internally use lib/tst_safe_macros.c.


> > No, basically it does not use the lib/tst_safe_macros.c.

> > From what I understand, 'tst_safe_file_ops.h' is just a header for
> > collecting
> > all the file operations for Linux, it doesn't touch other subcomponent ops.

> > 'tst_safe_file_ops.h' defines macros for all functions in
> > 'safe_file_ops_fn.h'
> > and archived them in 'safe_file_ops.c' lib.

> > Something like this combination:

> > tst_safe_file_ops.h:
> >     safe_file_ops_fn.h
> >     safe_file_ops.c


> The reason to split them into two headers is for backward compatibility.

> Technically we should declare 'safe_file_ops_fn.h' functions in one header
> 'tst_safe_file_ops.h' but you know we have 'old_safe_file_ops.h'.

> tst_safe_file_ops.h:
>     safe_file_ops_fn.h
>     safe_file_ops.c

> old_safe_file_ops.h:
>     safe_file_ops_fn.h
>     safe_file_ops.c

> In the future, the ideal cleanup direction is just to have:

> tst_safe_file_ops.h
> tst_safe_file_ops.c

Yep, the problem that Cyril originally implemented new API via legacy to
support both APIs (good and needed solution) and now we add only into new API
(also good solution) + that approach specific (and thus small) C sources
initially and later more generic (and longer) makes library a bit inconsistent.
I know, it will be solved once we get rid of the legacy API, but that will take
time.

Kind regards,
Petr

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

  reply	other threads:[~2023-12-18  4:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-10  9:43 [LTP] [PATCH v1] swapping01.c: Reporting /proc/meminfo before test and at the moment of the failure Wei Gao via ltp
2023-12-12 17:29 ` Petr Vorel
2023-12-14  6:33 ` [LTP] [PATCH v2 0/2] Add tst_print_meminfo function in swapping01 Wei Gao via ltp
2023-12-14  6:33   ` [LTP] [PATCH v2 1/2] tst_memutils.c: Add tst_print_meminfo function Wei Gao via ltp
2023-12-14  6:33   ` [LTP] [PATCH v2 2/2] swapping01.c: Reporting /proc/meminfo during test Wei Gao via ltp
2023-12-14  7:13   ` [LTP] [PATCH v3 0/2] Add tst_print_meminfo function into swapping01 Wei Gao via ltp
2023-12-14  7:13     ` [LTP] [PATCH v3 1/2] tst_memutils.c: Add tst_print_meminfo function Wei Gao via ltp
2023-12-15 18:57       ` Petr Vorel
2023-12-18  3:41         ` Li Wang
2023-12-18  3:51           ` Li Wang
2023-12-18  4:39             ` Petr Vorel [this message]
2023-12-18  4:30           ` Petr Vorel
2023-12-18  7:20             ` Li Wang
2023-12-14  7:13     ` [LTP] [PATCH v3 2/2] swapping01.c: Reporting /proc/meminfo during test Wei Gao via ltp
2023-12-18  7:37       ` Li Wang
2023-12-18 12:22     ` [LTP] [PATCH v4 0/2] Add tst_print_meminfo function into swapping01 Wei Gao via ltp
2023-12-18 12:22       ` [LTP] [PATCH v4 1/2] tst_memutils.c: Add tst_print_meminfo function Wei Gao via ltp
2023-12-18 13:24         ` Petr Vorel
2023-12-18 12:22       ` [LTP] [PATCH v4 2/2] swapping01.c: Reporting /proc/meminfo during test Wei Gao via ltp
2023-12-18 13:34         ` Petr Vorel
2023-12-18 13:47           ` Petr Vorel

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=20231218043959.GB160518@pevik \
    --to=pvorel@suse.cz \
    --cc=liwang@redhat.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