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: intel-pt-test data is immutable so mark it const

This allows the movement of 5,808 bytes from .data 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-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
7c1d862e b1d870a8

+7 -7
+7 -7
tools/perf/arch/x86/tests/intel-pt-test.c
··· 22 22 * @new_ctx: expected new packet context 23 23 * @ctx_unchanged: the packet context must not change 24 24 */ 25 - static struct test_data { 25 + static const struct test_data { 26 26 int len; 27 27 u8 bytes[INTEL_PT_PKT_MAX_SZ]; 28 28 enum intel_pt_pkt_ctx ctx; ··· 186 186 {0, {0}, 0, {0, 0, 0}, 0, 0 }, 187 187 }; 188 188 189 - static int dump_packet(struct intel_pt_pkt *packet, u8 *bytes, int len) 189 + static int dump_packet(const struct intel_pt_pkt *packet, const u8 *bytes, int len) 190 190 { 191 191 char desc[INTEL_PT_PKT_DESC_MAX]; 192 192 int ret, i; ··· 206 206 return TEST_OK; 207 207 } 208 208 209 - static void decoding_failed(struct test_data *d) 209 + static void decoding_failed(const struct test_data *d) 210 210 { 211 211 pr_debug("Decoding failed!\n"); 212 212 pr_debug("Decoding: "); 213 213 dump_packet(&d->packet, d->bytes, d->len); 214 214 } 215 215 216 - static int fail(struct test_data *d, struct intel_pt_pkt *packet, int len, 216 + static int fail(const struct test_data *d, struct intel_pt_pkt *packet, int len, 217 217 enum intel_pt_pkt_ctx new_ctx) 218 218 { 219 219 decoding_failed(d); ··· 242 242 return TEST_FAIL; 243 243 } 244 244 245 - static int test_ctx_unchanged(struct test_data *d, struct intel_pt_pkt *packet, 245 + static int test_ctx_unchanged(const struct test_data *d, struct intel_pt_pkt *packet, 246 246 enum intel_pt_pkt_ctx ctx) 247 247 { 248 248 enum intel_pt_pkt_ctx old_ctx = ctx; ··· 258 258 return TEST_OK; 259 259 } 260 260 261 - static int test_one(struct test_data *d) 261 + static int test_one(const struct test_data *d) 262 262 { 263 263 struct intel_pt_pkt packet; 264 264 enum intel_pt_pkt_ctx ctx = d->ctx; ··· 307 307 */ 308 308 int test__intel_pt_pkt_decoder(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 309 309 { 310 - struct test_data *d = data; 310 + const struct test_data *d = data; 311 311 int ret; 312 312 313 313 for (d = data; d->len; d++) {