All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: Marti Raudsepp <marti@juffo.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Mike Galbraith <efault@gmx.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf tools: add compatibility with libelf 0.8 and autodetect
Date: Sat, 24 Oct 2009 10:30:31 +0200	[thread overview]
Message-ID: <20091024083031.GB20575@elte.hu> (raw)
In-Reply-To: <193b0f820910231807t35f8b462r1f92e28492b780e2@mail.gmail.com>


* Lucas De Marchi <lucas.de.marchi@gmail.com> wrote:

> On Fri, Oct 23, 2009 at 19:48, Marti Raudsepp <marti@juffo.org> wrote:
> > On Sat, Oct 24, 2009 at 12:02 AM, Ingo Molnar <mingo@elte.hu> wrote:
> >> Mind doing a small change:
> >>
> >> I think we want a small cleanup here: a perf_elf_begin() wrapper in a
> >> header file to hide this #ifdef. (That's how Git wraps environmental
> >> libraries as well.)
> >
> Why don't you do something like?:
> 
> #ifdef LIBELF_NO_MMAP
> #define ELF_C_READ_MMAP ELF_C_READ
> #endif
> + changes to Makefile
> 
> or:
> 
> #ifndef ELF_C_READ_MMAP
> #define ELF_C_READ_MMAP ELF_C_READ
> #endif

Makes sense - i'd suggest to prefix it with PERF_ in that case, to make 
sure all callsites are aware of the wrapped nature of this constant. 

I.e. something like this:

/*
 * libelf 0.8 and earlier do not support ELF_C_READ_MMAP;
 * for newer versions we can use mmap to reduce memory usage:
 */
#ifndef ELF_C_READ_MMAP
# define PERF_ELF_C_READ_MMAP ELF_C_READ
#endif

	Ingo

  parent reply	other threads:[~2009-10-24  8:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23 20:37 [PATCH] perf tools: add compatibility with libelf 0.8 and autodetect Marti Raudsepp
2009-10-23 21:02 ` Ingo Molnar
2009-10-23 21:48   ` Marti Raudsepp
2009-10-23 21:52     ` Ingo Molnar
2009-10-23 22:10       ` Marti Raudsepp
2009-10-24  1:07     ` Lucas De Marchi
2009-10-24  1:18       ` Marti Raudsepp
2009-10-24  8:30       ` Ingo Molnar [this message]
2009-10-24 13:26         ` Lucas De Marchi
2009-10-24 15:13           ` Marti Raudsepp
2009-10-24 15:19             ` Marti Raudsepp
2009-10-24 15:41               ` Ingo Molnar
2009-10-24 16:10                 ` Marti Raudsepp
2009-10-23 21:56   ` Lucas De Marchi
2009-10-23 21:59     ` Marti Raudsepp
2009-10-23 22:16       ` Lucas De Marchi

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=20091024083031.GB20575@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=arjan@linux.intel.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    --cc=marti@juffo.org \
    --cc=paulus@samba.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.