From patchwork Mon Oct 12 02:53:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1380595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C8jtm1NWcz9s0b for ; Mon, 12 Oct 2020 13:54:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jQTV0c23; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4C8jtm0WGzzDql0 for ; Mon, 12 Oct 2020 13:54:08 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jQTV0c23; dkim-atps=neutral Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4C8jt91LHnzDqZL for ; Mon, 12 Oct 2020 13:53:36 +1100 (AEDT) Received: by mail-pf1-x444.google.com with SMTP id w21so12213715pfc.7 for ; Sun, 11 Oct 2020 19:53:36 -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 :mime-version:content-transfer-encoding; bh=puTJBKi0zvZcQ2Njy7jOelT+KnP3CxowFq92wzmHPFQ=; b=jQTV0c23PFhsGwxU0KchBL8da25vcErPEhVgo14n+gDvGfBEKidWKx+tXLhXofLxMT X8abYsIMyjMqvtzq6S1gFxGBvZpcX2ytMaGKUZMtglodjrU0Hir+T5dbP5Fq5jCakUv3 bxB7GPKfElZoJMDM9IbMC+JQe659zSM3y47U2n0rCPRPM274eecg0t53JifYxFsJRipT Ova9I8kSL2xsxbZCAXOHM4EF4+IIiVzReqlFC0xvpd7LazxPS5dKBvZXehqL7ALqMLqr qmFqKK4nMF6h9DGLyEjjRxr7bc64nlZJ3X6Cj+iSW5rm6RJpOkixI1ya87zwJYlyO1hx 4nGQ== 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:mime-version:content-transfer-encoding; bh=puTJBKi0zvZcQ2Njy7jOelT+KnP3CxowFq92wzmHPFQ=; b=SN3bq1th9U5vwlEf5lzknwe2SD8izOJYLKONvclM+XMndyXcWKRVZollaWu0yF003W XJqBanm1P7AzBaPpg0JuFhDGlihtESYa6bAVtBm100OYJcd+0/vQPa7aI7QAongyV+nQ e24iTcxdqc6VPOSmCJd5vYSgwm9kk8sqOuHDavwISWpX4ZQWOD25KXa1oPmOYmcnDOSb 6CCRpizd5he+YgwzvqiY8k0yOiKKSzOIj2ob2qoM6QUkWa5LeAcl4tsffRThHDvmrNoJ JRLJO+fZzGlJhYwSyR4FkHy8B2U01yzo1rQsH9SvDdD2BZWr2IbjY51Q3ZLChaLP9zuf aGdw== X-Gm-Message-State: AOAM531fdpdyHhxoMLisyEly9/FU9rk5b5/sVMF8RpYdr96T2bL9lC2p M1wLaxJNJ9ELI91RHlPH/d9syCMMpiwecA== X-Google-Smtp-Source: ABdhPJyKKlH94eNSd6fuvn2Fktp1C0ftS4hEA/mHHYi9gDvUHh15mUzMneANRHtoXr8XMpgIqFkL2A== X-Received: by 2002:aa7:9a4a:0:b029:155:323e:adae with SMTP id x10-20020aa79a4a0000b0290155323eadaemr18884116pfj.70.1602471215002; Sun, 11 Oct 2020 19:53:35 -0700 (PDT) Received: from localhost.ibm.com (14-200-206-90.tpgi.com.au. [14.200.206.90]) by smtp.gmail.com with ESMTPSA id g4sm17909258pgg.75.2020.10.11.19.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 19:53:34 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Mon, 12 Oct 2020 13:53:06 +1100 Message-Id: <20201012025314.1070230-2-oohall@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201012025314.1070230-1-oohall@gmail.com> References: <20201012025314.1070230-1-oohall@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 02/10] external/trace: Print timestamps in prlog()'s format X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Make the trace tool's output format match that of skiboot's prlog(). Printing a timebase tick count in hex isn't terribly useful and having a common format makes correlating trace entries to log entries much easier. Signed-off-by: Oliver O'Halloran --- external/trace/dump_trace.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/external/trace/dump_trace.c b/external/trace/dump_trace.c index 5a832c791fb6..c68eea894715 100644 --- a/external/trace/dump_trace.c +++ b/external/trace/dump_trace.c @@ -45,13 +45,18 @@ static void *ezalloc(size_t size) return p; } +#define TB_HZ 512000000ul + static void display_header(const struct trace_hdr *h) { static u64 prev_ts; u64 ts = be64_to_cpu(h->timestamp); - printf("%16lx (+%8lx) [%03x] : ", - ts, prev_ts ? (ts - prev_ts) : 0, be16_to_cpu(h->cpu)); + printf("[%5lu.%09lu,%d] (+%8lx) [%03x] : ", + ts / TB_HZ, /* match the usual skiboot log header */ + ts % TB_HZ, + h->type, /* hey why not */ + prev_ts ? (ts - prev_ts) % TB_HZ : 0, be16_to_cpu(h->cpu)); prev_ts = ts; }