Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp449036pxb; Sat, 10 Apr 2021 07:59:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSS35rWWAtn4CnaZ4Si1TY5UYY7nuvRKXtD8rA0unEz4h8LRs2podffDn3d2339K2lv2Fl X-Received: by 2002:a17:906:2a0f:: with SMTP id j15mr17839328eje.159.1618066792949; Sat, 10 Apr 2021 07:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618066792; cv=none; d=google.com; s=arc-20160816; b=s1GJ3njMuO5ppPKz0FtNKZCg13ajuDjuhUrtQS3EmDPRPInwum4H4T3lknIdXVvtwk ia4R9XS4GYJtXHUPob8EyBZf9LJeMD/bdygW7kosbQCBuAp4Jv62n1om/rYKyWS0Exo6 Ql+o8q1oUWuIri1EVZZq8NPARlalm8qUI6aodMAB62zbtjIS8xLhNsRuBM8nfTgR3Flo Z142Rvt30nIy4Rr+GOIi4vaoFT9W0+jyGPAV887VLiAA1eQUhiGy0hh6kFgPv299Rili d3/WZwujui/NcpzPhL1PDmubdkxVAosJi3AZY9D1D4nrX3/Z3C1ciiAVPSs7u41/O/2z qSQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kTHysmRZ8s5smpNVRM3C08qgpRu8+4XsyWnC1M27hGc=; b=XxSGWxxuA0su4QB3HtUHLCNVn7WL9fgcV0VUCatEGhcO6Jm1zsd4an2FtD+lWoClnU Ow+mP4uU7hfJIjlXaS7+deuDBvQvMTBE5/odARtfKaXCeL+8pmBrllK/XOgdzSF+p2HE lGeF3iOEjd3+tOqLLSpThzflZwAXRzzMoXS92S3ihwpNGHIrlaC2hlbC+xJgNnJFErWy yb7dfM8L12J7y+koYkNeAApzP81y0sOcKUX/uW0BPHO85DDQD72hRYZgdODLPV7DyPwQ DWUKpWszeAuBGoj2X/1GMqgb77SbolK43vN4Mg4QkSQfnbd/LMISGUnZSPulGyfzOxRz T2lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XGXa15Zd; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si4226989ejr.588.2021.04.10.07.59.28; Sat, 10 Apr 2021 07:59:52 -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=@linaro.org header.s=google header.b=XGXa15Zd; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234865AbhDJO6C (ORCPT + 99 others); Sat, 10 Apr 2021 10:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234839AbhDJO6B (ORCPT ); Sat, 10 Apr 2021 10:58:01 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DA48C06138A for ; Sat, 10 Apr 2021 07:57:47 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id q10so5999896pgj.2 for ; Sat, 10 Apr 2021 07:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kTHysmRZ8s5smpNVRM3C08qgpRu8+4XsyWnC1M27hGc=; b=XGXa15ZdfE/uvEjmYyqVg2CK70tcGiE1U1uAfjvWmmDx1O0MP+pbhPYC++Jd7x3T8x 7PgAAjA3Ue8AeLms10TODNA0IdSqNQitvW0qCq7pUNw9Q47BEJ1Hkpf5VebS1lKbhmdo XYQ1c7so8dmeRKAMr4bfZNYNMFGpa+XF2MfAF2YyS0b5q9/DVz+BiKegoaFI/IC+Vqh+ j7oBq7kLr8sM/52nfYm6CubmmLMOwS6tsp7TGt3ENkPBnOM5JGffUDIKLGdZYaQZqw8F +xPJ1BKYShTGUvzsoyJMziAqjnPfw6oxIICRGWAUUdR6Z8MyG/foeI1y39kPdGP9Pf7l 0IAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kTHysmRZ8s5smpNVRM3C08qgpRu8+4XsyWnC1M27hGc=; b=iun91xmNsNIQ222jDYidKwDQAy5FUwdNmRpoy2E+coPveJctue5R8I9rwidUVBLEgE kxyx700skrcQLZUGeU+AxOZ6lQMXzyN3bEFFJFZKMsu1H2mKQfEx+Ya7DkyMOtzFxyRe P8FWz+o7I4jYOEllqSK41TY9kYQr8AiQ5z/gEWKw6g+rdsmpLJzGSpPz7s7/C1CcjW0j Y4lExQpYqwO3NUeuPuzQ79eStBpmF52n8yCtMom4Y24R2AFxY48HA5SnHPe6DaiQV9v6 jyMJvuW9nk4jg6SbUQDJVefPHrtl0Q54FUJsXugBkVo3uaB2hUbJVFwczPZRHqAPKWlC ClNA== X-Gm-Message-State: AOAM5303cNmHXeT+JbbtGXJE/ys2ttJOHvYL0tXNTDc2rbevv0Rm/Cj0 u5FamluoEwGSGIo5kn40OpaZjQ== X-Received: by 2002:a63:c145:: with SMTP id p5mr17600808pgi.451.1618066666742; Sat, 10 Apr 2021 07:57:46 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([116.206.101.232]) by smtp.gmail.com with ESMTPSA id e3sm5151417pfm.43.2021.04.10.07.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Apr 2021 07:57:45 -0700 (PDT) Date: Sat, 10 Apr 2021 22:57:41 +0800 From: Leo Yan To: Adrian Hunter Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kan Liang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf session: Dump PERF_RECORD_TIME_CONV event Message-ID: <20210410145741.GA6012@leoy-ThinkPad-X240s> References: <20210410031930.18064-1-leo.yan@linaro.org> <9e100c55-16b1-090e-1e81-334a55bd4b15@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e100c55-16b1-090e-1e81-334a55bd4b15@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Adrian, On Sat, Apr 10, 2021 at 11:46:10AM +0300, Adrian Hunter wrote: [...] > Hi Leo > > I think there might be some more work related to this. > > Pedantically, shouldn't you cater for backward compatibility and > not assume the following were in the perf.data file: > > __u64 time_cycles; > __u64 time_mask; > bool cap_user_time_zero; > bool cap_user_time_short; > > That means checking the event size. > > Also PERF_RECORD_TIME_CONV should have its own byte-swapper instead of > perf_event__all64_swap() - also checking event size. > > i.e. fixes for: > > commit d110162cafc80dad0622cfd40f3113aebb77e1bb > Author: Leo Yan > Date: Mon Sep 14 19:53:09 2020 +0800 > > perf tsc: Support cap_user_time_short for event TIME_CONV Indeed! IIUC, should have three fixes with event size checking: - One fix for dumping TIME_CONV event; - One fix for byte-swapper (especially for bool values); - One fix for commit d110162cafc80dad0622cfd40f3113aebb77e1bb; Will follow up for the suggestions. Thanks a lot for your insight review. Leo