aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorRamon Fried <ramon.fried@gmail.com>2018-06-08 20:53:27 +0300
committerTom Rini <trini@konsulko.com>2018-06-18 14:02:04 -0400
commite0212dfa1353310ab903263f8c737b8fb40b4fff (patch)
treec149ff63395e448d8939f76ac3beb3ce43cec55e /cmd
parent501c89d33011e584b23e8e204e324512b4065948 (diff)
downloadu-boot-midas-e0212dfa1353310ab903263f8c737b8fb40b4fff.tar.gz
u-boot-midas-e0212dfa1353310ab903263f8c737b8fb40b4fff.tar.bz2
u-boot-midas-e0212dfa1353310ab903263f8c737b8fb40b4fff.zip
iotrace: fix behaviour when buffer is full
Don't continue updating the offset when buffer is full. When the buffer size exhausts and there's no space left to write warn the user and update only the needed size and not both the offset and needed size. Add needed buffer size information in the iotrace command. Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/iotrace.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd/iotrace.c b/cmd/iotrace.c
index f8ce3398af..fa6c68b198 100644
--- a/cmd/iotrace.c
+++ b/cmd/iotrace.c
@@ -9,12 +9,13 @@
static void do_print_stats(void)
{
- ulong start, size, offset, count;
+ ulong start, size, needed_size, offset, count;
printf("iotrace is %sabled\n", iotrace_get_enabled() ? "en" : "dis");
- iotrace_get_buffer(&start, &size, &offset, &count);
+ iotrace_get_buffer(&start, &size, &needed_size, &offset, &count);
printf("Start: %08lx\n", start);
- printf("Size: %08lx\n", size);
+ printf("Actual Size: %08lx\n", size);
+ printf("Needed Size: %08lx\n", needed_size);
iotrace_get_region(&start, &size);
printf("Region: %08lx\n", start);
printf("Size: %08lx\n", size);
@@ -26,11 +27,11 @@ static void do_print_stats(void)
static void do_print_trace(void)
{
- ulong start, size, offset, count;
+ ulong start, size, needed_size, offset, count;
struct iotrace_record *cur_record;
- iotrace_get_buffer(&start, &size, &offset, &count);
+ iotrace_get_buffer(&start, &size, &needed_size, &offset, &count);
if (!start || !size || !count)
return;