Skip to content

Commit 887df76

Browse files
committed
scripts/kallsyms: move ignored symbol types to is_ignored_symbol()
Collect the ignored patterns to is_ignored_symbol(). Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 97261e1 commit 887df76

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

scripts/kallsyms.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,21 @@ static bool is_ignored_symbol(const char *name, char type)
137137
return true;
138138
}
139139

140+
if (type == 'U' || type == 'u')
141+
return true;
142+
/* exclude debugging symbols */
143+
if (type == 'N' || type == 'n')
144+
return true;
145+
146+
if (toupper(type) == 'A') {
147+
/* Keep these useful absolute symbols */
148+
if (strcmp(name, "__kernel_syscall_via_break") &&
149+
strcmp(name, "__kernel_syscall_via_epc") &&
150+
strcmp(name, "__kernel_sigtramp") &&
151+
strcmp(name, "__gp"))
152+
return true;
153+
}
154+
140155
return false;
141156
}
142157

@@ -188,21 +203,6 @@ static int read_symbol(FILE *in, struct sym_entry *s)
188203
else if (check_symbol_range(sym, s->addr, text_ranges,
189204
ARRAY_SIZE(text_ranges)) == 0)
190205
/* nothing to do */;
191-
else if (toupper(stype) == 'A')
192-
{
193-
/* Keep these useful absolute symbols */
194-
if (strcmp(sym, "__kernel_syscall_via_break") &&
195-
strcmp(sym, "__kernel_syscall_via_epc") &&
196-
strcmp(sym, "__kernel_sigtramp") &&
197-
strcmp(sym, "__gp"))
198-
return -1;
199-
200-
}
201-
else if (toupper(stype) == 'U')
202-
return -1;
203-
/* exclude debugging symbols */
204-
else if (stype == 'N' || stype == 'n')
205-
return -1;
206206

207207
/* include the type field in the symbol name, so that it gets
208208
* compressed together */

0 commit comments

Comments
 (0)