From patchwork Tue Jun 18 10:29:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Buhrow, Simon" X-Patchwork-Id: 1117780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=coreboot.org (client-ip=78.46.105.101; helo=coreboot.org; envelope-from=flashrom-bounces@flashrom.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sieb-meyer.de Received: from coreboot.org (coreboot.org [78.46.105.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Skpc5nWfz9sBr for ; Tue, 18 Jun 2019 20:29:27 +1000 (AEST) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id 6DB39BA3ACD; Tue, 18 Jun 2019 10:29:20 +0000 (UTC) Received: from mail.sieb-meyer.de (mail.sieb-meyer.de [213.252.170.194]) by coreboot.org (Postfix) with ESMTP id 6A400BA3ACB for ; Tue, 18 Jun 2019 10:29:06 +0000 (UTC) Received: from smexchange.siebmeyer.org (172.16.1.201) by smexchange.siebmeyer.org (172.16.1.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1034.26; Tue, 18 Jun 2019 12:29:05 +0200 Received: from smexchange.siebmeyer.org ([fe80::703c:132:1215:2382]) by smexchange.siebmeyer.org ([fe80::703c:132:1215:2382%4]) with mapi id 15.01.1034.026; Tue, 18 Jun 2019 12:29:05 +0200 From: "Buhrow, Simon" To: "flashrom@flashrom.org" Thread-Topic: Print timestamps Thread-Index: AdUlv13JLHAMGlq9Sca9iiPIWkXDSg== Date: Tue, 18 Jun 2019 10:29:04 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [172.16.11.166] x-kse-serverinfo: smexchange.siebmeyer.org, 9 x-kse-attachmentfiltering-interceptor-info: protection disabled x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 18.06.2019 08:47:00 MIME-Version: 1.0 Message-ID-Hash: YMJP3JY5XD5SSE73YIU3E5LQQL4PJ57T X-Message-ID-Hash: YMJP3JY5XD5SSE73YIU3E5LQQL4PJ57T X-MailFrom: simon.buhrow@sieb-meyer.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-flashrom.flashrom.org-0; header-match-flashrom.flashrom.org-1; header-match-flashrom.flashrom.org-2; header-match-flashrom.flashrom.org-3; header-match-flashrom.flashrom.org-4; header-match-flashrom.flashrom.org-5; header-match-flashrom.flashrom.org-6; header-match-flashrom.flashrom.org-7; header-match-flashrom.flashrom.org-8; header-match-flashrom.flashrom.org-9; header-match-flashrom.flashrom.org-10; header-match-flashrom.flashrom.org-11; header-match-flashrom.flashrom.org-12; header-match-flashrom.flashrom.org-13; header-match-flashrom.flashrom.org-14; header-match-flashrom.flashrom.org-15; header-match-flashrom.flashrom.org-16; header-match-flashrom.flashrom.org-17; header-match-flashrom.flashrom.org-18; header-match-flashrom.flashrom.org-19; header-match-flashrom.flashrom.org-20; header-match-flashrom.flashrom.org-21; header-match-flashrom.flashrom.org- 22; header-match-flashrom.flashrom.org-23; header-match-flashrom.flashrom.org-24; header-match-flashrom.flashrom.org-25; header-match-flashrom.flashrom.org-26; header-match-flashrom.flashrom.org-27; header-match-flashrom.flashrom.org-28; header-match-flashrom.flashrom.org-29; header-match-flashrom.flashrom.org-30; header-match-flashrom.flashrom.org-31; header-match-flashrom.flashrom.org-32; header-match-flashrom.flashrom.org-33; header-match-flashrom.flashrom.org-34; header-match-flashrom.flashrom.org-35; header-match-flashrom.flashrom.org-36; header-match-flashrom.flashrom.org-37; header-match-flashrom.flashrom.org-38; header-match-flashrom.flashrom.org-39; header-match-flashrom.flashrom.org-40; header-match-flashrom.flashrom.org-41; header-match-flashrom.flashrom.org-42; header-match-flashrom.flashrom.org-43; header-match-flashrom.flashrom.org-44; header-match-flashrom.flashrom.org-45; header-match-flashrom.flashrom.org-46; header-match-flashrom.flashrom.org-47; header-match-flash rom.flashrom.org-48; header-match-flashrom.flashrom.org-49; header-match-flashrom.flashrom.org-50; header-match-flashrom.flashrom.org-51; header-match-flashrom.flashrom.org-52; header-match-flashrom.flashrom.org-53; header-match-flashrom.flashrom.org-54; header-match-flashrom.flashrom.org-55; header-match-flashrom.flashrom.org-56; header-match-flashrom.flashrom.org-57; header-match-flashrom.flashrom.org-58; header-match-flashrom.flashrom.org-59; header-match-flashrom.flashrom.org-60; header-match-flashrom.flashrom.org-61; header-match-flashrom.flashrom.org-62; header-match-flashrom.flashrom.org-63; header-match-flashrom.flashrom.org-64; header-match-flashrom.flashrom.org-65; header-match-flashrom.flashrom.org-66; header-match-flashrom.flashrom.org-67; header-match-flashrom.flashrom.org-68; header-match-flashrom.flashrom.org-69; header-match-flashrom.flashrom.org-70; header-match-flashrom.flashrom.org-71; header-match-flashrom.flashrom.org-72; header-match-flashrom.flashrom.org-73; n onmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list Subject: [flashrom] Print timestamps List-Id: flashrom discussion and development mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-Spamd-Bar: +++++++++ X-Spam-Level: ********* Authentication-Results: coreboot.org X-Spam: Yes Hi, sometimes I like to know how long an operation took or when I started programming. That´s why I added some timestamp printouts. May be you want to add it to the sources or do it in a more elegant way? What´s about adding the timestamp printout to msg_cinfo ? Just a proposal... Regards, Simon Signed-off-by: simon Buhrow --- flashrom_orig.c 2019-06-03 14:01:40.000000000 +0200 +++ flashrom.c 2019-06-18 11:19:36.401779000 +0200 @@ -31,6 +31,7 @@ #include #include #include +#include #if HAVE_UTSNAME == 1 #include #endif @@ -58,6 +59,9 @@ /* Is writing allowed with this programmer? */ int programmer_may_write; +time_t t; + + const struct programmer_entry programmer_table[] = { #if CONFIG_INTERNAL == 1 { @@ -1679,6 +1683,8 @@ const struct flashrom_layout *const layout = get_layout(flashctx); all_skipped = true; + time(&t); + msg_cinfo(" current time is : %s",ctime(&t)); msg_cinfo("Erasing and writing flash chip... "); size_t i; @@ -1703,6 +1709,8 @@ break; if (info->curcontents) { + time(&t); + msg_cinfo(" current time is : %s",ctime(&t)); msg_cinfo("Reading current flash chip contents... "); if (read_by_layout(flashctx, info->curcontents)) { /* Now we are truly screwed. Read failed as well. */ @@ -2527,6 +2535,8 @@ * preserved, but in that case we might perform unneeded erase which * takes time as well. */ + time(&t); + msg_cinfo("\n current time is : %s",ctime(&t)); msg_cinfo("Reading old flash chip contents... "); if (verify_all) { if (flashctx->chip->read(flashctx, oldcontents, 0, flash_size)) { @@ -2570,7 +2580,8 @@ /* Verify only if we actually changed something. */ if (verify && !all_skipped) { const struct flashrom_layout *const layout_bak = flashctx->layout; - + time(&t); + msg_cinfo(" current time is : %s",ctime(&t)); msg_cinfo("Verifying flash... "); /* Work around chips which need some time to calm down. */ @@ -2588,6 +2599,8 @@ emergency_help_message(); else msg_cinfo("VERIFIED.\n"); + time(&t); + msg_cinfo(" current time is : %s",ctime(&t)); } else { /* We didn't change anything. */ ret = 0;