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 trace beauty: Make MSR arrays const to move it to .data.rel.ro

Allows the movement of 46,072 bytes from .data to .data.rel.ro.

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

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
1fc88e5a 60995604

+4 -4
+1 -1
tools/perf/trace/beauty/beauty.h
··· 11 11 u64 offset; 12 12 int nr_entries; 13 13 const char *prefix; 14 - const char **entries; 14 + const char * const *entries; 15 15 }; 16 16 17 17 #define DEFINE_STRARRAY(array, _prefix) struct strarray strarray__##array = { \
+3 -3
tools/perf/trace/beauty/tracepoints/x86_msr.sh
··· 13 13 # Just the ones starting with 0x00000 so as to have a simple 14 14 # array. 15 15 16 - printf "static const char *x86_MSRs[] = {\n" 16 + printf "static const char * const x86_MSRs[] = {\n" 17 17 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MSR_([[:alnum:]][[:alnum:]_]+)[[:space:]]+(0x00000[[:xdigit:]]+)[[:space:]]*.*' 18 18 grep -E $regex ${x86_msr_index} | grep -E -v 'MSR_(ATOM|P[46]|IA32_(TSC_DEADLINE|UCODE_REV)|IDT_FCR4)' | \ 19 19 sed -r "s/$regex/\2 \1/g" | sort -n | \ ··· 24 24 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MSR_([[:alnum:]][[:alnum:]_]+)[[:space:]]+(0xc0000[[:xdigit:]]+)[[:space:]]*.*' 25 25 printf "#define x86_64_specific_MSRs_offset " 26 26 grep -E $regex ${x86_msr_index} | sed -r "s/$regex/\2/g" | sort -n | head -1 27 - printf "static const char *x86_64_specific_MSRs[] = {\n" 27 + printf "static const char * const x86_64_specific_MSRs[] = {\n" 28 28 grep -E $regex ${x86_msr_index} | \ 29 29 sed -r "s/$regex/\2 \1/g" | grep -E -vw 'K6_WHCR' | sort -n | \ 30 30 xargs printf "\t[%s - x86_64_specific_MSRs_offset] = \"%s\",\n" ··· 33 33 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MSR_([[:alnum:]][[:alnum:]_]+)[[:space:]]+(0xc0010[[:xdigit:]]+)[[:space:]]*.*' 34 34 printf "#define x86_AMD_V_KVM_MSRs_offset " 35 35 grep -E $regex ${x86_msr_index} | sed -r "s/$regex/\2/g" | sort -n | head -1 36 - printf "static const char *x86_AMD_V_KVM_MSRs[] = {\n" 36 + printf "static const char * const x86_AMD_V_KVM_MSRs[] = {\n" 37 37 grep -E $regex ${x86_msr_index} | \ 38 38 sed -r "s/$regex/\2 \1/g" | sort -n | \ 39 39 xargs printf "\t[%s - x86_AMD_V_KVM_MSRs_offset] = \"%s\",\n"