Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf test x86: insn-x86 test data is immutable so mark it const

This allows the movement of some sizeable data arrays (168,624 bytes) to
.data.relro. Without PIE or the strings it could be moved to .rodata.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Ross Zwisler <zwisler@chromium.org>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Yang Jihong <yangjihong1@huawei.com>
Link: https://lore.kernel.org/r/20230526183401.2326121-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
b1d870a8 5c6e7c21

+5 -5
+5 -5
tools/perf/arch/x86/tests/insn-x86.c
··· 18 18 const char *asm_rep; 19 19 }; 20 20 21 - struct test_data test_data_32[] = { 21 + const struct test_data test_data_32[] = { 22 22 #include "insn-x86-dat-32.c" 23 23 {{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"}, 24 24 {{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"}, 25 25 {{0}, 0, 0, NULL, NULL, NULL}, 26 26 }; 27 27 28 - struct test_data test_data_64[] = { 28 + const struct test_data test_data_64[] = { 29 29 #include "insn-x86-dat-64.c" 30 30 {{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"}, 31 31 {{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"}, ··· 97 97 return -1; 98 98 } 99 99 100 - static int test_data_item(struct test_data *dat, int x86_64) 100 + static int test_data_item(const struct test_data *dat, int x86_64) 101 101 { 102 102 struct intel_pt_insn intel_pt_insn; 103 103 int op, branch, ret; ··· 147 147 return 0; 148 148 } 149 149 150 - static int test_data_set(struct test_data *dat_set, int x86_64) 150 + static int test_data_set(const struct test_data *dat_set, int x86_64) 151 151 { 152 - struct test_data *dat; 152 + const struct test_data *dat; 153 153 int ret = 0; 154 154 155 155 for (dat = dat_set; dat->expected_length; dat++) {