linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Jiri Olsa <jolsa@redhat.com>,
	x86@kernel.org, Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 41/47] objtool: Move x86 insn decoder to a common location
Date: Sun,  1 Sep 2019 09:23:20 -0300	[thread overview]
Message-ID: <20190901122326.5793-42-acme@kernel.org> (raw)
In-Reply-To: <20190901122326.5793-1-acme@kernel.org>

From: Josh Poimboeuf <jpoimboe@redhat.com>

The kernel tree has three identical copies of the x86 instruction
decoder.  Two of them are in the tools subdir.

The tools subdir is supposed to be completely standalone and separate
from the kernel.  So having at least one copy of the kernel decoder in
the tools subdir is unavoidable.  However, we don't need *two* of them.

Move objtool's copy of the decoder to a shared location, so that perf
will also be able to use it.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: x86@kernel.org
Link: http://lore.kernel.org/lkml/55b486b88f6bcd0c9a2a04b34f964860c8390ca8.1567118001.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/{objtool => }/arch/x86/include/asm/inat.h      |  0
 .../{objtool => }/arch/x86/include/asm/inat_types.h  |  0
 tools/{objtool => }/arch/x86/include/asm/insn.h      |  0
 tools/{objtool => }/arch/x86/include/asm/orc_types.h |  0
 tools/{objtool => }/arch/x86/lib/inat.c              |  0
 tools/{objtool => }/arch/x86/lib/insn.c              |  0
 tools/{objtool => }/arch/x86/lib/x86-opcode-map.txt  |  0
 .../arch/x86/tools/gen-insn-attr-x86.awk             |  0
 tools/objtool/Makefile                               |  4 ++--
 tools/objtool/arch/x86/Build                         |  4 ++--
 tools/objtool/arch/x86/decode.c                      |  4 ++--
 tools/objtool/sync-check.sh                          | 12 ++++++------
 12 files changed, 12 insertions(+), 12 deletions(-)
 rename tools/{objtool => }/arch/x86/include/asm/inat.h (100%)
 rename tools/{objtool => }/arch/x86/include/asm/inat_types.h (100%)
 rename tools/{objtool => }/arch/x86/include/asm/insn.h (100%)
 rename tools/{objtool => }/arch/x86/include/asm/orc_types.h (100%)
 rename tools/{objtool => }/arch/x86/lib/inat.c (100%)
 rename tools/{objtool => }/arch/x86/lib/insn.c (100%)
 rename tools/{objtool => }/arch/x86/lib/x86-opcode-map.txt (100%)
 rename tools/{objtool => }/arch/x86/tools/gen-insn-attr-x86.awk (100%)

diff --git a/tools/objtool/arch/x86/include/asm/inat.h b/tools/arch/x86/include/asm/inat.h
similarity index 100%
rename from tools/objtool/arch/x86/include/asm/inat.h
rename to tools/arch/x86/include/asm/inat.h
diff --git a/tools/objtool/arch/x86/include/asm/inat_types.h b/tools/arch/x86/include/asm/inat_types.h
similarity index 100%
rename from tools/objtool/arch/x86/include/asm/inat_types.h
rename to tools/arch/x86/include/asm/inat_types.h
diff --git a/tools/objtool/arch/x86/include/asm/insn.h b/tools/arch/x86/include/asm/insn.h
similarity index 100%
rename from tools/objtool/arch/x86/include/asm/insn.h
rename to tools/arch/x86/include/asm/insn.h
diff --git a/tools/objtool/arch/x86/include/asm/orc_types.h b/tools/arch/x86/include/asm/orc_types.h
similarity index 100%
rename from tools/objtool/arch/x86/include/asm/orc_types.h
rename to tools/arch/x86/include/asm/orc_types.h
diff --git a/tools/objtool/arch/x86/lib/inat.c b/tools/arch/x86/lib/inat.c
similarity index 100%
rename from tools/objtool/arch/x86/lib/inat.c
rename to tools/arch/x86/lib/inat.c
diff --git a/tools/objtool/arch/x86/lib/insn.c b/tools/arch/x86/lib/insn.c
similarity index 100%
rename from tools/objtool/arch/x86/lib/insn.c
rename to tools/arch/x86/lib/insn.c
diff --git a/tools/objtool/arch/x86/lib/x86-opcode-map.txt b/tools/arch/x86/lib/x86-opcode-map.txt
similarity index 100%
rename from tools/objtool/arch/x86/lib/x86-opcode-map.txt
rename to tools/arch/x86/lib/x86-opcode-map.txt
diff --git a/tools/objtool/arch/x86/tools/gen-insn-attr-x86.awk b/tools/arch/x86/tools/gen-insn-attr-x86.awk
similarity index 100%
rename from tools/objtool/arch/x86/tools/gen-insn-attr-x86.awk
rename to tools/arch/x86/tools/gen-insn-attr-x86.awk
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 88158239622b..8c9b9adc67ef 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -33,7 +33,7 @@ all: $(OBJTOOL)
 
 INCLUDES := -I$(srctree)/tools/include \
 	    -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \
