[PATCH 11/14] trace: Update trace-format generator for newer version

Simon Glass sjg at chromium.org
Thu Dec 22 00:08:25 CET 2022


This now includes flags and the layout has changed slightly in recent
versions of Linux. Update the generator accordingly.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 tools/proftool.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/tools/proftool.c b/tools/proftool.c
index 0ba84d30c19..b66ea556486 100644
--- a/tools/proftool.c
+++ b/tools/proftool.c
@@ -163,7 +163,7 @@ static int read_data(FILE *fin, void *buff, int size)
 	if (!err)
 		return 1;
 	if (err != size) {
-		error("Cannot read profile file at pos %ld\n", ftell(fin));
+		error("Cannot read profile file at pos %lx\n", ftell(fin));
 		return -1;
 	}
 	return 0;
@@ -496,10 +496,17 @@ static int make_ftrace(void)
 	int missing_count = 0, skip_count = 0;
 	int i;
 
-	printf("# tracer: ftrace\n"
-		"#\n"
-		"#           TASK-PID   CPU#    TIMESTAMP  FUNCTION\n"
-		"#              | |      |          |         |\n");
+	printf("# tracer: function\n"
+	      "#\n"
+	      "# entries-in-buffer/entries-written: 140080/250280   #P:4\n"
+	      "#\n"
+	      "#                              _-----=> irqs-off\n"
+	      "#                             / _----=> need-resched\n"
+	      "#                            | / _---=> hardirq/softirq\n"
+	      "#                            || / _--=> preempt-depth\n"
+	      "#                            ||| /     delay\n"
+	      "#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION\n"
+	      "#              | |       |   ||||       |         |\n");
 	for (i = 0, call = call_list; i < call_count; i++, call++) {
 		struct func_info *func = find_func_by_offset(call->func);
 		ulong time = call->flags & FUNCF_TIMESTAMP_MASK;
@@ -521,7 +528,7 @@ static int make_ftrace(void)
 			continue;
 		}
 
-		printf("%16s-%-5d [01] %lu.%06lu: ", "uboot", 1,
+		printf("%16s-%-5d [000] ....  %lu.%06lu: ", "uboot", 1,
 		       time / 1000000, time % 1000000);
 
 		out_func(call->func, 0, " <- ");
-- 
2.39.0.314.g84b9a713c41-goog



More information about the U-Boot mailing list