Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1986836pxa; Mon, 3 Aug 2020 04:40:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfcoRrsY3Z833FLb5e1oZKf6LwRpkG/5X2FS+Act3NJELPAH7nc8SCXjDN/dHLS4ucZg/U X-Received: by 2002:aa7:c915:: with SMTP id b21mr15866560edt.17.1596454857767; Mon, 03 Aug 2020 04:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596454857; cv=none; d=google.com; s=arc-20160816; b=uYQxUcQjNuJOJeCpSlLlVrOp3STMAHpl56So+u45tPaAZlOpiRoHchSUWJbHgYmLkx 1UH6C9galc3q/AN6cjw8susHXKG1feQEPFS04I4lZM/jnwAt5tZcUWlGdj8NKzvaCM6o FZU2hbYcftwUl3eCCWh7YO5/OagWXky0bJLLrFdu5URhqDIaZgme/GKMFB8Lf9bRn02s PY1s+9dwVl6VNMbb8NNotdG/5LDPCyMMqNOSJ+rfTj9xrLWyLt8nslTzNPRGvolu1yYf sqFdU88p/+QFaYd1uyjytSH3R4VjZRD2/rR8Ff8MCagLfJFD2Ey8Hn8TKNnjdYAk0nlh FqHQ== 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=dCtVsAq27Rguno+ZBtzk38dyURdoRvH1j0hpCY8qr+g=; b=NPTEatHxj2ejj+qPEba7IAAdeMstS1uC2WioNAHiVOnlIeIw1Y6Fevz8uzxsnGkl3g dH4JwfDuuQckvCgncKUmaTZmLXm1QbecIKV0lNcdMCIfWKKA8uto4DLRragdPt/6NhVP ph/lfKcClVXNX0Q6XF32mZkEKNVdrqElxkhM7LNy7kHa3RbmNe84utm3t05oS94PDyOh leotlhYEsUhyQHTETJenqe4ew+hje1Uot2OWyQu/n7WA2KK9d+K8BUun8s8oF39Jy24i IJYrdHW0XOYXxdC98k96sImvHDanGDikY9QuJeTD1MDxfhZPPzvnvLx+nq1Ek/ImLKLt DPrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q3p7nbML; 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 bm20si10286908edb.583.2020.08.03.04.40.35; Mon, 03 Aug 2020 04:40: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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q3p7nbML; 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 S1726291AbgHCLgT (ORCPT + 99 others); Mon, 3 Aug 2020 07:36:19 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:47225 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725948AbgHCLgP (ORCPT ); Mon, 3 Aug 2020 07:36:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596454572; 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=dCtVsAq27Rguno+ZBtzk38dyURdoRvH1j0hpCY8qr+g=; b=Q3p7nbMLvTOEGLu0ylKNidJkvepi7d4kArthtDyfhW2SbM+oQX8oALW1cFnNsrIrK8MKiR HZWlRJCBXEjjHc4wiMx2ND4Gve1BI5qPRfgqPg3oMzWouF8CHQBpf2gWDxtTTFjjaD4HtI YAm+j93PYDdrFEZcCEEHQ9BvaHHptkU= 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-435-S1xSutV5PHGdZOCyzvj-9A-1; Mon, 03 Aug 2020 07:36:10 -0400 X-MC-Unique: S1xSutV5PHGdZOCyzvj-9A-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 B2502100A8C1; Mon, 3 Aug 2020 11:36:08 +0000 (UTC) Received: from krava (unknown [10.40.194.212]) by smtp.corp.redhat.com (Postfix) with SMTP id A046971762; Mon, 3 Aug 2020 11:36:03 +0000 (UTC) Date: Mon, 3 Aug 2020 13:35:59 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Jiri Olsa , Arnaldo Carvalho de Melo , David Ahern , lkml , Ingo Molnar , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Ian Rogers , Andi Kleen , =?iso-8859-1?Q?Genevi=E8ve?= Bastien , Wang Nan , Jeremie Galarneau Subject: Re: [PATCH 2/6] perf tools: Store clock references for -k/--clockid option Message-ID: <20200803113559.GE139381@krava> References: <20200730213950.1503773-1-jolsa@kernel.org> <20200730213950.1503773-3-jolsa@kernel.org> <20200803035550.GA686281@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200803035550.GA686281@google.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 12:55:50PM +0900, Namhyung Kim wrote: SNIP > > diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt > > index b6472e463284..c484e81987c7 100644 > > --- a/tools/perf/Documentation/perf.data-file-format.txt > > +++ b/tools/perf/Documentation/perf.data-file-format.txt > > @@ -389,6 +389,19 @@ struct { > > Example: > > cpu pmu capabilities: branches=32, max_precise=3, pmu_name=icelake > > > > + HEADER_CLOCK_DATA = 29, > > + > > + Contains clock id and its reference time together with wall clock > > + time taken at the 'same time', both values are in nanoseconds. > > + The format of data is as below. > > + > > +struct { > > + u32 version; /* version = 1 */ > > + u32 clockid; > > + u64 clockid_time_ns; > > + u64 wall_clock_ns; > > +}; > > + > > It seems that it's slightly different than what it actually write to a file. > Specifically the last two fields should be reversed IMHO. oops, you're right.. wil fix in new version > > > > other bits are reserved and should ignored for now > > HEADER_FEAT_BITS = 256, > > > [SNIP] > > > diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h > > index 1ab2682d5d2b..4098a63d5e64 100644 > > --- a/tools/perf/util/env.h > > +++ b/tools/perf/util/env.h > > @@ -100,6 +100,18 @@ struct perf_env { > > /* For fast cpu to numa node lookup via perf_env__numa_node */ > > int *numa_map; > > int nr_numa_map; > > + > > + /* For real clock time refference. */ > > typo: reference ok SNIP > > + else { > > + strftime(date, sizeof(date), "%F %T", <ime); > > + scnprintf(tstr, sizeof(tstr), "%s.%06d", > > + date, (int) tod_ns.tv_usec); > > + } > > + > > + fprintf(fp, "# clockid: %s (%u)\n", clockid_name(clockid), clockid); > > + fprintf(fp, "# reference time: %s = %ld.%06d (TOD) = %ld.%ld (%s)\n", > > Shouldn't the last one be %ld.%09ld? sure, why not thanks, jirka