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: Make some large static arrays const to move it to .data.rel.ro

Allows the movement of 33,128 bytes from .data to .data.rel.ro.

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-5-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

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

+19 -14
+19 -14
tools/perf/builtin-trace.c
··· 914 914 #include "trace/beauty/socket_type.c" 915 915 #include "trace/beauty/waitid_options.c" 916 916 917 - static struct syscall_fmt syscall_fmts[] = { 917 + static const struct syscall_fmt syscall_fmts[] = { 918 918 { .name = "access", 919 919 .arg = { [1] = { .scnprintf = SCA_ACCMODE, /* mode */ }, }, }, 920 920 { .name = "arch_prctl", ··· 1176 1176 return strcmp(name, fmt->name); 1177 1177 } 1178 1178 1179 - static struct syscall_fmt *__syscall_fmt__find(struct syscall_fmt *fmts, const int nmemb, const char *name) 1179 + static const struct syscall_fmt *__syscall_fmt__find(const struct syscall_fmt *fmts, 1180 + const int nmemb, 1181 + const char *name) 1180 1182 { 1181 1183 return bsearch(name, fmts, nmemb, sizeof(struct syscall_fmt), syscall_fmt__cmp); 1182 1184 } 1183 1185 1184 - static struct syscall_fmt *syscall_fmt__find(const char *name) 1186 + static const struct syscall_fmt *syscall_fmt__find(const char *name) 1185 1187 { 1186 1188 const int nmemb = ARRAY_SIZE(syscall_fmts); 1187 1189 return __syscall_fmt__find(syscall_fmts, nmemb, name); 1188 1190 } 1189 1191 1190 - static struct syscall_fmt *__syscall_fmt__find_by_alias(struct syscall_fmt *fmts, const int nmemb, const char *alias) 1192 + static const struct syscall_fmt *__syscall_fmt__find_by_alias(const struct syscall_fmt *fmts, 1193 + const int nmemb, const char *alias) 1191 1194 { 1192 1195 int i; 1193 1196 ··· 1202 1199 return NULL; 1203 1200 } 1204 1201 1205 - static struct syscall_fmt *syscall_fmt__find_by_alias(const char *alias) 1202 + static const struct syscall_fmt *syscall_fmt__find_by_alias(const char *alias) 1206 1203 { 1207 1204 const int nmemb = ARRAY_SIZE(syscall_fmts); 1208 1205 return __syscall_fmt__find_by_alias(syscall_fmts, nmemb, alias); ··· 1227 1224 bool nonexistent; 1228 1225 struct tep_format_field *args; 1229 1226 const char *name; 1230 - struct syscall_fmt *fmt; 1227 + const struct syscall_fmt *fmt; 1231 1228 struct syscall_arg_fmt *arg_fmt; 1232 1229 }; 1233 1230 ··· 1676 1673 return 0; 1677 1674 } 1678 1675 1679 - static struct syscall_arg_fmt syscall_arg_fmts__by_name[] = { 1676 + static const struct syscall_arg_fmt syscall_arg_fmts__by_name[] = { 1680 1677 { .name = "msr", .scnprintf = SCA_X86_MSR, .strtoul = STUL_X86_MSR, }, 1681 1678 { .name = "vector", .scnprintf = SCA_X86_IRQ_VECTORS, .strtoul = STUL_X86_IRQ_VECTORS, }, 1682 1679 }; ··· 1687 1684 return strcmp(name, fmt->name); 1688 1685 } 1689 1686 1690 - static struct syscall_arg_fmt * 1691 - __syscall_arg_fmt__find_by_name(struct syscall_arg_fmt *fmts, const int nmemb, const char *name) 1687 + static const struct syscall_arg_fmt * 1688 + __syscall_arg_fmt__find_by_name(const struct syscall_arg_fmt *fmts, const int nmemb, 1689 + const char *name) 1692 1690 { 1693 1691 return bsearch(name, fmts, nmemb, sizeof(struct syscall_arg_fmt), syscall_arg_fmt__cmp); 1694 1692 } 1695 1693 1696 - static struct syscall_arg_fmt *syscall_arg_fmt__find_by_name(const char *name) 1694 + static const struct syscall_arg_fmt *syscall_arg_fmt__find_by_name(const char *name) 1697 1695 { 1698 1696 const int nmemb = ARRAY_SIZE(syscall_arg_fmts__by_name); 1699 1697 return __syscall_arg_fmt__find_by_name(syscall_arg_fmts__by_name, nmemb, name); ··· 1739 1735 * 7 unsigned long 1740 1736 */ 1741 1737 arg->scnprintf = SCA_FD; 1742 - } else { 1743 - struct syscall_arg_fmt *fmt = syscall_arg_fmt__find_by_name(field->name); 1738 + } else { 1739 + const struct syscall_arg_fmt *fmt = 1740 + syscall_arg_fmt__find_by_name(field->name); 1744 1741 1745 1742 if (fmt) { 1746 1743 arg->scnprintf = fmt->scnprintf; ··· 4463 4458 struct syscall_arg_fmt *fmt = evsel__syscall_arg_fmt(evsel); 4464 4459 4465 4460 if (fmt) { 4466 - struct syscall_fmt *scfmt = syscall_fmt__find(name); 4461 + const struct syscall_fmt *scfmt = syscall_fmt__find(name); 4467 4462 4468 4463 if (scfmt) { 4469 4464 int skip = 0; ··· 4530 4525 int len = strlen(str) + 1, err = -1, list, idx; 4531 4526 char *strace_groups_dir = system_path(STRACE_GROUPS_DIR); 4532 4527 char group_name[PATH_MAX]; 4533 - struct syscall_fmt *fmt; 4528 + const struct syscall_fmt *fmt; 4534 4529 4535 4530 if (strace_groups_dir == NULL) 4536 4531 return -1;