From patchwork Wed Aug 30 14:51:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9929855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73274603B5 for ; Wed, 30 Aug 2017 14:51:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64CE1283FF for ; Wed, 30 Aug 2017 14:51:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 598E6286AB; Wed, 30 Aug 2017 14:51:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0522B283FF for ; Wed, 30 Aug 2017 14:51:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751760AbdH3Ovj (ORCPT ); Wed, 30 Aug 2017 10:51:39 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33347 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776AbdH3Ovg (ORCPT ); Wed, 30 Aug 2017 10:51:36 -0400 Received: by mail-wm0-f65.google.com with SMTP id m85so1558733wma.0; Wed, 30 Aug 2017 07:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VHuYjZx66vmOtWW3m4HrT2w7W2M3SCJ0WKgsQ7hZY7k=; b=EQRj1WzyYwhGPiEgWI7axFSXRBR9A7Io+v8nEq9eXMMq7VQ1sncmWnRwGzmMcR0/BI R51PlSyjJoWKPv6tM6bOJjX5HGvMo9C4cVRGUKZflfYTrrcXiti2ewa50UMfZtE7Gw1C +1MNDHMt4121/Oj16EUjlO/Q9zJJM+Mij7QbgX4N5Sg1mE9pjTy1oLiCfI1UfbhFEQ+H DVeBkU/jG56zeAhPnviO9WfYcJVBTEwysvaJ1bEeAjTI/CjVdpJXIOE1IfEIuU/z2WCw Dir1O9+lWmuyP0kUAqHQwJLJztPBisWEYO2zuZD3SQDTnBrAg22y+VtdRrcFRoF4Qw+y SWAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VHuYjZx66vmOtWW3m4HrT2w7W2M3SCJ0WKgsQ7hZY7k=; b=mGhz/YXTGVTfDZnOzHsiQhmpFDs0cbidxf0v07vwoxleYpeturB09xK6fkkG3Xz320 F3vbUNOgrKrp/j1Kt7cfLoRKk6TvxjTUYy2sKgsjPjofUTRqNwtghMFJ24cKwv9caPIL BHx7MmJapjZ8u0fsfsQ1nWpD/RmLTSOlOYrYkRrozlepL9URd0IFoUWWesGpmEReBvHt STtUeQn+EtpgAts8AIfdZaGe/KjT0yXMsEY0bykYqa3TFZHeKe4ELX48MP47a5a7xvsG gzv6GJQtoZf4XtNfUPHx9MfT+1E7PZQCJcfOyjw1dArBO7YOBXBe9jCwlQuKQK6nappq mZpg== X-Gm-Message-State: AHYfb5gAe1wpNzomsN3wZtLglh51NlgmgRRuKZIdCsEw7x3RJ6E5EqHT NdzLPSPwbX6lQw== X-Received: by 10.28.185.16 with SMTP id j16mr1374982wmf.122.1504104695201; Wed, 30 Aug 2017 07:51:35 -0700 (PDT) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id f42sm2606306wrf.27.2017.08.30.07.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Aug 2017 07:51:34 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Josef Bacik , "Darrick J . Wong" , Christoph Hellwig , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH v2 11/14] replay-log: output log replay offset in verbose mode Date: Wed, 30 Aug 2017 17:51:43 +0300 Message-Id: <1504104706-11965-12-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504104706-11965-1-git-send-email-amir73il@gmail.com> References: <1504104706-11965-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This helps exporting the recorded log to an image file using dd. Signed-off-by: Amir Goldstein --- src/log-writes/log-writes.c | 8 +++++--- src/log-writes/replay-log.c | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/log-writes/log-writes.c b/src/log-writes/log-writes.c index fa4f3f3..ba66a5c 100644 --- a/src/log-writes/log-writes.c +++ b/src/log-writes/log-writes.c @@ -158,12 +158,14 @@ int log_replay_next_entry(struct log *log, struct log_write_entry *entry, } } - if (log_writes_verbose) - printf("replaying %d: sector %llu, size %llu, flags %llu\n", - (int)log->cur_entry - 1, + if (log_writes_verbose) { + offset = lseek(log->logfd, 0, SEEK_CUR); + printf("replaying %d@%llu: sector %llu, size %llu, flags %llu\n", + (int)log->cur_entry - 1, offset / log->sectorsize, (unsigned long long)le64_to_cpu(entry->sector), (unsigned long long)size, (unsigned long long)le64_to_cpu(entry->flags)); + } if (!size) return 0; diff --git a/src/log-writes/replay-log.c b/src/log-writes/replay-log.c index 759c3c7..87c03a2 100644 --- a/src/log-writes/replay-log.c +++ b/src/log-writes/replay-log.c @@ -284,8 +284,10 @@ int main(int argc, char **argv) num_entries++; if ((run_limit && num_entries == run_limit) || should_stop(entry, stop_flags, end_mark)) { - printf("%llu\n", - (unsigned long long)log->cur_entry - 1); + off_t offset = lseek(log->logfd, 0, SEEK_CUR); + + printf("%llu@%llu\n", + (unsigned long long)log->cur_entry - 1, offset / log->sectorsize); log_free(log); return 0; }