-	    -I$(srctree)/tools/objtool/arch/$(ARCH)/include
+	    -I$(srctree)/tools/arch/$(ARCH)/include
 WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
 CFLAGS   += -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS)
 LDFLAGS  += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
@@ -60,7 +60,7 @@ $(LIBSUBCMD): fixdep FORCE
 clean:
 	$(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
 	$(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
-	$(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep
+	$(Q)$(RM) $(OUTPUT)arch/x86/inat-tables.c $(OUTPUT)fixdep
 
 FORCE:
 
diff --git a/tools/objtool/arch/x86/Build b/tools/objtool/arch/x86/Build
index b998412c017d..7c5004008e97 100644
--- a/tools/objtool/arch/x86/Build
+++ b/tools/objtool/arch/x86/Build
@@ -1,7 +1,7 @@
 objtool-y += decode.o
 
-inat_tables_script = arch/x86/tools/gen-insn-attr-x86.awk
-inat_tables_maps = arch/x86/lib/x86-opcode-map.txt
+inat_tables_script = ../arch/x86/tools/gen-insn-attr-x86.awk
+inat_tables_maps = ../arch/x86/lib/x86-opcode-map.txt
 
 $(OUTPUT)arch/x86/lib/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
 	$(call rule_mkdir)
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 0567c47a91b1..a62e032863a8 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -8,8 +8,8 @@
 
 #define unlikely(cond) (cond)
 #include <asm/insn.h>
-#include "lib/inat.c"
-#include "lib/insn.c"
+#include "../../../arch/x86/lib/inat.c"
+#include "../../../arch/x86/lib/insn.c"
 
 #include "../../elf.h"
 #include "../../arch.h"
diff --git a/tools/objtool/sync-check.sh b/tools/objtool/sync-check.sh
index 1470e74e9d66..66f1575b80f3 100755
--- a/tools/objtool/sync-check.sh
+++ b/tools/objtool/sync-check.sh
@@ -2,21 +2,21 @@
 # SPDX-License-Identifier: GPL-2.0
 
 FILES='
-arch/x86/lib/insn.c
-arch/x86/lib/inat.c
-arch/x86/lib/x86-opcode-map.txt
-arch/x86/tools/gen-insn-attr-x86.awk
-arch/x86/include/asm/insn.h
 arch/x86/include/asm/inat.h
 arch/x86/include/asm/inat_types.h
+arch/x86/include/asm/insn.h
 arch/x86/include/asm/orc_types.h
+arch/x86/lib/inat.c
+arch/x86/lib/insn.c
+arch/x86/lib/x86-opcode-map.txt
+arch/x86/tools/gen-insn-attr-x86.awk
 '
 
 check()
 {
 	local file=$1
 
-	diff $file ../../$file > /dev/null ||
+	diff ../$file ../../$file > /dev/null ||
 		echo "Warning: synced file at 'tools/objtool/$file' differs from latest kernel version at '$file'"
 }
 
-- 
2.21.0


  parent reply	other threads:[~2019-09-01 12:25 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-01 12:22 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 01/47] perf c2c: Display proper cpu count in nodes column Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 02/47] perf timechart: Refactor svg_build_topology_map() Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 03/47] perf svghelper: Replace MAX_NR_CPUS with perf_env::nr_cpus_online Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 04/47] perf stat: Replace MAX_NR_CPUS with cpu__max_cpu() Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 05/47] perf session: Replace MAX_NR_CPUS with perf_env::nr_cpus_online Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 06/47] perf machine: " Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 07/47] perf header: Replace MAX_NR_CPUS with cpu__max_cpu() Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 08/47] libperf: Warn when exceeding MAX_NR_CPUS in cpumap Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 09/47] perf tools: Remove needless libtraceevent include directives Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 10/47] perf header: Move CPUINFO_PROC to the only file where it is used Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 11/47] perf tools: Move everything related to sys_perf_event_open() to perf-sys.h Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 12/47] perf time-utils: Adopt rdclock() from perf.h Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 13/47] perf tools: Remove needless perf.h include directive from headers Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 14/47] perf tools: Remove perf.h from source files not needing it Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 15/47] perf tools: Remove debug.h from header " Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 16/47] perf debug: Remove needless include directives from debug.h Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 17/47] perf env: Remove env.h from other headers where just a fwd decl is needed Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 18/47] perf event: Remove needless include directives from event.h Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 19/47] libtraceevent, perf tools: Changes in tep_print_event_* APIs Arnaldo Carvalho de Melo
