[PATCH] libtraceevent: Warn when kallsyms exits due to parsing error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

If the kallsyms has a corrupted line, it will exit the parsing. This can
be confusing to users that expect to see function address converted into
names.

Add a tep_warning() when this happens. At least the library will warn
about it (although trace-cmd requires --verbose to see it).

Link: https://lore.kernel.org/all/355D2478-33D3-4046-8422-E512F42C51BC@xxxxxxxxxx/

Reported-by: Chuck Lever III <chuck.lever@xxxxxxxxxx>
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
 src/event-parse.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/event-parse.c b/src/event-parse.c
index 4bbf29727e9f..823333a3bde4 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -739,8 +739,11 @@ int tep_parse_kallsyms(struct tep_handle *tep, const char *kallsyms)
 		if (errno)
 			goto out;
 
-		if (n != 2 || !func_end)
+		if (n != 2 || !func_end) {
+			tep_warning("Failed to parse kallsyms n=%d func_end=%d",
+				    n, func_end);
 			goto out;
+		}
 
 		func = line + func_start;
 		/*
-- 
2.35.1




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux