From patchwork Thu Sep 26 11:36:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 2948091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C7FD3BFF05 for ; Thu, 26 Sep 2013 11:39:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D4DB2020F for ; Thu, 26 Sep 2013 11:39:37 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C00120204 for ; Thu, 26 Sep 2013 11:39:36 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VP9tn-0003Kv-TU; Thu, 26 Sep 2013 11:38:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VP9tP-0004Ij-3y; Thu, 26 Sep 2013 11:37:59 +0000 Received: from mail-ee0-f41.google.com ([74.125.83.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VP9sp-0004Bm-6Z for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2013 11:37:26 +0000 Received: by mail-ee0-f41.google.com with SMTP id d17so485105eek.0 for ; Thu, 26 Sep 2013 04:37:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+W+h2pvncuCCiwK/OYEkjZrb+mX6f24GmBN6/pyU+QU=; b=EqlqnxQJ48Nrq8qqPiBDpnwW0j22ZTEfRWUZ0ESq19Q4zCC4J7t0hP16eK0F+dmgq4 olYOUrwvka1RjLVthBdj27Tn9dockuQQCh/xMYJ07x0mXnUho2sxdyqsvyyAiz8T7Qqv qhnR6nXpVzqP8WFLmPkGni/yHpQk/Gawajq0YXWaVRwvkVoFobTsvP7A9RR+H+4z6qLj rNJyGAMlloWoQ+GhyZtyc0FTYoujkPJy5i/yqeUT4YpfWisCK3g6TzLA1gF9Sy0Bzhi6 4LtcRIIcySz0vTqYDqAbsciJpj9Ipsh469QpmVli9gqXUrgttTcvqc72VYyvBSQb8jGH 2Bag== X-Gm-Message-State: ALoCoQnQxRKpvsjHwCUgEh8lMVLMZ8ix/+/k4Abx8rYodToB07skyTkItyq/wpmKJqzb/u2E6aRm X-Received: by 10.15.43.206 with SMTP id x54mr501943eev.79.1380195420242; Thu, 26 Sep 2013 04:37:00 -0700 (PDT) Received: from localhost.localdomain (221.61-241-81.adsl-dyn.isp.belgacom.be. [81.241.61.221]) by mx.google.com with ESMTPSA id f49sm2945588eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 04:36:59 -0700 (PDT) From: Jean Pihet To: Will Deacon , Jiri Olsa , linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, Ingo Molnar , linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] perf tools: Check libunwind for availability of dwarf parsing feature Date: Thu, 26 Sep 2013 13:36:37 +0200 Message-Id: <1380195398-4402-4-git-send-email-jean.pihet@linaro.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1380195398-4402-1-git-send-email-jean.pihet@linaro.org> References: <1380195398-4402-1-git-send-email-jean.pihet@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130926_073723_420588_26B049BC X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: Jean Pihet , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The newly added dwarf unwinding feature [1] requires: . a recent version (>= 1.1) of libunwind, . libunwind to be configured with --enable-debug-frame. [1] http://www.spinics.net/lists/kernel/msg1598951.html Add the corresponding API tests in the feature check list. Signed-off-by: Jean Pihet Acked-by: Jiri Olsa --- tools/perf/config/Makefile | 6 +++++- tools/perf/config/feature-tests.mak | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 4b65710..bbaeb04 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -223,9 +223,13 @@ endif FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) - msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99); + msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1); NO_LIBUNWIND := 1 endif # Libunwind support +ifneq ($(call try-cc,$(SOURCE_LIBUNWIND_DEBUG_FRAME),$(FLAGS_UNWIND),libunwind debug_frame),y) + msg := $(warning No debug_frame support found in libunwind); +CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME +endif # debug_frame support in libunwind endif # NO_LIBUNWIND ifndef NO_LIBUNWIND diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak index 708fb8e..cde75f5 100644 --- a/tools/perf/config/feature-tests.mak +++ b/tools/perf/config/feature-tests.mak @@ -176,7 +176,6 @@ extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as, unw_proc_info_t *pi, int need_unwind_info, void *arg); - #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table) int main(void) @@ -188,6 +187,26 @@ int main(void) return 0; } endef + +define SOURCE_LIBUNWIND_DEBUG_FRAME +#include +#include + +extern int +UNW_OBJ(dwarf_find_debug_frame) (int found, unw_dyn_info_t *di_debug, + unw_word_t ip, unw_word_t segbase, + const char *obj_name, unw_word_t start, + unw_word_t end); + +#define dwarf_find_debug_frame UNW_OBJ(dwarf_find_debug_frame) + +int main(void) +{ + dwarf_find_debug_frame(0, NULL, 0, 0, NULL, 0, 0); + return 0; +} +endef + endif ifndef NO_BACKTRACE