Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2655838pxa; Mon, 17 Aug 2020 15:40:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYCHBj/sXtjo5d/Tv5VsUmQXrBdsu31UysHwuWsUWYoMRDeyZKUVbtK2nsIrOS/ktmi6Vv X-Received: by 2002:a17:906:a00d:: with SMTP id p13mr18186282ejy.535.1597704023064; Mon, 17 Aug 2020 15:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704023; cv=none; d=google.com; s=arc-20160816; b=Z6cjv1oJGbvQHw376KYxzu1FRMDYQO/bwo2sjMYnkU166ExV3zZE3yJXciFyM6/XWU 98vjARl1mon5jrAcwLAsD0uPa96fK9E/kXBbpuftyjvxuAkaiqsc9JDwqw5GTP6RdYJm F+u3ADhHUzYfIL3WKVFpgF1/yklKQNTURKeFLKcrCGEfrhNuy3II+CsXB831XlH6UBXN ME9V4HjPUJblBHw9iXYdq6DtoiPMO1WOvmPctL0p0mKCkO6gqwaI4dkdL/ew/84Dqi07 ExuopcsZYOO67kLSB+faxMac7LXXa7iV8ML086+W3tPqu69vN4RcIK/1qhy+z+NHzJ/V 3bbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oSPoAibhr/Xkn/bzVXueUUFRKI9mYYpnpKx3a2Aribg=; b=uM9bltVO1O765jFk6P++1D8Ubl44Y/P+S4U+0hpKaKPgZRURR2A6k53N7V4QjkmhHa lbjxDyD5km5jBuFRoPIbM0nJRI8vTR1cxXXtwFplXA0xXQThLyEPkY7ggmqFfwaxpRK/ t14HyEv/++tDxeKe4PqBYXJBzvoLBcFbzYKA08BdKh8oHcCfuLCnNdFQspPqiBlV8r+r 7E75OUy9kdbDAwHACwaYFqOnnC4Yac0BtV5qL342I9vyaKvHYXETNN6+INI2sgy4fRfP LmL0Yz+d5QYMM+jLY5qV3ay28MaQ+Q63fF0TgnOKw/mkvSuC9faManMQobEQN5V5h4Tg ZJig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nxbXeG3T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id za3si11947912ejb.312.2020.08.17.15.39.59; Mon, 17 Aug 2020 15:40:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nxbXeG3T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731693AbgHQRye (ORCPT + 99 others); Mon, 17 Aug 2020 13:54:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:39104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388598AbgHQQLJ (ORCPT ); Mon, 17 Aug 2020 12:11:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78FD520578; Mon, 17 Aug 2020 16:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680668; bh=2VsFGxlO7orduKOkaoyzKtQhYRrCDHgYfhHsHYfULMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nxbXeG3TRbCKr/bTr3eGeUPzq9j/pbytB4Mv7FYMiX4a4eK2kqHwVsnwxhC29J3Xt JM2jqQaPH2o7Z/8R6BXfzj4Z+J6MNVifiTLPmdNZx0F5qv/k14Ytu1FvKaugrA+jWm h8C0DvgpedTArYUp9FV3yfgpoZMlawEBQ9qpPCjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ingo Molnar , Miguel Ojeda , Tim Murray , Simon MacMullen , Greg Hackmann , Nick Desaulniers , "Steven Rostedt (VMware)" Subject: [PATCH 4.19 001/168] tracepoint: Mark __tracepoint_strings __used Date: Mon, 17 Aug 2020 17:15:32 +0200 Message-Id: <20200817143733.776032648@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143733.692105228@linuxfoundation.org> References: <20200817143733.692105228@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Desaulniers commit f3751ad0116fb6881f2c3c957d66a9327f69cefb upstream. __tracepoint_string's have their string data stored in .rodata, and an address to that data stored in the "__tracepoint_str" section. Functions that refer to those strings refer to the symbol of the address. Compiler optimization can replace those address references with references directly to the string data. If the address doesn't appear to have other uses, then it appears dead to the compiler and is removed. This can break the /tracing/printk_formats sysfs node which iterates the addresses stored in the "__tracepoint_str" section. Like other strings stored in custom sections in this header, mark these __used to inform the compiler that there are other non-obvious users of the address, so they should still be emitted. Link: https://lkml.kernel.org/r/20200730224555.2142154-2-ndesaulniers@google.com Cc: Ingo Molnar Cc: Miguel Ojeda Cc: stable@vger.kernel.org Fixes: 102c9323c35a8 ("tracing: Add __tracepoint_string() to export string pointers") Reported-by: Tim Murray Reported-by: Simon MacMullen Suggested-by: Greg Hackmann Signed-off-by: Nick Desaulniers Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- include/linux/tracepoint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -364,7 +364,7 @@ static inline struct tracepoint *tracepo static const char *___tp_str __tracepoint_string = str; \ ___tp_str; \ }) -#define __tracepoint_string __attribute__((section("__tracepoint_str"))) +#define __tracepoint_string __attribute__((section("__tracepoint_str"), used)) #else /* * tracepoint_string() is used to save the string address for userspace