summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Granaghan <granaghan@google.com>2023-04-06 14:10:48 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-27 21:40:41 +0000
commita7ba09cac5b80db2a2ee8bd43959689dd7c9adac (patch)
treef6e0b1b61ad8b06686e2581ae55024ecd4ff72e1
parente39aef2bffc159aed7ef6ea8ada7a494d5e16de2 (diff)
downloadchrome-ec-a7ba09cac5b80db2a2ee8bd43959689dd7c9adac.tar.gz
gsctool: Remove crash id parameter from GetCrashLog.
BUG=b:265310865 TEST=gsctool -aD --clog Change-Id: Ifaeb6fcf97257bf525c0ad2ec84281f1d5718c24 Signed-off-by: Brian Granaghan <granaghan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4409005 Reviewed-by: Mary Ruthven <mruthven@chromium.org> (cherry picked from commit d4fe1af41527679a883d30c86a977730d090fe81) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4482198 Commit-Queue: Mary Ruthven <mruthven@chromium.org> Auto-Submit: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index bfe02915fb..da668fec8a 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -522,8 +522,8 @@ static const struct option_container cmd_line_options[] = {
"Report this utility version"},
{{"wp", optional_argument, NULL, 'w'},
"[enable] Get the current WP setting or enable WP"},
- {{"clog", required_argument, NULL, 'x'},
- "[id]%Retrieve contents of the crash log with id <id>"},
+ {{"clog", no_argument, NULL, 'x'},
+ "Retrieve contents of the most recent crash log."},
{{"reboot", optional_argument, NULL, 'z'},
"Tell the GSC to reboot with an optional reset timeout parameter "
"in milliseconds"},
@@ -3906,15 +3906,14 @@ static int getopt_all(int argc, char *argv[])
return i;
}
-static int get_crashlog(struct transfer_descriptor *td, uint32_t id)
+static int get_crashlog(struct transfer_descriptor *td)
{
- uint32_t id_be = htobe32(id);
uint32_t rv;
uint8_t response[2048] = {0};
size_t response_size = sizeof(response);
- rv = send_vendor_command(td, VENDOR_CC_GET_CRASHLOG, &id_be,
- sizeof(id_be), response, &response_size);
+ rv = send_vendor_command(td, VENDOR_CC_GET_CRASHLOG, NULL, 0, response,
+ &response_size);
if (rv != VENDOR_RC_SUCCESS) {
printf("Get crash log failed. (%X)\n", rv);
return 1;
@@ -4010,7 +4009,6 @@ int main(int argc, char *argv[])
bool reboot_gsc = false;
size_t reboot_gsc_timeout = 0;
int get_clog = 0;
- uint32_t clog_id = 0;
int get_console = 0;
/*
@@ -4244,7 +4242,6 @@ int main(int argc, char *argv[])
break;
case 'x':
get_clog = 1;
- clog_id = strtoul(optarg, NULL, 0);
break;
case 'z':
reboot_gsc = true;
@@ -4459,7 +4456,7 @@ int main(int argc, char *argv[])
exit(process_reboot_gsc(&td, reboot_gsc_timeout));
if (get_clog)
- exit(get_crashlog(&td, clog_id));
+ exit(get_crashlog(&td));
if (get_console)
exit(get_console_logs(&td));