Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1773739pxa; Sun, 2 Aug 2020 21:01:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlJukTYEv74cdC2TjlzGEe+hbF6ogMRgBJ7RdnCBzX/VlHUcHSGGQyeLTCLDLth/SNPtz8 X-Received: by 2002:a17:906:cc47:: with SMTP id mm7mr13281321ejb.362.1596427317154; Sun, 02 Aug 2020 21:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596427317; cv=none; d=google.com; s=arc-20160816; b=eKdaUctjNGR2KgUX4rDb941G7q0nbQ7zlx0yjN+Ikrrsec1u+L1ImN3PHwpbKLPXRd aN4wjCLP28jeQtqoTvwnVW1vsNGDTIsA3xkKOC8kCbCUnPrbTA6N+f5+IIEkH69sdKf0 laudADWClufyWH8yZkF6w1wM3xMvwKfNVcpqb8MBk36n+674FskjQfXguYJ32v3clNTZ Zq3tdwsTZp1APR67oK8hNF2dgVlSHsR8IUQtkgKRmaoOkN54yTyVaGiubQ+iW/1SuOVt l42KDVNlOFB9dzJaupGKGaiVFyXA7FuJip8xD5cmYj0ZjRBC2waWSenhtic76Uwd5Mrf xt3A== 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=h9BdHn/k7ykaHwWWI4X0FvccCvOk86APOZ2sIxzL6XY=; b=z9hlMUSR+rVOpG6YWy9tbX4Irzh3xz3zVuURcJGD7mPJRb4iRFMJWuSWY85oDgZj9i RTQkKP9EtI1x3cHrhmfi5eV6IK43xooZy5wDlgfH86QShayQsCzeGsHxnlX0Qm66Quiz U83+If/t+yiWD3BkwfKiwDzqezit6y/rMzTzHk6d5i2KqCeN/OjmKd3/4VEJtgRFQl2V yCtHUwJIKQK4zwBVMiLZocrgftxIrZtnbW6EkDqbgn3ocqOwh8CNyxbI+dny3CWi+WKf thXrwXo3HHedqvlfoCEIRahrjSnpuRK3IlgvcSpVjm1G/lCwgasleC+olcVF0sNcwM6V F0xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="YrD/wkul"; 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 l3si9987778ejd.17.2020.08.02.21.01.34; Sun, 02 Aug 2020 21:01:57 -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=fail header.i=@gmail.com header.s=20161025 header.b="YrD/wkul"; 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 S1725840AbgHCEAU (ORCPT + 99 others); Mon, 3 Aug 2020 00:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbgHCEAT (ORCPT ); Mon, 3 Aug 2020 00:00:19 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E6C5C06174A for ; Sun, 2 Aug 2020 21:00:19 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id t6so6809520pjr.0 for ; Sun, 02 Aug 2020 21:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=h9BdHn/k7ykaHwWWI4X0FvccCvOk86APOZ2sIxzL6XY=; b=YrD/wkulL3RHWOKxlwJ9MAwrs21HxG3RIpFTMRyrD+fP/sDQSP7wOPV4FcVEaPixDl 3dvMm6s3xa6coQV+kICBL0XaTE4du3mYLAUqHgYyKWOo7JtmDYKJr8jZpXl9zVD6zB05 Uej/Kq8QuCebcCOJEsMFWIXOBsIJiqQhsE69bB9NE7vveZhJ1qAhQNB84kw6hw6C+Tql +QvrmmEN0M9rTvF9+7OG1UNQxGLjgrm9jftnWA3dWyw9kWGpOpHgbGaSZ3z1afifd9yE qqc2iP3vk82zitmiIKNiVcdUPpD4N2qEmxR0tt2VK0ilmYlBQlUDHdSbjzhEgmdQW93A f7yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=h9BdHn/k7ykaHwWWI4X0FvccCvOk86APOZ2sIxzL6XY=; b=ZMqRdh5V85DmRdXFh3zikxrBrxvtH6HWDyi9f4NrO2ygT0YuWRe+3JrAg9pZsx4LZX 0ddwbpl6MstLorO0QGELK2IlPADDuntOHhn0ZgohimOFdy/0sdO9oPiBD7jFqKQGX11L dQQ3C5gR1sGZk/BHAP1hE9lUQnms/Rd0TZ0pj0+05ve6mDiPpx6YMnLv2zEn71SksvFP 3aHcBybYQhGUriEH9oYYIU0S+EWXd6bB2wAaNyZUp0E1Gy5GGFt3lv+ZzSzXUMCdJMvC I6LmNGmgIX5K37oHCuWvU4AnW1aiwy5N9MtPI9OeUIGIjtmwTACAjBujXr8VO4G/gFlp i3WA== X-Gm-Message-State: AOAM533jXzNPtrgRp0pTjHYhmKNHZxLh57Da2/koHrBZSn7aJbjlhuWe gkuX1mbJxjBxvhBVK4afX9w= X-Received: by 2002:a17:90b:252:: with SMTP id fz18mr7372447pjb.48.1596427218619; Sun, 02 Aug 2020 21:00:18 -0700 (PDT) Received: from google.com ([112.159.19.5]) by smtp.gmail.com with ESMTPSA id b185sm18067427pfg.71.2020.08.02.21.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 21:00:17 -0700 (PDT) Date: Mon, 3 Aug 2020 13:00:12 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Ian Rogers , Andi Kleen , David Ahern , =?utf-8?Q?Genevi=C3=A8ve?= 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: <20200803040012.GB686281@google.com> References: <20200730213950.1503773-1-jolsa@kernel.org> <20200730213950.1503773-5-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200730213950.1503773-5-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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(-)