Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp343909pxa; Wed, 5 Aug 2020 02:37:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXzryhORqBGjNXyWh1T7XHVcdgXvBvaTuuwjlQBqtqji0JaXSlv0MRwSppvNOHPAJjSTOA X-Received: by 2002:a17:906:a24a:: with SMTP id bi10mr2246356ejb.227.1596620222555; Wed, 05 Aug 2020 02:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596620222; cv=none; d=google.com; s=arc-20160816; b=zFo7oy8aIRoheRS2FTl0uURhrqu18ycXyoKSaqLme3MXBAeTYCmcQwar/6uOCe6ZOU 71PcOF4rmJ/Duq4y00MFwhsIyMRa9Kb3jbGj6P/+gMIai893T9dketdAmM3r/wvKuhKx zANhtFHhzqXsOyjouelQoZ41sl9URZ5gMcdKheS3XlhyIwuNLBxfRUuziG90ywOHCKCW YEJOEFfm6aDv/iKbwkUC0+C6E3CvrZK/8ZS6EwpiOQNv0oLSKArJi27y3tF1Z8Ba8A0X 76+sCWzqAtjDODCe9V0zfCdpBmYFl1UsXGPjDG3KfwhKE0t5EF3Pff9TwpQ06YJwBk1Y YdOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=4hokSucYN3R2bLHQzyCvBo9pi+KtIPgt0Ed2LuOCSZY=; b=fwMweW5v5Y9AMccTwhrJgkQ0Dukjrs08WSSlLFLbXIndv1CheCXDiFGxjmM0wWI2XW zid9Pu+4bevKktirOYQj9QdV8EhyF+gqPIe2xTtWEnU0BiqSGIvk6VpTiNB76rhHGXnO 3FO/KLHfdugAvdFCaSRzJxHAaqZ1YHnqoO2furKuiEvTIYXdZ8za/G0tlTVrxgSUCgWO lUhs4w/lcgMrYxSe4dRLca9mgqdVvGTI9hcGDNyxTctYh2hR7D7TpIOis6ja56KMjBSl q17UZ91KPipJpTR2pRKocNFYby9XZ01Zw2DTJ7y/25zt3Gy3HyyeD1J0QuncSFuFV2Hs /NjQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si1069060edw.325.2020.08.05.02.36.29; Wed, 05 Aug 2020 02:37:02 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728390AbgHEJfS convert rfc822-to-8bit (ORCPT + 99 others); Wed, 5 Aug 2020 05:35:18 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:53772 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726604AbgHEJe5 (ORCPT ); Wed, 5 Aug 2020 05:34:57 -0400 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-463-A6PLiuaHO56Nis-bj6FLOw-1; Wed, 05 Aug 2020 05:34:52 -0400 X-MC-Unique: A6PLiuaHO56Nis-bj6FLOw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C9E418C63C1; Wed, 5 Aug 2020 09:34:50 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.194.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E70E7193A; Wed, 5 Aug 2020 09:34:45 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Ian Rogers , Andi Kleen , David Ahern , =?UTF-8?q?Genevi=C3=A8ve=20Bastien?= , Wang Nan , Jeremie Galarneau Subject: [PATCH v2 0/7] perf tools: Add wallclock time conversion support Date: Wed, 5 Aug 2020 11:34:37 +0200 Message-Id: <20200805093444.314999-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, this patchset is based on changes made by David Ahern long time ago. The perf code moved a lot since then, but the idea is the same. The patchset is adding the ability to display TOD/wallclock timestamp in 'perf script' output and in 'perf data convert --to-ctf' subcommand, so the converted CTF data contain TOD/wallclock timestamps. It's done by adding new header FEATURE 'CLOCK_DATA' to perf.data, that stores reference times for both TOD/wallclock time and for the clock that perf record is configured to use. These reference times are then used to convert sample's timestamps to TOD/wallclock timestamps. The feature is available only for recording with clockid specified, because it's the only case where we can get reference time to TOD/wallclock time. We can't do that with perf clock yet. Also available in here: git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git perf/abs_time v2 changes: - fixed HEADER_CLOCK_DATA doc, typo, print format [Namhyung] - moved clockid related code into separate object [Andi] thanks, jirka --- Jiri Olsa (7): perf tools: Move parse_clockid into clockid object perf tools: Add clockid_name function perf tools: Store clock references for -k/--clockid option perf tools: Move clockid_res_ns under clock struct perf tools: Add support to store time of day in CTF data conversion perf script: Change enum perf_output_field values to be 64 bits perf script: Add tod field to display time of day tools/perf/Documentation/perf-data.txt | 3 ++ tools/perf/Documentation/perf.data-file-format.txt | 13 +++++++ tools/perf/builtin-data.c | 1 + tools/perf/builtin-record.c | 145 +++++++++++++++++++++++--------------------------------------------------- tools/perf/builtin-script.c | 195 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------- tools/perf/util/Build | 1 + tools/perf/util/clockid.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/clockid.h | 11 ++++++ tools/perf/util/data-convert-bt.c | 57 ++++++++++++++++++----------- tools/perf/util/data-convert.h | 1 + tools/perf/util/env.h | 14 +++++++- tools/perf/util/header.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- tools/perf/util/header.h | 1 + 13 files changed, 492 insertions(+), 190 deletions(-) create mode 100644 tools/perf/util/clockid.c create mode 100644 tools/perf/util/clockid.h