From: zhaoxiao <zhaoxiao@uniontech.com>
To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
x86@kernel.org, hpa@zytor.com, nivedita@alum.mit.edu,
clin@suse.com, andriy.shevchenko@linux.intel.com,
ndesaulniers@google.com, dan.j.williams@intel.com,
masahiroy@kernel.org, linux-kernel@vger.kernel.org
Cc: jroedel@suse.de, peterz@infradead.org, jpoimboe@redhat.com,
zhaoxiao <zhaoxiao@uniontech.com>
Subject: [PATCH v2] X86: Makefile: Replace -pg with CC_FLAGS_FTRACE
Date: Fri, 16 Apr 2021 13:39:28 +0800 [thread overview]
Message-ID: <20210416053928.11576-1-zhaoxiao@uniontech.com> (raw)
In preparation for x86 supporting ftrace built on other compiler
options, let's have the x86 Makefiles remove the $(CC_FLAGS_FTRACE)
flags, whatever these may be, rather than assuming '-pg'.
There should be no functional change as a result of this patch.
Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
---
v2: add the same change for the other Makefile in arch/x86 directory.
arch/x86/entry/vdso/Makefile | 8 ++++----
arch/x86/kernel/Makefile | 16 ++++++++--------
arch/x86/kernel/cpu/Makefile | 4 ++--
arch/x86/lib/Makefile | 2 +-
arch/x86/mm/Makefile | 4 ++--
arch/x86/xen/Makefile | 6 +++---
6 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 05c4abc2fdfd..c5bd91bf9f93 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -96,10 +96,10 @@ $(vobjs): KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO) $(GCC_PLUGINS_CFLAGS) $(
#
# vDSO code runs in userspace and -pg doesn't help with profiling anyway.
#
-CFLAGS_REMOVE_vclock_gettime.o = -pg
-CFLAGS_REMOVE_vdso32/vclock_gettime.o = -pg
-CFLAGS_REMOVE_vgetcpu.o = -pg
-CFLAGS_REMOVE_vsgx.o = -pg
+CFLAGS_REMOVE_vclock_gettime.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_vdso32/vclock_gettime.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_vgetcpu.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_vsgx.o = $(CC_FLAGS_FTRACE)
#
# X32 processes use x32 vDSO to access 64bit kernel data.
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 2ddf08351f0b..2811fc6a17ba 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -13,14 +13,14 @@ CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
ifdef CONFIG_FUNCTION_TRACER
# Do not profile debug and lowlevel utilities
-CFLAGS_REMOVE_tsc.o = -pg
-CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
-CFLAGS_REMOVE_pvclock.o = -pg
-CFLAGS_REMOVE_kvmclock.o = -pg
-CFLAGS_REMOVE_ftrace.o = -pg
-CFLAGS_REMOVE_early_printk.o = -pg
-CFLAGS_REMOVE_head64.o = -pg
-CFLAGS_REMOVE_sev-es.o = -pg
+CFLAGS_REMOVE_tsc.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_paravirt-spinlocks.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_pvclock.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_kvmclock.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_early_printk.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_head64.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_sev-es.o = $(CC_FLAGS_FTRACE)
endif
KASAN_SANITIZE_head$(BITS).o := n
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 637b499450d1..4435c6de9145 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -5,8 +5,8 @@
# Don't trace early stages of a secondary CPU boot
ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_common.o = -pg
-CFLAGS_REMOVE_perf_event.o = -pg
+CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_perf_event.o = $(CC_FLAGS_FTRACE)
endif
# If these files are instrumented, boot hangs during the first second.
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index bad4dee4f0e4..0aa71b8a5bc1 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -21,7 +21,7 @@ KASAN_SANITIZE_cmdline.o := n
KCSAN_SANITIZE_cmdline.o := n
ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_cmdline.o = -pg
+CFLAGS_REMOVE_cmdline.o = $(CC_FLAGS_FTRACE)
endif
CFLAGS_cmdline.o := -fno-stack-protector -fno-jump-tables
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index 5864219221ca..91883d5a0293 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -12,8 +12,8 @@ KASAN_SANITIZE_mem_encrypt_identity.o := n
KCSAN_SANITIZE := n
ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_mem_encrypt.o = -pg
-CFLAGS_REMOVE_mem_encrypt_identity.o = -pg
+CFLAGS_REMOVE_mem_encrypt.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_mem_encrypt_identity.o = $(CC_FLAGS_FTRACE)
endif
obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o mmap.o \
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 40b5779fce21..179dfc124c94 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -2,9 +2,9 @@
ifdef CONFIG_FUNCTION_TRACER
# Do not profile debug and lowlevel utilities
-CFLAGS_REMOVE_spinlock.o = -pg
-CFLAGS_REMOVE_time.o = -pg
-CFLAGS_REMOVE_irq.o = -pg
+CFLAGS_REMOVE_spinlock.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_time.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_irq.o = $(CC_FLAGS_FTRACE)
endif
# Make sure early boot has no stackprotector
--
2.20.1
next reply other threads:[~2021-04-16 5:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 5:39 zhaoxiao [this message]
2021-04-16 15:12 ` [PATCH v2] X86: Makefile: Replace -pg with CC_FLAGS_FTRACE Josh Poimboeuf
2021-04-16 16:49 ` Steven Rostedt
2021-04-16 21:56 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210416053928.11576-1-zhaoxiao@uniontech.com \
--to=zhaoxiao@uniontech.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bp@alien8.de \
--cc=clin@suse.com \
--cc=dan.j.williams@intel.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=nivedita@alum.mit.edu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).