Re: [PATCH v3 4/6] scripts/sorttable: Zero out weak functions in mcount_loc table

From
Jiri Olsa <hidden>
Date
2025-02-14 22:14:30
Also in
bpf, linux-kbuild, linux-s390, linux-trace-kernel, lkml
Reply to
Steven Rostedt, 2025-02-13
On Thu, Feb 13, 2025 at 11:20:51AM -0500, Steven Rostedt wrote:

SNIP
quoted hunk ↗ jump to hunk
+static int cmp_funcs(const void *A, const void *B)
+{
+	const struct func_info *a = A;
+	const struct func_info *b = B;
+
+	if (a->addr < b->addr)
+		return -1;
+	return a->addr > b->addr;
+}
+
+static int parse_symbols(const char *fname)
+{
+	FILE *fp;
+	char addr_str[20]; /* Only need 17, but round up to next int size */
+	char size_str[20];
+	char type;
+
+	fp = fopen(fname, "r");
+	if (!fp) {
+		perror(fname);
+		return -1;
+	}
+
+	while (fscanf(fp, "%16s %16s %c %*s\n", addr_str, size_str, &type) == 3) {
+		uint64_t addr;
+		uint64_t size;
+
+		/* Only care about functions */
+		if (type != 't' && type != 'T')
+			continue;
hi,
I think we need the 'W' check in here [1]

jirka


[1] https://lore.kernel.org/bpf/20250103071409.47db1479@batman.local.home/ (local)
Thread (9 messages) 9 messages, 2 authors, last reply 2025-02-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help