Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp429692lqk; Sat, 9 Mar 2024 18:10:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU0JTk19q9kdApNQRjcafzYdLe/TZwmLQXrdNxIkGDK7me/dwQRrniK7JIUMMoympALSFN0ZnAi+O0DoEricWQgrEvFXDdCFOyOtuSbUw== X-Google-Smtp-Source: AGHT+IGJXecY2kglRjb5VLcVR5YmEs2FMMxd99/gxJwesIzltKGWwI+7+8JvlrkuO2O6HebUbv8m X-Received: by 2002:a05:6a20:3d86:b0:1a0:ce31:128b with SMTP id s6-20020a056a203d8600b001a0ce31128bmr4019066pzi.34.1710036633841; Sat, 09 Mar 2024 18:10:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1710036633; cv=pass; d=google.com; s=arc-20160816; b=sBLExLU5o3DkcdEGrY77kECN7oFHC+NNzKcXf2f8P6kkztx58/vBPtss+fHYhfIv7x 6+9rXYo9tH8POdVp9hjhV7JIJ6aIctTstZ/ruO4U+7cZYrd2T86JwxDouV9aDzv2Pjb8 zoUQ1rYPUqlul1/dUu3IXNlhS0/Tfa/1asEXxPcBFB7GvZxMlFM0jzaQw3IL78I2LQOU 4bTHacL4A+qclRKyaaT1BL19uQ7ElYylR5K4BncP5Nxcq9BQe6rjfTCEfl6ZPw62QToI v6eX+jsYJmSrotQ6CFkKweZVBCcCGG/OdiMCUGeCnJjH4EbOUtRigehjks4dagZ/Z4mu 2vXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=z2TI3BR52BOETJMkXQVYiCvqxjFYb61EnnuV6r2EGgU=; fh=lPYNrxv6fAhOiCA+wV4nEZb/5+jJxSPxdZlaGLON85s=; b=mpeyWgzlJgd4SW9K5HDp10UDekR30xRpEwj7xod5ouQgS0PuyUA9+xbzpvfAlDHm9o gUVHcD9CnIN6KDhznNjYtVVyQ7OBtTqgVZk/id6yXXYGBdoayq13BEHAabHB5MNCEN1I 9ae3lL3lOPj9seaZPkK5NrVZoro8GOXluFVAUfLxc47ylU0Bs8/aB2MsZmHswhZkDM67 2DWhkYL/7B2cXs0BnFk5gSl6aOLkCIoJEmLRCKl6pMwwP1x9aGov3H1wcKgO8QHPvgHC 2ehE4IWm7Qr2RcmpcyL/dBUbyuRsUI1mkZdz7KXqDxHhMlDvcSoUAEXinztL0229xMsy a+KQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=hV39oof8; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-98098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id cd7-20020a056a00420700b006e680f4979bsi1260083pfb.65.2024.03.09.18.10.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 18:10:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=hV39oof8; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-98098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 90170B20978 for ; Sun, 10 Mar 2024 02:10:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39AD73B796; Sun, 10 Mar 2024 02:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hV39oof8" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59A203A8C0 for ; Sun, 10 Mar 2024 02:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710036368; cv=none; b=DAG57cyZ0Q3vQv1Jz2f34wnNKa5y2jEslhLTrSCsZEE5hZQ7KkNzKaUIrswy87BS/3I3AGwtvyXwl97TIbZcvWciBbE7TTvUqrVrOIq/QuDNPc8OF3a2iGl1t+EAPVaMkyPECdAD/LFkbRUmx7mq4AgrQPEqEo8+UopATer8e4M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710036368; c=relaxed/simple; bh=qvu80I2tuIwczv3ewDN5Kf8bkfHfC9IP72lON4Zzmek=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=cTJtAJUokLnlVSnb+DDBhyLuyO3ZC5IBuD/j7cXva6tpFKTg7PdVOwz4ByZo4UUlSGgeKaI0/A2bXQ1v9Jx9AhuTf4Q8wgE1prlBfqHS261JkKdrMvzPMx1g70PQSBcI+eJcHpUjxMaL+ZGJbArabHV3oTe5497JP7nPjir6fxA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hV39oof8; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dcd94cc48a1so5346747276.3 for ; Sat, 09 Mar 2024 18:06:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710036365; x=1710641165; darn=vger.kernel.org; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=z2TI3BR52BOETJMkXQVYiCvqxjFYb61EnnuV6r2EGgU=; b=hV39oof8n6gQYhpoRdQBNKXrF9luve4Gjjy1Iibfj18oWaFulJIcW/K0a+36t6prcz c2TirRz8836CT+nuHJYaKfcP8O3elPqWrHmJdhPhrYbIebqJVgH2tC4zE2I3VeLdlg23 ihbhVIuMkt4Fo+motqOpBgLeIqMlgh6bVwkPGzIwr78rsxBOM839rKLVNIweb/bB37oC bee/hJw0Psd6q4+giekuPYhNzCCyOGVouxE66vuCTKa3h+WcMmDafItdyLDBzhIC+mvw yus2gBGtfrawoxBl/bS0bvetjFoluac4zdUvlbymAVId8gCuS3ZZ+LOeQ0GGcBYxc1wG mt4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710036365; x=1710641165; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=z2TI3BR52BOETJMkXQVYiCvqxjFYb61EnnuV6r2EGgU=; b=VZdn24Qs0/T6pnVYJFVi4789+RFIK9/gXbH/OM5zxJQ3T/9pQGxOZhNk9c8qh7mAxz Ctphm/G/X+LDU5jAAbXU5Yee1xiX6WZfO7/9Q/mKKdB8J3sc77twOut4fyale679rRHS OQXqMf4wuPDvTUnmlzhiEjoBeDmzt3QC7uGp1wwfZcoOdEFAPofg45nNCUJ9RJs7xUtX 6rpPT9n/hvvfsFOFCObTrWmWt15TKn8/QQnyoOXnaUQ7MakrCmocMCfkUyPk4kjN4f/F zWCVVB74EfkMgL9rLcJE/RblKVKXgN5HLZy/i9ELVQA6bmLfQhoGnyoW9ubtIe+YTI1m xUoQ== X-Forwarded-Encrypted: i=1; AJvYcCU/N94kuR1fTVZDbfJYtsiQr1Zub+JVZp9E/1W/z1TAjTBRMYiiJn61t9tudCLH/ZR/BGncVBMUa/3CGvO2Sof3+dPqiOs9d2WqsBZb X-Gm-Message-State: AOJu0YzQgQjAi1gNLLZZRqqh9ipyZ9cjhDRXt54dG2apiAR9QIbqyYdd cvGNXLQu52UjDnc71t7kvFKX0VWjy8V0VS+1A0zcaMqWMzM1Fw6nmF1nBlHGCHr68iwRvdCW8/6 XcPWvmA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:a63d:1b65:e810:3ad3]) (user=irogers job=sendgmr) by 2002:a05:6902:18c9:b0:dc6:fec4:1c26 with SMTP id ck9-20020a05690218c900b00dc6fec41c26mr897542ybb.1.1710036365375; Sat, 09 Mar 2024 18:06:05 -0800 (PST) Date: Sat, 9 Mar 2024 18:05:08 -0800 In-Reply-To: <20240310020509.647319-1-irogers@google.com> Message-Id: <20240310020509.647319-14-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240310020509.647319-1-irogers@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Subject: [PATCH v1 13/13] tools headers: Rename noinline to __noinline From: Ian Rogers To: Arnd Bergmann , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Ian Rogers , Adrian Hunter , Paolo Bonzini , Shuah Khan , Kees Cook , "Gustavo A. R. Silva" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andrew Morton , Liam Howlett , Miguel Ojeda , Will Deacon , Mark Brown , David Laight , "Michael S. Tsirkin" , Shunsuke Mie , Yafang Shao , Kui-Feng Lee , James Clark , Nick Forrington , Leo Yan , German Gomez , Rob Herring , John Garry , Sean Christopherson , Anup Patel , Fuad Tabba , Andrew Jones , Chao Peng , Haibo Xu , Peter Xu , Vishal Annapurve , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org, llvm@lists.linux.dev Cc: Christopher Di Bella Content-Type: text/plain; charset="UTF-8" An issue was reported with clang and llvm libc where the noinline attribute [1] was being expanded due to the #define in linux/compiler.h (now in compiler_attributes.h). The expansion caused the __attribute__ to appear twice and break the build. To avoid this conflict, rename noinline to __noinline which is more consistent with other compiler attributes. [1] https://clang.llvm.org/docs/AttributeReference.html#noinline Reported-by: Christopher Di Bella Signed-off-by: Ian Rogers --- tools/include/linux/compiler_attributes.h | 4 ++-- tools/perf/arch/x86/tests/bp-modify.c | 4 ++-- tools/perf/bench/find-bit-bench.c | 2 +- tools/perf/tests/bp_account.c | 2 +- tools/perf/tests/bp_signal.c | 2 +- tools/perf/tests/bp_signal_overflow.c | 2 +- tools/perf/tests/dwarf-unwind.c | 12 ++++++------ tools/perf/tests/workloads/leafloop.c | 8 ++++---- tools/perf/tests/workloads/thloop.c | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/include/linux/compiler_attributes.h b/tools/include/linux/compiler_attributes.h index 9bfaec783e48..1ff3d85f5af3 100644 --- a/tools/include/linux/compiler_attributes.h +++ b/tools/include/linux/compiler_attributes.h @@ -267,12 +267,12 @@ # define __flatten __attribute__((flatten)) /* - * Note the missing underscores. + * Note, the kernel version is missing the underscores. * * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noinline-function-attribute * clang: mentioned */ -#define noinline __attribute__((__noinline__)) +#define __noinline __attribute__((__noinline__)) /* * Optional: only supported since gcc >= 8 diff --git a/tools/perf/arch/x86/tests/bp-modify.c b/tools/perf/arch/x86/tests/bp-modify.c index 0924ccd9e36d..65493ff7a76f 100644 --- a/tools/perf/arch/x86/tests/bp-modify.c +++ b/tools/perf/arch/x86/tests/bp-modify.c @@ -15,13 +15,13 @@ #include "tests/tests.h" #include "arch-tests.h" -static noinline int bp_1(void) +static __noinline int bp_1(void) { pr_debug("in %s\n", __func__); return 0; } -static noinline int bp_2(void) +static __noinline int bp_2(void) { pr_debug("in %s\n", __func__); return 0; diff --git a/tools/perf/bench/find-bit-bench.c b/tools/perf/bench/find-bit-bench.c index 7e25b0e413f6..dd97a51649bc 100644 --- a/tools/perf/bench/find-bit-bench.c +++ b/tools/perf/bench/find-bit-bench.c @@ -31,7 +31,7 @@ static const char *const bench_usage[] = { static unsigned int accumulator; static unsigned int use_of_val; -static noinline void workload(int val) +static __noinline void workload(int val) { use_of_val += val; accumulator++; diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c index 6f921db33cf9..459f61752a71 100644 --- a/tools/perf/tests/bp_account.c +++ b/tools/perf/tests/bp_account.c @@ -34,7 +34,7 @@ static volatile long the_var; -static noinline int test_function(void) +static __noinline int test_function(void) { return 0; } diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c index 1f2908f02389..484a7e7f96ee 100644 --- a/tools/perf/tests/bp_signal.c +++ b/tools/perf/tests/bp_signal.c @@ -59,7 +59,7 @@ static void __test_function(volatile long *ptr) } #endif -static noinline int test_function(void) +static __noinline int test_function(void) { __test_function(&the_var); the_var++; diff --git a/tools/perf/tests/bp_signal_overflow.c b/tools/perf/tests/bp_signal_overflow.c index 4e897c2cf26b..9436bf2973f8 100644 --- a/tools/perf/tests/bp_signal_overflow.c +++ b/tools/perf/tests/bp_signal_overflow.c @@ -30,7 +30,7 @@ static int overflows; -static noinline int test_function(void) +static __noinline int test_function(void) { return time(NULL); } diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c index d01aa931fe81..a669c69a9242 100644 --- a/tools/perf/tests/dwarf-unwind.c +++ b/tools/perf/tests/dwarf-unwind.c @@ -109,7 +109,7 @@ static int unwind_entry(struct unwind_entry *entry, void *arg) return strcmp((const char *) symbol, funcs[idx]); } -NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__thread(struct thread *thread) +NO_TAIL_CALL_ATTRIBUTE __noinline int test_dwarf_unwind__thread(struct thread *thread) { struct perf_sample sample; unsigned long cnt = 0; @@ -140,7 +140,7 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__thread(struct thread *thr static int global_unwind_retval = -INT_MAX; -NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__compare(void *p1, void *p2) +NO_TAIL_CALL_ATTRIBUTE __noinline int test_dwarf_unwind__compare(void *p1, void *p2) { /* Any possible value should be 'thread' */ struct thread *thread = *(struct thread **)p1; @@ -159,7 +159,7 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__compare(void *p1, void *p return p1 - p2; } -NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_3(struct thread *thread) +NO_TAIL_CALL_ATTRIBUTE __noinline int test_dwarf_unwind__krava_3(struct thread *thread) { struct thread *array[2] = {thread, thread}; void *fp = &bsearch; @@ -178,7 +178,7 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_3(struct thread *th return global_unwind_retval; } -NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_2(struct thread *thread) +NO_TAIL_CALL_ATTRIBUTE __noinline int test_dwarf_unwind__krava_2(struct thread *thread) { int ret; @@ -187,7 +187,7 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_2(struct thread *th return ret; } -NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_1(struct thread *thread) +NO_TAIL_CALL_ATTRIBUTE __noinline int test_dwarf_unwind__krava_1(struct thread *thread) { int ret; @@ -196,7 +196,7 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_1(struct thread *th return ret; } -noinline int test__dwarf_unwind(struct test_suite *test __maybe_unused, +__noinline int test__dwarf_unwind(struct test_suite *test __maybe_unused, int subtest __maybe_unused) { struct machine *machine; diff --git a/tools/perf/tests/workloads/leafloop.c b/tools/perf/tests/workloads/leafloop.c index 1bf5cc97649b..89d2cec2f461 100644 --- a/tools/perf/tests/workloads/leafloop.c +++ b/tools/perf/tests/workloads/leafloop.c @@ -4,18 +4,18 @@ #include "../tests.h" /* We want to check these symbols in perf script */ -noinline void leaf(volatile int b); -noinline void parent(volatile int b); +__noinline void leaf(volatile int b); +__noinline void parent(volatile int b); static volatile int a; -noinline void leaf(volatile int b) +__noinline void leaf(volatile int b) { for (;;) a += b; } -noinline void parent(volatile int b) +__noinline void parent(volatile int b) { leaf(b); } diff --git a/tools/perf/tests/workloads/thloop.c b/tools/perf/tests/workloads/thloop.c index 457b29f91c3e..e252efb76203 100644 --- a/tools/perf/tests/workloads/thloop.c +++ b/tools/perf/tests/workloads/thloop.c @@ -9,14 +9,14 @@ static volatile sig_atomic_t done; /* We want to check this symbol in perf report */ -noinline void test_loop(void); +__noinline void test_loop(void); static void sighandler(int sig __maybe_unused) { done = 1; } -noinline void test_loop(void) +__noinline void test_loop(void) { while (!done); } -- 2.44.0.278.ge034bb2e1d-goog