summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Caruso <ejcaruso@chromium.org>2015-05-27 10:13:37 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-02 01:02:58 +0000
commit35e37cdf432c3c6260779dcb6222060db178b971 (patch)
tree409c1fc7e11532fa09a5ab0eb7f75b8ce99bf98f /include
parent2b56419578e9780b99a9bb371d665958a7edca65 (diff)
downloadchrome-ec-35e37cdf432c3c6260779dcb6222060db178b971.tar.gz
uart_buffering: extend CONSOLE_READ command for easy log concatenationstabilize-7134.B
I'm planning to add functionality to the kernel which periodically dumps the EC console log and concatenates it so we can use it in bug reports and feedback. However, stitching together logs collected using the existing SNAPSHOT/READ commands is difficult. This adds a new version of READ which acts mostly the same but will only give you the difference between the two most recent snapshots when you pass the corresponding argument. BRANCH=ToT BUG=chromium:492721 TEST=On samus with kernel interface, cat /sys/kernel/debug/cros_ec/console_log and verify that the most recent bit of the log is printed, use spammy commands like 'accelinfo on' and make sure nothing breaks, check that 'ectool console' behavior has not changed Change-Id: Ib8216caa917715820c3e265400f0db2125e8808b Signed-off-by: Eric Caruso <ejcaruso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/273581 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/ec_commands.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index c1b5637af6..fbae48cb49 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -2409,13 +2409,28 @@ struct ec_params_charge_control {
#define EC_CMD_CONSOLE_SNAPSHOT 0x97
/*
- * Read next chunk of data from saved snapshot.
+ * Read data from the saved snapshot. If the subcmd parameter is
+ * CONSOLE_READ_NEXT, this will return data starting from the beginning of
+ * the latest snapshot. If it is CONSOLE_READ_RECENT, it will start from the
+ * end of the previous snapshot.
+ *
+ * The params are only looked at in version >= 1 of this command. Prior
+ * versions will just default to CONSOLE_READ_NEXT behavior.
*
* Response is null-terminated string. Empty string, if there is no more
* remaining output.
*/
#define EC_CMD_CONSOLE_READ 0x98
+enum ec_console_read_subcmd {
+ CONSOLE_READ_NEXT = 0,
+ CONSOLE_READ_RECENT
+};
+
+struct ec_params_console_read_v1 {
+ uint8_t subcmd; /* enum ec_console_read_subcmd */
+} __packed;
+
/*****************************************************************************/
/*