Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbZJXIap (ORCPT ); Sat, 24 Oct 2009 04:30:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752317AbZJXIao (ORCPT ); Sat, 24 Oct 2009 04:30:44 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:36543 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752223AbZJXIan (ORCPT ); Sat, 24 Oct 2009 04:30:43 -0400 Date: Sat, 24 Oct 2009 10:30:31 +0200 From: Ingo Molnar To: Lucas De Marchi Cc: Marti Raudsepp , Peter Zijlstra , Paul Mackerras , Frederic Weisbecker , Arnaldo Carvalho de Melo , Arjan van de Ven , Mike Galbraith , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf tools: add compatibility with libelf 0.8 and autodetect Message-ID: <20091024083031.GB20575@elte.hu> References: <1256330234-14079-1-git-send-email-marti@juffo.org> <20091023210231.GC8356@elte.hu> <1256334501-15755-1-git-send-email-marti@juffo.org> <193b0f820910231807t35f8b462r1f92e28492b780e2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <193b0f820910231807t35f8b462r1f92e28492b780e2@mail.gmail.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-ELTE-SpamScore: 0.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=0.0 required=5.9 tests=none autolearn=no SpamAssassin version=3.2.5 _SUMMARY_ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1256 Lines: 43 * Lucas De Marchi wrote: > On Fri, Oct 23, 2009 at 19:48, Marti Raudsepp wrote: > > On Sat, Oct 24, 2009 at 12:02 AM, Ingo Molnar 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/