From patchwork Sat Jul 12 17:01:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 33534 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 403AC20672 for ; Sat, 12 Jul 2014 17:02:09 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf9448994yha.11 for ; Sat, 12 Jul 2014 10:02:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=EeS6KXIBxSgAOjysk3soVkt5NhPSBUR4DZ3Wl4K85ko=; b=AKgNMkSz945dIDRaHWfIy6QJ4Rc5r4WBpv6+nddiss8OQSjCiv5XLlQMVjjRGDbYhD Bcu/jGZjbQfg7VX8FA5XHKwKDlp53Z/3Gf8TROmGwTIHGS9oo/25Y8royplwSqnPftXS M4slw6NQ4dOc6j2vYKVUqhCX0d3weO3NzzzVVvuBjgEBoGfxfcgDPskdUkor8MkX82vj eLdpbPfCmV6mpgmtS3yvbMQfI1cFPMoCYqHjQMnOL9h4wXt/yDkav0ZO+7B6KwRaO9pW TwPRIY/gUH86VcjxAEHBrm3NlzRiuEwUutZT2iJMw67fXyO94glfw/amBUd2MgUuhgZb xmWg== X-Gm-Message-State: ALoCoQmG7U5PjcNemzALMOjCWdEP3jk0dxBcSjDn0jYzL14iDhwaty/AvpiU7FtrNL0tVTR8JgB6 X-Received: by 10.236.202.43 with SMTP id c31mr2464744yho.25.1405184528721; Sat, 12 Jul 2014 10:02:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.3 with SMTP id t3ls697403qga.82.gmail; Sat, 12 Jul 2014 10:02:08 -0700 (PDT) X-Received: by 10.58.152.234 with SMTP id vb10mr5996158veb.21.1405184528626; Sat, 12 Jul 2014 10:02:08 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id t2si3694768vcs.89.2014.07.12.10.02.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Jul 2014 10:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ij19so4401917vcb.37 for ; Sat, 12 Jul 2014 10:02:08 -0700 (PDT) X-Received: by 10.220.252.198 with SMTP id mx6mr6004672vcb.15.1405184528497; Sat, 12 Jul 2014 10:02:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp16978vcb; Sat, 12 Jul 2014 10:02:08 -0700 (PDT) X-Received: by 10.68.197.195 with SMTP id iw3mr969177pbc.139.1405184527432; Sat, 12 Jul 2014 10:02:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pz4si5521600pac.88.2014.07.12.10.02.06; Sat, 12 Jul 2014 10:02:06 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752384AbaGLRB5 (ORCPT + 28 others); Sat, 12 Jul 2014 13:01:57 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:37400 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbaGLRBz (ORCPT ); Sat, 12 Jul 2014 13:01:55 -0400 Received: by mail-we0-f178.google.com with SMTP id w61so1488974wes.37 for ; Sat, 12 Jul 2014 10:01:54 -0700 (PDT) X-Received: by 10.194.133.1 with SMTP id oy1mr7421199wjb.87.1405184514105; Sat, 12 Jul 2014 10:01:54 -0700 (PDT) Received: from ards-macbook-pro.local ([195.29.92.234]) by mx.google.com with ESMTPSA id da9sm8668455wib.5.2014.07.12.10.01.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Jul 2014 10:01:53 -0700 (PDT) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: Ard Biesheuvel , rostedt@goodmis.org, paulmck@linux.vnet.ibm.com Subject: [PATCH v3] rcu: define tracepoint strings only if CONFIG_TRACING is set Date: Sat, 12 Jul 2014 19:01:49 +0200 Message-Id: <1405184509-12601-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit f7f7bac9cb1c ("rcu: Have the RCU tracepoints use the tracepoint_string infrastructure") unconditionally populates the __tracepoint_str input section, but this section is not assigned an output section if CONFIG_TRACING is not set. This results in the __tracepoint_str turning up in unexpected places, i.e., after _edata. Signed-off-by: Ard Biesheuvel Cc: rostedt@goodmis.org Cc: paulmck@linux.vnet.ibm.com Reviewed-by: Steven Rostedt --- v3: - make definition of _varname conditional as well v2: - s/DEFINE_TPS/DEFINE_RCU_TPS/ kernel/rcu/tree.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index f1ba77363fbb..0756a4696007 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -79,9 +79,18 @@ static struct lock_class_key rcu_fqs_class[RCU_NUM_LVLS]; * the tracing userspace tools to be able to decipher the string * address to the matching string. */ -#define RCU_STATE_INITIALIZER(sname, sabbr, cr) \ +#ifdef CONFIG_TRACING +# define DEFINE_RCU_TPS(sname) \ static char sname##_varname[] = #sname; \ -static const char *tp_##sname##_varname __used __tracepoint_string = sname##_varname; \ +static const char *tp_##sname##_varname __used __tracepoint_string = sname##_varname; +# define RCU_STATE_NAME(sname) sname##_varname +#else +# define DEFINE_RCU_TPS(sname) +# define RCU_STATE_NAME(sname) __stringify(sname) +#endif + +#define RCU_STATE_INITIALIZER(sname, sabbr, cr) \ +DEFINE_RCU_TPS(sname) \ struct rcu_state sname##_state = { \ .level = { &sname##_state.node[0] }, \ .call = cr, \ @@ -93,7 +102,7 @@ struct rcu_state sname##_state = { \ .orphan_donetail = &sname##_state.orphan_donelist, \ .barrier_mutex = __MUTEX_INITIALIZER(sname##_state.barrier_mutex), \ .onoff_mutex = __MUTEX_INITIALIZER(sname##_state.onoff_mutex), \ - .name = sname##_varname, \ + .name = RCU_STATE_NAME(sname), \ .abbr = sabbr, \ }; \ DEFINE_PER_CPU(struct rcu_data, sname##_data)