Change in flashrom[master]: cli_classic.c: Add runtime measurement
Simon Buhrow has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/47805 ) Change subject: cli_classic.c: Add runtime measurement ...................................................................... cli_classic.c: Add runtime measurement To get an fast and easy feedback on how parameters effect runtime (e.g. clock setting, polling delays, ...). Signed-off-by: Simon Buhrow <simon.buhrow@posteo.de> Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 --- M cli_classic.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/05/47805/1 diff --git a/cli_classic.c b/cli_classic.c index ae7f6ef..0d5381f 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -24,6 +24,7 @@ #include <string.h> #include <stdlib.h> #include <getopt.h> +#include <time.h> #include "flash.h" #include "flashchips.h" #include "fmap.h" @@ -142,6 +143,7 @@ /* Probe for up to eight flash chips. */ struct flashctx flashes[8] = {{0}}; struct flashctx *fill_flash; + struct timespec time_start, time_end; const char *name; int namelen, opt, i, j; int startchip = -1, chipcount = 0, option_index = 0, force = 0, ifd = 0, fmap = 0; @@ -528,6 +530,8 @@ /* FIXME: Delay calibration should happen in programmer code. */ myusec_calibrate_delay(); + timespec_get(&time_start, TIME_UTC); + if (programmer_init(prog, pparam)) { msg_perr("Error: Programmer initialization failed.\n"); ret = 1; @@ -806,6 +810,9 @@ for (i = 0; i < chipcount; i++) free(flashes[i].chip); + timespec_get(&time_end, TIME_UTC); + msg_gdbg("Runtime: %d:%2d min:s\n", (int)((time_end.tv_sec-time_start.tv_sec) / 60), (int)(time_end.tv_sec-time_start.tv_sec) % 60); + layout_cleanup(&include_args); free(filename); free(fmapfile); -- To view, visit https://review.coreboot.org/c/flashrom/+/47805 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 1 Gerrit-Owner: Simon Buhrow Gerrit-MessageType: newchange
Hello build bot (Jenkins), I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/flashrom/+/47805 to look at the new patch set (#2). Change subject: cli_classic.c: Add runtime measurement ...................................................................... cli_classic.c: Add runtime measurement To get an fast and easy feedback on how parameters effect runtime (e.g. clock setting, polling delays, ...). Signed-off-by: Simon Buhrow <simon.buhrow@posteo.de> Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 --- M cli_classic.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/05/47805/2 -- To view, visit https://review.coreboot.org/c/flashrom/+/47805 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 2 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-MessageType: newpatchset
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/47805 ) Change subject: cli_classic.c: Add runtime measurement ...................................................................... Patch Set 2: (2 comments) https://review.coreboot.org/c/flashrom/+/47805/2//COMMIT_MSG Commit Message: https://review.coreboot.org/c/flashrom/+/47805/2//COMMIT_MSG@9 PS2, Line 9: effect affect https://review.coreboot.org/c/flashrom/+/47805/2//COMMIT_MSG@9 PS2, Line 9: an fast a fast -- To view, visit https://review.coreboot.org/c/flashrom/+/47805 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 2 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-Comment-Date: Fri, 20 Nov 2020 13:10:33 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Idwer Vollering has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/47805 ) Change subject: cli_classic.c: Add runtime measurement ...................................................................... Patch Set 2: Code-Review+1 [x] Build and runtime tested on Freebsd The formatting could be optimized to be parseable, though. -- To view, visit https://review.coreboot.org/c/flashrom/+/47805 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 2 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-Comment-Date: Sat, 21 Nov 2020 13:53:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Hello build bot (Jenkins), Idwer Vollering, I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/flashrom/+/47805 to look at the new patch set (#3). Change subject: cli_classic.c: Add runtime measurement ...................................................................... cli_classic.c: Add runtime measurement To get a fast and easy feedback on how parameters affect runtime (e.g. clock setting, polling delays, ...). Signed-off-by: Simon Buhrow <simon.buhrow@posteo.de> Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 --- M cli_classic.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/05/47805/3 -- To view, visit https://review.coreboot.org/c/flashrom/+/47805 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 3 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-MessageType: newpatchset
Simon Buhrow has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/47805 ) Change subject: cli_classic.c: Add runtime measurement ...................................................................... Patch Set 3:
Patch Set 2: Code-Review+1
[x] Build and runtime tested on Freebsd The formatting could be optimized to be parseable, though.
Thanks for your feedback! Which format do you prefer? I just chose any. -- To view, visit https://review.coreboot.org/c/flashrom/+/47805 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 3 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-Comment-Date: Mon, 23 Nov 2020 08:09:26 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
Attention is currently required from: Simon Buhrow. Anastasia Klimchuk has uploaded a new patch set (#4) to the change originally created by Simon Buhrow. ( https://review.coreboot.org/c/flashrom/+/47805?usp=email ) Change subject: cli_classic.c: Print runtime measurement in seconds in debug ...................................................................... cli_classic.c: Print runtime measurement in seconds in debug To get a fast and easy feedback on how parameters affect runtime (e.g. clock setting, polling delays, etc). The runtime is measured starting from programmer_init and to programmer_shutdown, inclusive. Message is displayed in debug verbosity level. Signed-off-by: Simon Buhrow <simon.buhrow@posteo.de> Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Co-Developed-by: Anastasia Klimchuk <aklm@flashrom.org> --- M cli_classic.c 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/05/47805/4 -- To view, visit https://review.coreboot.org/c/flashrom/+/47805?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: flashrom Gerrit-Branch: main Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 4 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-CC: Stefan Reinauer <stefan.reinauer@coreboot.org> Gerrit-Attention: Simon Buhrow
Attention is currently required from: Simon Buhrow. Anastasia Klimchuk has uploaded a new patch set (#5) to the change originally created by Simon Buhrow. ( https://review.coreboot.org/c/flashrom/+/47805?usp=email ) Change subject: cli_classic.c: Print runtime measurement in seconds in debug ...................................................................... cli_classic.c: Print runtime measurement in seconds in debug To get a fast and easy feedback on how parameters affect runtime (e.g. clock setting, polling delays, etc). The runtime is measured starting from programmer_init and to programmer_shutdown, inclusive. Message is displayed in debug verbosity level. Signed-off-by: Simon Buhrow <simon.buhrow@posteo.de> Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Co-Developed-by: Anastasia Klimchuk <aklm@flashrom.org> --- M cli_classic.c 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/05/47805/5 -- To view, visit https://review.coreboot.org/c/flashrom/+/47805?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: flashrom Gerrit-Branch: main Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 5 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-CC: Stefan Reinauer <stefan.reinauer@coreboot.org> Gerrit-Attention: Simon Buhrow
Attention is currently required from: Paul Menzel, Simon Buhrow. Anastasia Klimchuk has posted comments on this change by Simon Buhrow. ( https://review.coreboot.org/c/flashrom/+/47805?usp=email ) Change subject: cli_classic.c: Print runtime measurement in seconds in debug ...................................................................... Patch Set 5: (2 comments) Commit Message: https://review.coreboot.org/c/flashrom/+/47805/comment/a7553819_00a0de15?usp... : PS2, Line 9: effect
affect Done
https://review.coreboot.org/c/flashrom/+/47805/comment/79d67faf_b67733b5?usp... : PS2, Line 9: an fast
a fast Done
-- To view, visit https://review.coreboot.org/c/flashrom/+/47805?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: flashrom Gerrit-Branch: main Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 5 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Anastasia Klimchuk <aklm@chromium.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-CC: Stefan Reinauer <stefan.reinauer@coreboot.org> Gerrit-Attention: Simon Buhrow Gerrit-Attention: Paul Menzel <paulepanter@mailbox.org> Gerrit-Comment-Date: Thu, 14 Aug 2025 08:33:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Paul Menzel <paulepanter@mailbox.org>
Attention is currently required from: Paul Menzel, Simon Buhrow, Stefan Reinauer. Anastasia Klimchuk has posted comments on this change by Simon Buhrow. ( https://review.coreboot.org/c/flashrom/+/47805?usp=email ) Change subject: cli_classic.c: Print runtime measurement in seconds in debug ...................................................................... Patch Set 5: (1 comment) Patchset: PS5: I came by this old patch and it looks useful, so I decided to finish it. I rebased, updated commit message with more details, and updated the message printed, which is now (example):
Runtime from programmer init to shutdown: 4min44sec
Simon, Idwer, if you are still around you are welcome to comment. -- To view, visit https://review.coreboot.org/c/flashrom/+/47805?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: flashrom Gerrit-Branch: main Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 5 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Anastasia Klimchuk <aklm@chromium.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-Attention: Simon Buhrow Gerrit-Attention: Stefan Reinauer <stefan.reinauer@coreboot.org> Gerrit-Attention: Paul Menzel <paulepanter@mailbox.org> Gerrit-Comment-Date: Thu, 14 Aug 2025 08:43:35 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
Attention is currently required from: Anastasia Klimchuk, Paul Menzel, Simon Buhrow. Stefan Reinauer has posted comments on this change by Simon Buhrow. ( https://review.coreboot.org/c/flashrom/+/47805?usp=email ) Change subject: cli_classic.c: Print runtime measurement in seconds in debug ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://review.coreboot.org/c/flashrom/+/47805?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: flashrom Gerrit-Branch: main Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 5 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Anastasia Klimchuk <aklm@chromium.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-Attention: Simon Buhrow Gerrit-Attention: Paul Menzel <paulepanter@mailbox.org> Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org> Gerrit-Comment-Date: Sun, 17 Aug 2025 01:23:04 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/47805?usp=email ) Change subject: cli_classic.c: Print runtime measurement in seconds in debug ...................................................................... cli_classic.c: Print runtime measurement in seconds in debug To get a fast and easy feedback on how parameters affect runtime (e.g. clock setting, polling delays, etc). The runtime is measured starting from programmer_init and to programmer_shutdown, inclusive. Message is displayed in debug verbosity level. Signed-off-by: Simon Buhrow <simon.buhrow@posteo.de> Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Co-Developed-by: Anastasia Klimchuk <aklm@flashrom.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/47805 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> --- M cli_classic.c 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: build bot (Jenkins): Verified Stefan Reinauer: Looks good to me, approved diff --git a/cli_classic.c b/cli_classic.c index a9f9dc1..0f303c0 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -27,6 +27,7 @@ #include <stdint.h> #include <cli_getopt.h> #include <cli_output.h> +#include <time.h> #include "flash.h" #include "flashchips.h" #include "fmap.h" @@ -1049,6 +1050,7 @@ int ret = 0; int all_matched_count = 0; const char **all_matched_names = NULL; + time_t time_start, time_end; struct cli_options options = { 0 }; static const char optstring[] = "r::Rw::v::nNVEfc:l:i:p:Lzho:x"; @@ -1196,6 +1198,8 @@ if (flashrom_init(1)) exit(1); + time(&time_start); + if (programmer_init(options.prog, options.pparam)) { msg_perr("Error: Programmer initialization failed.\n"); ret = 1; @@ -1536,6 +1540,11 @@ flashrom_data_free(all_matched_names); free_options(&options); + + time(&time_end); + msg_gdbg("Runtime from programmer init to shutdown: %dmin%2dsec\n", + (int)(difftime(time_end, time_start) / 60), (int)(difftime(time_end, time_start)) % 60); + ret |= close_logfile(); return ret; } -- To view, visit https://review.coreboot.org/c/flashrom/+/47805?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: flashrom Gerrit-Branch: main Gerrit-Change-Id: I2238b3f3e6c2ab7745994662a88787fa2e86d480 Gerrit-Change-Number: 47805 Gerrit-PatchSet: 6 Gerrit-Owner: Simon Buhrow Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org> Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com> Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
participants (5)
-
Anastasia Klimchuk (Code Review) -
Idwer Vollering (Code Review) -
Paul Menzel (Code Review) -
Simon Buhrow (Code Review) -
Stefan Reinauer (Code Review)