@@ -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;
@@ -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;
}
This helps exporting the recorded log to an image file using dd. Signed-off-by: Amir Goldstein <amir73il@gmail.com> --- src/log-writes/log-writes.c | 8 +++++--- src/log-writes/replay-log.c | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-)