Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7124
-gerrit
commit 5dd1c8e079c46e482eedc59b0fea9874b4b6a5f9
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Sat Oct 18 16:18:53 2014 +0200
util/board_status/board_status.sh: Also try to use `util/cbfstool/cbfstool`
The user should not be forced to build an image to run `board_status.sh`
on a board running coreboot.
Change-Id: Ia1ebcb3fc9cbe23614353fe784c9308620721aed
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/board_status/board_status.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index f6e10ff..24beab0 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -216,7 +216,10 @@ tmpdir=$(mktemp -d --tmpdir coreboot_board_status.XXXXXXXX)
# Obtain board and revision info to form the directory structure:
# <vendor>/<board>/<revision>/<timestamp>
cbfstool_cmd="build/cbfstool"
-test_cmd $LOCAL "$cbfstool_cmd"
+if [ test_cmd $LOCAL "$cbfstool_cmd" $NONFATAL -eq 1 ]; then
+ cbfstool_cmd="util/cbfstool/cbfstool"
+ test_cmd $LOCAL "$cbfstool_cmd"
+fi
$cbfstool_cmd build/coreboot.rom extract -n config -f ${tmpdir}/config.txt
$cbfstool_cmd build/coreboot.rom print > ${tmpdir}/cbfs.txt
mainboard_dir="$(grep CONFIG_MAINBOARD_DIR ${tmpdir}/config.txt | awk -F '"' '{ print $2 }')"
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7124
-gerrit
commit c8dcf1d8285697700e41c72f7c2502a566546f0d
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Sat Oct 18 16:18:53 2014 +0200
util/board_status/board_status.sh: Also test for `util/cbfstool/cbfstool`
The user should not be forced to build an image to run `board_status.sh`
on a board running coreboot.
Change-Id: Ia1ebcb3fc9cbe23614353fe784c9308620721aed
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/board_status/board_status.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index f6e10ff..bd283c9 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -216,7 +216,9 @@ tmpdir=$(mktemp -d --tmpdir coreboot_board_status.XXXXXXXX)
# Obtain board and revision info to form the directory structure:
# <vendor>/<board>/<revision>/<timestamp>
cbfstool_cmd="build/cbfstool"
-test_cmd $LOCAL "$cbfstool_cmd"
+if [ test_cmd $LOCAL "$cbfstool_cmd" 1 -eq 1 ]; then
+ cbfstool_cmd="util/cbfstool/cbfstool"
+fi
$cbfstool_cmd build/coreboot.rom extract -n config -f ${tmpdir}/config.txt
$cbfstool_cmd build/coreboot.rom print > ${tmpdir}/cbfs.txt
mainboard_dir="$(grep CONFIG_MAINBOARD_DIR ${tmpdir}/config.txt | awk -F '"' '{ print $2 }')"
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7123
-gerrit
commit ffabc35e4cd13636496b91a63506c4ae31d152e5
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Sat Oct 18 14:37:41 2014 +0200
util/board_status/board_status.sh: Do not build `cbfstool`
Since commit b37ee1ee (util/board_status: use the right location of
cbfstool) [1] `board_status.sh` builds `cbfstool` if it is not found in
`build/cbfstool`. Currently this does not work, when the directory
`build/` does not exist.
The more important problem is, that the script `board_status.sh` is
normally run as root. This causes root to run `make -C util/cbfstool/`
causing problems later on, when the user with normal rights wants to
build coreboot and `build/cbfstool` needs to be overriden or when the
user wants to build cbfstool in `util/cbfstool`.
So the only reasonable thing to do is to error out in case the utility
is not found and let the user resolve it.
[1] http://review.coreboot.org/6299
Change-Id: I4c4a285bf4d08c48e59030fd476c3a7e5c3678e6
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/board_status/board_status.sh | 3 ---
1 file changed, 3 deletions(-)
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index 49d2c73..f6e10ff 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -216,9 +216,6 @@ tmpdir=$(mktemp -d --tmpdir coreboot_board_status.XXXXXXXX)
# Obtain board and revision info to form the directory structure:
# <vendor>/<board>/<revision>/<timestamp>
cbfstool_cmd="build/cbfstool"
-if test ! -x build/cbfstool; then
- make -C util/cbfstool/ && cp util/cbfstool/cbfstool build/cbfstool
-fi
test_cmd $LOCAL "$cbfstool_cmd"
$cbfstool_cmd build/coreboot.rom extract -n config -f ${tmpdir}/config.txt
$cbfstool_cmd build/coreboot.rom print > ${tmpdir}/cbfs.txt
the following patch was just integrated into master:
commit 1ab4495204b5bfe145edb5f1d0cac0a7017d79f0
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Mon Sep 29 19:40:51 2014 +0200
intel/i82801bx: Minor log fixes in IDE driver
Two issues:
1. without config, there were two NULL derefs
2. output for "Secondary" looked at ide0_enable
Change-Id: I34ddbc0f9b27226981ccbc237e3d59e522076d55
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/6989
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
See http://review.coreboot.org/6989 for details.
-gerrit
the following patch was just integrated into master:
commit 667c7a3b23e154254a4b91286cbb0f6aedf4c410
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Mon Sep 29 10:12:29 2014 +0200
util/fletcher: fix debug option parsing
sizeof(char[]-type+1) isn't very useful. Since one of
the strings is constant, we also don't need to use
strncmp that string's length. While at it, str*cmp don't
return booleans, so check for value instead of faux bools.
Change-Id: Iebb194a60eac454dafeade75f135df92068cf4ab
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/6988
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
See http://review.coreboot.org/6988 for details.
-gerrit
the following patch was just integrated into master:
commit 02802dfa5a7dcc4b848e52123efaf3da2a17b295
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat Oct 18 11:57:11 2014 +0200
abuild: skip boards for which we lack a cross compiler
We don't support them, they won't ever pass the build test,
so no need to report an error.
Change-Id: I2409a79f3c0d66a79b0e065e6b9ebf62d0359b3e
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/7121
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
See http://review.coreboot.org/7121 for details.
-gerrit
the following patch was just integrated into master:
commit 0a76bccc947b4d1de0a87cf3a19efd79fce22d3c
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat Oct 18 11:32:18 2014 +0200
abuild: don't track architecture
This didn't work for a while, and we don't _really_ need it.
Change-Id: I952243f30e985e7577cd511f40957066db6dd3c5
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/7120
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
See http://review.coreboot.org/7120 for details.
-gerrit
the following patch was just integrated into master:
commit f0bd87153139e92fbcfa76b8fcab4558ce3cd52e
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Mon Sep 29 20:23:29 2014 +0200
various AMD boards: fix buffer overflow
"AMD\t " isn't 8 characters long.
Change-Id: I47b2a39d7dca0201b7ee5dfd1f77e0714411257c
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/6991
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Reviewed-by: Jens Rottmann <JRottmann(a)LiPPERTembedded.de>
See http://review.coreboot.org/6991 for details.
-gerrit
the following patch was just integrated into master:
commit 96990a285d775520c6279603371a1394bcdd8cd3
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Mon Sep 29 10:08:35 2014 +0200
cbfstool: free memory
Change-Id: Ic53127a61154460fa3741a92a3b2de0eba446e9f
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/6987
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
See http://review.coreboot.org/6987 for details.
-gerrit
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7116
-gerrit
commit 7ddb649d4a424165fae8e29d2ff9eb446ed33f1c
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Sat Oct 18 06:09:24 2014 +0000
Poor man's ftrace from akaros
This is the
poor man's ftrace from Akaros
(just search for that term)
To use:
suppose you want to trace all file entry and exit in some piece of code, e.g.
cbfs.
Just:
spatch --in-place --sp-file scripts/spatch/poor-ftrace.coci src/lib/cbfs*.c
Build as usual.
When you run, you'll see function calls, and they will be spaced in
according to their call depth, e.g.:
a
b
c
b
d
b
a
Sadly, in pre-ram stage, this indenting is not possible.
Instead, we print ENTER on entry and EXIT on exit.
It's usable.
It's incredibly useful for debugging. We have been able to very quickly zero in on
bugs in Akaros with this code. I print at BIOS_EMERG so you're sure
to take it out when done (just git checkout the files you're tracing or
reverse the spatch.)
For example, on riscv, I know it's dying, I don't know where.
spatch --sp-file util/spatch/poor-ftrace.cocci src/arch/riscv/*.c src/lib/cbfs.c
I get this:
Find fallback
cbfs_load_stage() in src/lib/cbfs.c
init_default_cbfs_media() in src/arch/riscv/rom_media.c
---- init_default_cbfs_media()
init_rom_media_cbfs() in src/arch/riscv/rom_media.c
And I know where to start.
You do need spatch installed.
Change-Id: I69c3c20d30ebd666c0e859cea906a3fd5a094441
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/console/printk.c | 42 ++++++++++++++++++++++++++++++++++++++++++
src/include/console/console.h | 6 ++++++
util/spatch/poor-ftrace.cocci | 18 ++++++++++++++++++
3 files changed, 66 insertions(+)
diff --git a/src/console/printk.c b/src/console/printk.c
index b6777e1..4597007 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -12,6 +12,7 @@
#include <smp/node.h>
#include <stddef.h>
#include <trace.h>
+#include <stdlib.h>
DECLARE_SPIN_LOCK(console_lock)
@@ -62,3 +63,44 @@ void do_vtxprintf(const char *fmt, va_list args)
console_tx_flush();
}
#endif /* CONFIG_CHROMEOS */
+
+#ifdef __PRE_RAM__
+/* sadly, pretty printing the call depth in pre-ram is not an option. How sad! */
+
+void __print_func_entry(const char *func, const char *file)
+{
+ printk(BIOS_EMERG, "ENTER %s() in %s\n", func, file);
+}
+/* for tracing. You can call these on func entry and exit.
+ * Or, better, you can use the spatch in utils to add
+ * such tracing.
+ */
+void __print_func_exit(const char *func, const char *file)
+{
+ printk(BIOS_EMERG, "EXIT ---- %s()\n", func);
+}
+
+#else
+int tab_depth = 0;
+
+void __print_func_entry(const char *func, const char *file)
+{
+ char tentabs[] = "\t\t\t\t\t\t\t\t\t\t"; // ten tabs and a \0
+ char *ourtabs = &tentabs[10 - MIN(tab_depth, 10)];
+ printk(BIOS_EMERG, "%s%s() in %s\n", ourtabs, func, file);
+ tab_depth++;
+}
+/* for tracing. You can call these on func entry and exit.
+ * Or, better, you can use the spatch in utils to add
+ * such tracing.
+ */
+void __print_func_exit(const char *func, const char *file)
+{
+ char tentabs[] = "\t\t\t\t\t\t\t\t\t\t"; // ten tabs and a \0
+ char *ourtabs;
+ tab_depth--;
+ ourtabs = &tentabs[10 - MIN(tab_depth, 10)];
+ printk(BIOS_EMERG, "%s---- %s()\n", ourtabs, func);
+}
+
+#endif
diff --git a/src/include/console/console.h b/src/include/console/console.h
index 9e98bfc..d5ec2f3 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -75,6 +75,12 @@ static inline void do_vtxprintf(const char *fmt, va_list args) {};
*/
#include <console/early_print.h>
+/* for the poor man's ftrace. */
+void __print_func_entry(const char *func, const char *file);
+void __print_func_exit(const char *func, const char *file);
+#define print_func_entry() __print_func_entry(__FUNCTION__, __FILE__)
+#define print_func_exit() __print_func_exit(__FUNCTION__, __FILE__)
+
#else /* __ROMCC__ */
#include "arch/x86/lib/romcc_console.c"
diff --git a/util/spatch/poor-ftrace.cocci b/util/spatch/poor-ftrace.cocci
new file mode 100644
index 0000000..3754374
--- /dev/null
+++ b/util/spatch/poor-ftrace.cocci
@@ -0,0 +1,18 @@
+// prints entry/exit when entering/leaving a function
+
+// for example, spatch with:
+// $ for i in kern/src/ns/ kern/src/net kern/drivers/; do \
+// spatch --sp-file scripts/spatch/poor-ftrace.cocci --in-place $i; done
+// if you have functions you want to ignore, add them to the blacklist in
+// kern/src/kdebug.c
+@@
+type t;
+function f;
+@@
+t f(...) {
++print_func_entry();
+<...
++print_func_exit();
+return ...;
+...>
+}