2019-09-01 12:22 ` [PATCH 20/47] libtraceevent: Remove tep_register_trace_clock() Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 21/47] libtraceevent: Change users plugin directory Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 22/47] perf dso: Adopt DSO related macros from symbol.h Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 23/47] perf symbol: Move C++ demangle defines to the only file using it Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 24/47] perf symbols: Add missing linux/refcount.h to symbol.h Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 25/47] perf symbols: Move symsrc prototypes to a separate header Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 26/47] perf dsos: Move the dsos struct and its methods to separate source files Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 27/47] perf hist: Remove needless ui/progress.h from hist.h Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 28/47] perf tools: Move 'struct events_stats' and prototypes to separate header Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 29/47] perf tools: Remove needless sort.h include directives Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 30/47] perf probe: No need for symbol.h, symbol_conf is enough Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 31/47] perf tools: Remove needless map.h include directives Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 32/47] perf tools: Remove needless thread.h " Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 33/47] perf tools: Remove needless thread_map.h " Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 34/47] perf tools: Remove needless evlist.h " Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 35/47] " Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 36/47] perf auxtrace: Uninline functions that touch perf_session Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 37/47] perf symbols: Move mem_info and branch_info out of symbol.h Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 38/47] perf pmu: Change convert_scale from static to global Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 39/47] perf metricgroup: Scale the metric result Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 40/47] perf metricgroup: Support multiple events for metricgroup Arnaldo Carvalho de Melo
2019-09-01 12:23 ` Arnaldo Carvalho de Melo [this message]
2019-09-01 12:23 ` [PATCH 42/47] perf: Update .gitignore file Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 43/47] perf intel-pt: Remove inat.c from build dependency list Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 44/47] perf intel-pt: Use shared x86 insn decoder Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 45/47] perf build: Ignore intentional differences for the " Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 46/47] objtool: Update sync-check.sh from perf's check-headers.sh Arnaldo Carvalho de Melo
2019-09-01 12:23 ` [PATCH 47/47] objtool: Ignore intentional differences for the x86 insn decoder Arnaldo Carvalho de Melo
2019-09-02  7:14 ` [GIT PULL] perf/core improvements and fixes Ingo Molnar

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=20190901122326.5793-42-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.com \
    --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).