From patchwork Fri Jun 25 06:19:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 1496927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=XqKpj75K; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GB6M41qcgz9sX5 for ; Fri, 25 Jun 2021 16:20:48 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GB6M503SQz301x for ; Fri, 25 Jun 2021 16:20:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=XqKpj75K; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=XqKpj75K; dkim-atps=neutral Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GB6Lf0PF2z3bvV for ; Fri, 25 Jun 2021 16:20:25 +1000 (AEST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15P63s1I186287 for ; Fri, 25 Jun 2021 02:20:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=WE2KyEVNoYNGs/e3fcXJzVMkpJlrNJGjajH20IgmQ2g=; b=XqKpj75KiRdi7tEKX68ER3Ad2TPZ0lvq/tanFZila49w1ooKKrpPvh3abWAxBgu5rVL7 UA4oVtoVl9zFssMG0q133mK452vx+kIzYD5cUvVCMMhltgsdhzRyL65eCNQEzazVQpb8 UAwW6Gs3obTq+UZ94reMw2I/nkbFfAVnEhRHsl9MYdusDWbc7c5D4qNTPXY9ww2/N+cx dHAZcXRVPeoneCBfNHrwpa+VqLwJ+vFywUFJqEyzzP6KazRygUipEqSKMzNPxcLQBkj5 V5eeyV16Q4XTtQeIMxfdTJ2oJ+LqDrS3BaiAX6ploqFskeQ/FlERq/Cp0F4UfYyw6cO/ ZA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39d98s951t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 25 Jun 2021 02:20:23 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 15P64Eqa187211 for ; Fri, 25 Jun 2021 02:20:23 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 39d98s950p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Jun 2021 02:20:22 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15P67j94004772; Fri, 25 Jun 2021 06:20:20 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma06ams.nl.ibm.com with ESMTP id 3997uhav08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Jun 2021 06:20:20 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15P6KIDJ27918824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Jun 2021 06:20:18 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 001B442041; Fri, 25 Jun 2021 06:20:17 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6BF6C4203F; Fri, 25 Jun 2021 06:20:16 +0000 (GMT) Received: from hegdevasant.in.ibm.com (unknown [9.199.46.25]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 25 Jun 2021 06:20:16 +0000 (GMT) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Fri, 25 Jun 2021 11:49:21 +0530 Message-Id: <20210625061937.47314-7-hegdevasant@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210625061937.47314-1-hegdevasant@linux.vnet.ibm.com> References: <20210625061937.47314-1-hegdevasant@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Yn77Z9v7G8NBo979X86uNG5N7xSiJRAw X-Proofpoint-GUID: vdGw5apHNnEcmjsKwpgPtRtcauG-FVV7 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-25_02:2021-06-24, 2021-06-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106250034 Subject: [Skiboot] [PATCH 06/22] 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" From: Oliver O'Halloran 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 5a832c791..c68eea894 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; }