Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp978131pxb; Wed, 29 Sep 2021 14:01:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgjLACyJrL43G++8VNwxAYZ9MRO6G9fMgymC7Q56T0dDDkpG0lcLyjVBMrXk4cYxXan2qg X-Received: by 2002:a63:4003:: with SMTP id n3mr1632571pga.413.1632949303695; Wed, 29 Sep 2021 14:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632949303; cv=none; d=google.com; s=arc-20160816; b=f6v81KS8aC+WRJjsPW7Qq+WFGgPD/zV1QI814C4qRkGXtLOgPtK0ntYsLwgz7inD58 3YR6vRXnlWX3P7OPWfUbn5VRo7FoRBcc3MEj30Lw1Qk+acyTDDfaYqcyV8CDnSiTyTGk +qYn+uf1lqlJJtdFV87euVYOT7dglvPZHAEXS7p01ezjbzpQtpWyEaSz+r600Ue7VHjb x6cDFyvdpMn72NdSpvTqWA5eXDp3uuLKmlnstJ322hHSvwsxE9fxnQpuP3BsLYNriwKH 2dZTnRGyhOpFH13VmlhAUSQRy2PeaX3l4YGst+W0YCrlDqbzdsKh/X8ysWVibxG5Es2u 3Rrg== 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=AE5fljvyYNG+Yl+9MBrwwlc+KGiDiGbxgTld+BD8ecY=; b=QkdYSLAEaUViJY9b5sPboPMF/oRp1M8WupfQIy6B226IN75ulKVxkr6PlfiKarpClX vv4iTiVjUJlYRCt9+68vs49PuRi2tUJOIJ3n4wHOsuXhSE3rl4Tn9u4esK0uCM8eEkBy mvCdzD5XYNdtX9lBGB9Hzoa31Lp845oB66wOepQdG0Ah9orIgyxDduwOP4Oa0cfyl43D XqyqYBrRIAKTOebtKedy4605Z8JPjDuiqor7wuMwHPRPCzeIeQKWpdHCNkskHX1mZUJM y5rDYcco8dDaFlw69QLP7JTNaTGyA3g98/F1rw7XVrjS6BHdjyrPe+3rX+We5J77omKU 7P0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IBdfMdzP; 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 m126si1052598pfb.100.2021.09.29.14.01.17; Wed, 29 Sep 2021 14:01:43 -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=IBdfMdzP; 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 S1346303AbhI2SoK (ORCPT + 99 others); Wed, 29 Sep 2021 14:44:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49533 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244341AbhI2SoJ (ORCPT ); Wed, 29 Sep 2021 14:44:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632940947; 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=AE5fljvyYNG+Yl+9MBrwwlc+KGiDiGbxgTld+BD8ecY=; b=IBdfMdzPKZ7dEWDkJZ9jziwZHcwMp8MiBlcAujEtIEzNp0RKXjdz8XuSevL8mbcBj9L+Zd T4J9p0bEPdRec10/9Rr+eFPYNPiLjZ2MIS9VwXdsJkoBtttJ3z1hoAND/dE3gKlrAyrG7Z XOH2s7JbdisrKsy0YjmlqPJ0d0GvlmQ= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-210-R1IgoRytNZ2qChn3BTtMqA-1; Wed, 29 Sep 2021 14:42:26 -0400 X-MC-Unique: R1IgoRytNZ2qChn3BTtMqA-1 Received: by mail-ed1-f70.google.com with SMTP id a7-20020a509e87000000b003da71d1b065so3446378edf.4 for ; Wed, 29 Sep 2021 11:42:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AE5fljvyYNG+Yl+9MBrwwlc+KGiDiGbxgTld+BD8ecY=; b=eYX6OpOAfLIu6dOz5ZDmoxoVLB/zGLYljDUwY0NTd9em0kVN72aSYa67pQt0IVOdJw OfOS5Bfrf9qUezFxky5wc260IvUmJr8uqgW50scm9iKpxg7+Rss3Epzhn0DixE/sgFoa hxspa8Q8Xq0jifR7mZHqkx6Fu2tPN/vDM32zWn+7fAUQdeBVqenLCHFkZcFTkX3TEjGZ vADkTOYzzLgBdydQoTym4memcTx8G1M9eThSAA/GNgdE6f+UDPSSiDJTfwA9WnZDkqaL 1x4vK97Qy+mJOSmYKnDLjWz8biCwJ2qhwpEaeX56kUbP3yyuJC75D1klQC1ZfTTNW9qq QQHQ== X-Gm-Message-State: AOAM532Ts0B/xxIUsZhL+5ZPGGhJwR7UQFNUxHXlyieZNIhWeJ+BhdO3 HgWSy58h+NEz8qI6G0VqcZDDpc/wmAy0H8Xx+JLvzevoKo+wAAFo3D0xdj2lAIaMVgjx0hriLHm NInmCdyodIqdXnxhBYAHfvBlN X-Received: by 2002:a50:8147:: with SMTP id 65mr1798816edc.60.1632940945093; Wed, 29 Sep 2021 11:42:25 -0700 (PDT) X-Received: by 2002:a50:8147:: with SMTP id 65mr1798793edc.60.1632940944885; Wed, 29 Sep 2021 11:42:24 -0700 (PDT) Received: from krava ([83.240.63.48]) by smtp.gmail.com with ESMTPSA id di4sm389079edb.34.2021.09.29.11.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 11:42:24 -0700 (PDT) Date: Wed, 29 Sep 2021 20:42:23 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Joe Mario , kan.liang@linux.intel.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 1/2] perf script: Fix PERF_SAMPLE_WEIGHT_STRUCT support Message-ID: References: <1632929894-102778-1-git-send-email-kan.liang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 01:54:39PM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Sep 29, 2021 at 08:38:13AM -0700, kan.liang@linux.intel.com escreveu: > > From: Kan Liang > > > > -F weight in perf script is broken. > > > > # ./perf mem record > > # ./perf script -F weight > > Samples for 'dummy:HG' event do not have WEIGHT attribute set. Cannot > > print 'weight' field. > > > > The sample type, PERF_SAMPLE_WEIGHT_STRUCT, is an alternative of the > > PERF_SAMPLE_WEIGHT sample type. They share the same space, weight. The > > lower 32 bits are exactly the same for both sample type. The higher 32 > > bits may be different for different architecture. For a new kernel on > > x86, the PERF_SAMPLE_WEIGHT_STRUCT is used. For an old kernel or other > > ARCHs, the PERF_SAMPLE_WEIGHT is used. > > > > With -F weight, current perf script will only check the input string > > "weight" with the PERF_SAMPLE_WEIGHT sample type. Because the commit > > ea8d0ed6eae3 ("perf tools: Support PERF_SAMPLE_WEIGHT_STRUCT") didn't > > update the PERF_SAMPLE_WEIGHT_STRUCT sample type for perf script. For a > > new kernel on x86, the check fails. > > > > Use PERF_SAMPLE_WEIGHT_TYPE, which supports both sample types, to > > replace PERF_SAMPLE_WEIGHT. > > > > Reported-by: Joe Mario > > Fixes: ea8d0ed6eae3 ("perf tools: Support PERF_SAMPLE_WEIGHT_STRUCT") > > Hey Joe, Jiri, > > Can I have your Tested-by? Acked/Tested-by: Jiri Olsa thanks, jirka > > Thanks, > > - Arnaldo > > > Signed-off-by: Kan Liang > > --- > > tools/perf/builtin-script.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c > > index 6211d0b..9f62ac6 100644 > > --- a/tools/perf/builtin-script.c > > +++ b/tools/perf/builtin-script.c > > @@ -459,7 +459,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session) > > return -EINVAL; > > > > if (PRINT_FIELD(WEIGHT) && > > - evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT", PERF_OUTPUT_WEIGHT)) > > + evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT)) > > return -EINVAL; > > > > if (PRINT_FIELD(SYM) && > > -- > > 2.7.4 > > -- > > - Arnaldo >