Linux Test Project
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] SAFE_MACROS: Redirect to tst_brk_() early
Date: Fri, 10 Feb 2017 03:27:07 -0500 (EST)	[thread overview]
Message-ID: <1865245988.2484651.1486715227566.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20170209161120.GA23109@rei>



----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Thursday, 9 February, 2017 5:11:20 PM
> Subject: Re: [LTP] [PATCH 1/2] SAFE_MACROS: Redirect to tst_brk_() early
> 
> Hi!
> > > +#ifndef BRKM_REDIRECT_H__
> > > +#define BRKM_REDIRECT_H__
> > > +
> > > +#include "ltp_priv.h"
> > > +
> > > +#ifdef tst_brkm
> > > +# undef tst_brkm
> > > +#endif
> > > +
> > > +#define tst_brkm(flags, cleanup, fmt, ...) do { \
> > > +	if (tst_test) \
> > > +		tst_brk_(__FILE__, __LINE__, flags, fmt, ##__VA_ARGS__); \
> > > +	else \
> > > +                tst_brkm_(__FILE__, __LINE__, flags, cleanup, fmt,
> > > ##__VA_ARGS__); \
> > > +	} while (0)
> > 
> > Stil trying to wrap my head around all this, but after first look,..
> > How does this related to "tst_brkm_" from lib/tst_res.c?
> > Can it be simplified? It doesn't look like we can reach newlib branch
> > now, because tst_test condition is now in tst_brkm macro.
> 
> Well there more library code shared between oldlib and newlib than
> SAFE_MACROS. So we can still reach tst_brkm_() from newlib, for instance
> tst_device, tst_brkm, ... Hence the redirection has to stay.

Can't we use macro above directly in include/old.test.h and avoid all
redefinitions later? We would move some common stuff from ltp_priv.h
to include/ header, like forward declaration of tst_test and tst_brk_,
but you get the idea: no macro redefinitions would be needed.

  reply	other threads:[~2017-02-10  8:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 14:44 [LTP] [PATCH 1/2] SAFE_MACROS: Redirect to tst_brk_() early Cyril Hrubis
2017-02-09 14:44 ` [LTP] [PATCH 2/2] newlib: Allow SAFE_MACROS to be called from cleanup Cyril Hrubis
2017-02-09 15:56 ` [LTP] [PATCH 1/2] SAFE_MACROS: Redirect to tst_brk_() early Jan Stancek
2017-02-09 16:11   ` Cyril Hrubis
2017-02-10  8:27     ` Jan Stancek [this message]
2017-02-10  8:35       ` Jan Stancek
2017-02-10  9:38         ` Jan Stancek
2017-02-13  8:09           ` Cyril Hrubis
2017-02-13 13:30             ` Jan Stancek
2017-02-13 15:14               ` 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=1865245988.2484651.1486715227566.JavaMail.zimbra@redhat.com \
    --to=jstancek@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