Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1983297pxa; Mon, 3 Aug 2020 04:34:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+JvrSqz6601FK+XGQri88VuJdRGr7nwBw/ck+K/WdH7WjwU/CSwW55KFE2OjygFSR8Bxn X-Received: by 2002:a50:e1cf:: with SMTP id m15mr5339035edl.303.1596454485773; Mon, 03 Aug 2020 04:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596454485; cv=none; d=google.com; s=arc-20160816; b=RtT7Qb7Aq9WjCGltUadtndF25LA6uNYVW6Ej3w0+0bPkJjyRlLBKi5rG7wk5KJFieK ahDEIH2aNn885d3DpuhnkqeBQRf6rZr1Eb7QQAjE8nWSoxYmHe+uXGYbnl0kCXecmfh7 35btaZp+wMEEBBgbBjg5DVGQ8IhMRA7Cq1VSSCr8Cc5+6PPbs6BOtBwzmI8I14zPaOc2 VqJAUNCC5T7Z6QHoDEY7+WqBKb3gPnvVxEt3Ga6PegAnMBERBURHp2cvPgbioKl+L3Lt KQLsIAKBZnYJK5ZnxrArN9DX6E2w3CAiOZDhbzvKJnQm/IrBekZa9an7acGcQLRGda4u pGog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=pV1pPCL8X5xFckLn2VsESyYpW3VEpaZwtKKkcIg4hHY=; b=matx4otJyKBuQbyMIaLfSWcITUUlqMiD6jk4TVHC+s3dwl/u8fvyAfSR00Rye2Ooe0 DrybvTe/BBw8JfucbgiIZDKw8MxRI8Fc8CGFy/dtE4ulbhgYcQaogOjb+0mcdlYR+Sh3 ahDh1KZQ1qgx5DHUzw7A3iuRNtqAO+Edi71E/AQzOlhHanurvFW2TXmX+EUHiOIRwMkE 8Ij3/cfvDNkKKizjbIr6z4wuEozUMx1rboty5nDax3Y/N9NkXNv51R6bdCVGBZHmD/Rj OAgbyo3slxTU7w2r/Lcvn5Z4qi6Nch5l9KA25cYTp55fMRoG4OgtZAWfhUVFkpQvydze aajA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZmETOhWd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si10479924edh.363.2020.08.03.04.34.23; Mon, 03 Aug 2020 04:34:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZmETOhWd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726578AbgHCLbl (ORCPT + 99 others); Mon, 3 Aug 2020 07:31:41 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59738 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725945AbgHCLbk (ORCPT ); Mon, 3 Aug 2020 07:31:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596454299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pV1pPCL8X5xFckLn2VsESyYpW3VEpaZwtKKkcIg4hHY=; b=ZmETOhWdH0Vz673bhndk6SP50A4BLZmDrudefwj6w27bmcjMfgT2KWgASJhutOHawyissE /SNv/Cvc1ZPmIpffyuH6kAJonrHU6tedLq2Grqp5SPlefHv1zo27O2fY9ZTil1KzfUiHzF jA3p95PqVurjdScN4Q5vL1CC1N0XSWk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-52-AHN8_81nNN2UuaXi_HCXSA-1; Mon, 03 Aug 2020 07:31:34 -0400 X-MC-Unique: AHN8_81nNN2UuaXi_HCXSA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9901E1923761; Mon, 3 Aug 2020 11:31:32 +0000 (UTC) Received: from krava (unknown [10.40.194.212]) by smtp.corp.redhat.com (Postfix) with SMTP id C905174F45; Mon, 3 Aug 2020 11:31:28 +0000 (UTC) Date: Mon, 3 Aug 2020 13:31:27 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Ian Rogers , Andi Kleen , David Ahern , =?iso-8859-1?Q?Genevi=E8ve?= Bastien , Wang Nan , Jeremie Galarneau Subject: Re: [PATCH 4/6] perf tools: Add support to store time of day in CTF data conversion Message-ID: <20200803113127.GD139381@krava> References: <20200730213950.1503773-1-jolsa@kernel.org> <20200730213950.1503773-5-jolsa@kernel.org> <20200803040012.GB686281@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200803040012.GB686281@google.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 03, 2020 at 01:00:12PM +0900, Namhyung Kim wrote: > On Thu, Jul 30, 2020 at 11:39:48PM +0200, Jiri Olsa wrote: > > Adding support to convert and store time of day in CTF > > data conversion for 'perf data convert' subcommand. > > > > The perf.data used for conversion needs to have clock data > > information - must be recorded with -k/--clockid option). > > > > New --tod option is added to 'perf data convert' subcommand > > to convert data with timestamps converted to wall clock time. > > > > Record data with clockid set: > > # perf record -k CLOCK_MONOTONIC kill > > kill: not enough arguments > > [ perf record: Woken up 1 times to write data ] > > [ perf record: Captured and wrote 0.033 MB perf.data (8 samples) ] > > > > Convert data with TOD timestamps: > > # perf data convert --tod --to-ctf ./ctf > > [ perf data convert: Converted 'perf.data' into CTF data './ctf' ] > > [ perf data convert: Converted and wrote 0.000 MB (8 samples) ] > > > > Display data in perf script: > > # perf script -F+tod --ns > > perf 262150 2020-07-13 18:38:50.097678523 153633.958246159: 1 cycles: ... > > perf 262150 2020-07-13 18:38:50.097682941 153633.958250577: 1 cycles: ... > > perf 262150 2020-07-13 18:38:50.097684997 153633.958252633: 7 cycles: ... > > ... > > I believe this belongs to a later patch. I wanted to show in changelog that the timestamps match for both script and data convert tools jirka > > Thanks > Namhyung > > > > > Display data in babeltrace: > > # babeltrace --clock-date ./ctf > > [2020-07-13 18:38:50.097678523] (+?.?????????) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ... > > [2020-07-13 18:38:50.097682941] (+0.000004418) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ... > > [2020-07-13 18:38:50.097684997] (+0.000002056) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ... > > ... > > > > It's available only for recording with clockid specified, > > because it's the only case where we can get reference time > > to wallclock time. It's can't do that with perf clock yet. > > > > Error is display if you want to use --tod on data without > > clockid specified: > > > > # perf data convert --tod --to-ctf ./ctf > > Can't provide --tod time, missing clock data. Please record with -k/--clockid option. > > Failed to setup CTF writer. > > Error during conversion setup. > > > > Signed-off-by: Jiri Olsa > > --- > > tools/perf/Documentation/perf-data.txt | 3 ++ > > tools/perf/builtin-data.c | 1 + > > tools/perf/util/data-convert-bt.c | 56 +++++++++++++++++--------- > > tools/perf/util/data-convert.h | 1 + > > 4 files changed, 41 insertions(+), 20 deletions(-) >