Also warn for too long symbols
v2: Add missing newline. Use 255 max (Joe Perches)
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
#endif
-#define KSYM_NAME_LEN 128
+#define KSYM_NAME_LEN 255
struct sym_entry {
unsigned long long addr;
fprintf(stderr, "Read error or end of file.\n");
return -1;
}
+ if (strlen(str) > KSYM_NAME_LEN) {
+ fprintf(stderr, "Symbol %s too long for kallsyms (%lu vs %d).\n"
+ "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
+ str, strlen(str), KSYM_NAME_LEN);
+ return -1;
+ }
sym = str;
/* skip prefix char */