From nobody Mon Nov 25 08:05:27 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A53E31E0E14; Wed, 30 Oct 2024 07:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730272187; cv=none; b=LAbG9cjTv7y78PLSdCm97/01D5/k8lp5Yr6oZo6BSvdAlS7uqC4qs9Hogfaqwo3+4/yFZtRTU6LPFLG652e0eECUQgq7d4OwLRN2uBACT1MxRmulmvAVy1AEuB+YSTnXLNiVxGoSKvM/vJzhJXgCnl0YWsmR3R3AKNuxDwC4CVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730272187; c=relaxed/simple; bh=OHa/5zWi0vXq4rcvFOVZBvchbuev/e5QhlYi7bktsvw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i8trpoygMrCDd4+k3Rt2kTs7AZP/qQRVOne9PnXMvT8R5o2cQXjJrgrd9ochYWXHaQrBY2ixd5dyomQ2+vq8AHAIAderuUGV18ioVPImzyLclbhoF6VOdzUhFY2wH/Ji9eYGeDhMTFIfNvBqv89JjbtlLt0dLO2+EsXXhb4Ayp0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=Lrn6f135; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Lrn6f135" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49U2d29c030010; Wed, 30 Oct 2024 07:09:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=oL9IMEzVW/uiWNE33 1Qsj0y4/iuYLMGRaqR2BGXECGI=; b=Lrn6f135qZGb11qXPP5MRudo6VaFLMRQP lWvCw31lmcd3JSqUaMEo81t6+f/q4J6UKtOJL7MxZD8lIclefRFgBEThJh5/hjU7 hUo/LfI3aAoUTkEypJ6HIuXnTgJiBY8za1ZPOM2I6RBEw1c0iyZHGue25Cezc8O1 pMkh7WYGmufZRpnXd3alQCr1175cc9UCpLUzazkqp6wmfz+UkRsNHua3/eOjB6J0 OhWNF5036CO+1Vb6o4OFGH7M+tsw58HeDL3MSxdVnQl1e6XJCvM3GG/J7LPr9991 UBcBNtmZ4wmykEgEydyUXKtS2fG8NVJ29hYy9EK/G80gwUR5MBUfA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42js0h740v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 07:09:05 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 49U795G6031625; Wed, 30 Oct 2024 07:09:05 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42js0h740s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 07:09:05 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 49U2vX0s013585; Wed, 30 Oct 2024 07:09:03 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 42hbrmxw4t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 07:09:03 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 49U78xdY52298166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Oct 2024 07:08:59 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C84DA2004B; Wed, 30 Oct 2024 07:08:59 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5217E20043; Wed, 30 Oct 2024 07:08:56 +0000 (GMT) Received: from li-bd3f974c-2712-11b2-a85c-df1cec4d728e.in.ibm.com (unknown [9.203.115.143]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 30 Oct 2024 07:08:56 +0000 (GMT) From: Hari Bathini To: linuxppc-dev , bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Ellerman , "Naveen N. Rao" , Mark Rutland , Daniel Borkmann , Masahiro Yamada , Nicholas Piggin , Alexei Starovoitov , Steven Rostedt , Masami Hiramatsu , Andrii Nakryiko , Christophe Leroy , Vishal Chourasia , Mahesh J Salgaonkar Subject: [PATCH v7 01/17] powerpc/trace: Account for -fpatchable-function-entry support by toolchain Date: Wed, 30 Oct 2024 12:38:34 +0530 Message-ID: <20241030070850.1361304-2-hbathini@linux.ibm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241030070850.1361304-1-hbathini@linux.ibm.com> References: <20241030070850.1361304-1-hbathini@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 0OC-NmdUTamivNefnDzh0-_LPMbwNn1b X-Proofpoint-ORIG-GUID: hWLytIU6_ef5XItE7c12_4Pod4JJcyUz Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 phishscore=0 impostorscore=0 adultscore=0 clxscore=1011 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410300051 Content-Type: text/plain; charset="utf-8" From: Naveen N Rao So far, we have relied on the fact that gcc supports both -mprofile-kernel, as well as -fpatchable-function-entry, and clang supports neither. Our Makefile only checks for CONFIG_MPROFILE_KERNEL to decide which files to build. Clang has a feature request out [*] to implement -fpatchable-function-entry, and is unlikely to support -mprofile-kernel. Update our Makefile checks so that we pick up the correct files to build once clang picks up support for -fpatchable-function-entry. [*] https://github.com/llvm/llvm-project/issues/57031 Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/trace/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/trace/Makefile b/arch/powerpc/kernel/trace= /Makefile index 125f4ca588b9..d6c3885453bd 100644 --- a/arch/powerpc/kernel/trace/Makefile +++ b/arch/powerpc/kernel/trace/Makefile @@ -9,12 +9,15 @@ CFLAGS_REMOVE_ftrace.o =3D $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_ftrace_64_pg.o =3D $(CC_FLAGS_FTRACE) endif =20 -obj32-$(CONFIG_FUNCTION_TRACER) +=3D ftrace.o ftrace_entry.o -ifdef CONFIG_MPROFILE_KERNEL -obj64-$(CONFIG_FUNCTION_TRACER) +=3D ftrace.o ftrace_entry.o +ifdef CONFIG_FUNCTION_TRACER +obj32-y +=3D ftrace.o ftrace_entry.o +ifeq ($(CONFIG_MPROFILE_KERNEL)$(CONFIG_ARCH_USING_PATCHABLE_FUNCTION_ENTR= Y),) +obj64-y +=3D ftrace_64_pg.o ftrace_64_pg_entry.o else -obj64-$(CONFIG_FUNCTION_TRACER) +=3D ftrace_64_pg.o ftrace_64_pg_entry.o +obj64-y +=3D ftrace.o ftrace_entry.o +endif endif + obj-$(CONFIG_TRACING) +=3D trace_clock.o =20 obj-$(CONFIG_PPC64) +=3D $(obj64-y) --=20 2.47.0