From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311Ab2JAQdG (ORCPT ); Mon, 1 Oct 2012 12:33:06 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:51580 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752825Ab2JAQdD (ORCPT ); Mon, 1 Oct 2012 12:33:03 -0400 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Irina Tirdea , Peter Zijlstra , Paul Mackerras , Ingo Molnar , LKML , Namhyung Kim , Irina Tirdea Subject: [PATCH v2 11/12] perf tools: Convert to BACKTRACE_SUPPORT Date: Tue, 2 Oct 2012 01:32:51 +0900 Message-Id: <1349109171-1942-1-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <20121001142443.GA9829@ghostprotocols.net> References: <20121001142443.GA9829@ghostprotocols.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Namhyung Kim For building perf without stack backtrace debug, we can set NO_BACKTRACE=1 as a argument of make. It then defines NO_BACKTRACE macro for C code to do the proper handling. However it usually used in a negative semantics - e.g. #ifndef - so we saw double negations which can be misleading. Convert it to a positive form to make it more readable and add _SUPPORT suffix for consistency. Cc: Irina Tirdea Signed-off-by: Namhyung Kim --- tools/perf/Makefile | 10 +++++----- tools/perf/util/util.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/perf/Makefile b/tools/perf/Makefile index dd5b9a0507c7..6b3ed863023b 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -45,6 +45,8 @@ include config/utilities.mak # # Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf # backtrace post unwind. +# +# Define NO_BACKTRACE if you do not want stack backtrace debug feature $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) @@ -750,11 +752,9 @@ else endif endif -ifdef NO_BACKTRACE - BASIC_CFLAGS += -DNO_BACKTRACE -else - ifneq ($(call try-cc,$(SOURCE_BACKTRACE),),y) - BASIC_CFLAGS += -DNO_BACKTRACE +ifndef NO_BACKTRACE + ifeq ($(call try-cc,$(SOURCE_BACKTRACE),),y) + BASIC_CFLAGS += -DBACKTRACE_SUPPORT endif endif diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 2055cf38041c..99664598bc1a 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -1,7 +1,7 @@ #include "../perf.h" #include "util.h" #include -#ifndef NO_BACKTRACE +#ifdef BACKTRACE_SUPPORT #include #endif #include @@ -165,7 +165,7 @@ size_t hex_width(u64 v) } /* Obtain a backtrace and print it to stdout. */ -#ifndef NO_BACKTRACE +#ifdef BACKTRACE_SUPPORT void dump_stack(void) { void *array[16]; -- 1.7.9.2