summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2010-09-06 12:56:31 +0200
committerMichael BRANDT <michael.brandt@stericsson.com>2010-09-16 15:22:47 +0200
commite8c699eb1f7a50b4f10024c41b8c86f907233f8d (patch)
treef62d922897024c83990e54398c05a1531d1bf786 /common
parentf1f51a277554486f3f46e9a4c16e9a2c78e730de (diff)
boottime: Enable boot time measurements.
This patch enables boot time measurements for u-boot. It also includes minor updates as well. Change-Id: I993c9ad4fa5dab62df2c0a88454a7546d9565d21 Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/4610 Reviewed-by: Robert ROSENGREN <robert.rosengren@stericsson.com> Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
Diffstat (limited to 'common')
-rwxr-xr-xcommon/Makefile2
-rw-r--r--common/boottime.c56
2 files changed, 51 insertions, 7 deletions
diff --git a/common/Makefile b/common/Makefile
index c82f08122..3824d3e56 100755
--- a/common/Makefile
+++ b/common/Makefile
@@ -166,7 +166,7 @@ COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
COBJS-$(CONFIG_UPDATE_TFTP) += update.o
COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
-COBJS-$(CONFIG_BOOTTIME) += boottime.o
+COBJS-y += boottime.o
COBJS := $(sort $(COBJS-y))
SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/common/boottime.c b/common/boottime.c
index 8381ad249..87be46762 100644
--- a/common/boottime.c
+++ b/common/boottime.c
@@ -23,6 +23,8 @@
#include <asm/byteorder.h>
#include <asm/setup.h>
+#ifdef CONFIG_BOOTTIME
+
static struct tag_boottime boottime = {
.idle = 0,
.total = 0,
@@ -67,12 +69,6 @@ unsigned long boottime_idle_get(void)
return boottime.idle;
}
-void boottime_remove_last(void)
-{
- if (boottime.num > 0)
- boottime.num--;
-}
-
static int do_boottime(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
unsigned int i;
@@ -91,6 +87,18 @@ static int do_boottime(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
+static int do_boottime_tag (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+
+ if (argc < 2) {
+ cmd_usage(cmdtp);
+ return 1;
+ }
+ boottime_tag(argv[1]);
+
+ return 0;
+}
+
U_BOOT_CMD(
boottime, 1, 1, do_boottime,
"print boottime info",
@@ -98,5 +106,41 @@ U_BOOT_CMD(
" - print boottime tags\n"
);
+U_BOOT_CMD(
+ boottime_tag, 2, 1, do_boottime_tag,
+ "boottime tag 'name'",
+ ""
+ " - Add a boottime tag at the current time\n"
+);
+
+#else
+/*
+ * Dummy functions when boottime is not enabled.
+ */
+static int do_boottime_tag (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+ return 0;
+}
+
+void boottime_tag(char *name)
+{
+
+}
+
+void boottime_idle_add(unsigned long time)
+{
+
+}
+
+U_BOOT_CMD(
+ boottime_tag, 2, 1, do_boottime_tag,
+ "boottime tag 'name'",
+ ""
+ " - NOT ENABLED: Add CONFIG_BOOTIME to your boards configuration"
+ " file to enable boottime.\n"
+);
+
+#endif
+