Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp509296rwe; Wed, 31 Aug 2022 06:36:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR5LRs/eMrfquR+4z6A63ZWS+p6KMyr0vjRimMA6rfSFr1+PfPdQuo5G4+azjyUE8tQ+D2gU X-Received: by 2002:a17:907:2cf6:b0:73d:cc5c:b4f3 with SMTP id hz22-20020a1709072cf600b0073dcc5cb4f3mr19870196ejc.301.1661952981131; Wed, 31 Aug 2022 06:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661952981; cv=none; d=google.com; s=arc-20160816; b=Im+r6T87YoCTUgS5U0/BJ/CXhqsgeO11G3IbNrVeH0uDBPrfLzkQp3kmSMMba2reuD 6MdOKGN/h2lQdERDXm+ruxKfaqmCUMLiKcV/CpJLZN/90D5uXe8QGEtsJ09qoH2TKpmF sRC31cAMb5w9t+oR2Vccqk8AOj2Q1DJIf21UlqQhoBQwI+Dr1cVgKOF6zr/R8rTpkbmL tKqT7h7/rRJXTcSO5U1PDSB2qlHiJ0b4gAM7VB0B3fMG2P1+1Fw3FTVwo1Bgs96n2ISK L2O3yoWTdRT/UOXuGDczyf1mhXZviYk0VA0ySEQBzpkB9/jfGJp2xusjLHUwV0OZufpX JLOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cjj6FwZERnVR43Na1MdrEiYVx1zbhPLFLnj+bu4V2VI=; b=q/k+jCeBuAErd+RVS7VWhiy7hjLC5Nt4EdZYBajSxE9p+D4NyGDIfDdkB1tN6lzzyf IPsnLQdQFmuQav+1K/4P1OQ/bcvLm7DixI+rnxmTQuDe+Lw100LBHDtIUjQQ6bkkbwFA dpYS9bQsIKGe1zV+vEo1VEpOM5Tkrnhaq0klsgj8S/3gmU0s5ian0lsI3eKIMyH/qe2l 06mmdy0KVjFXW+6Kru/4Jv4MBBB6+sh+tACAzUTWJXIH09lg712mrH6NV4jp/rUa+bvF sHF9EZ2LzEjVSZdCKuVJRV2xR/eoEMvLn47VLhq18d57AIGN0cXfcOAqtfL0Oucvr6VY T5sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K28Wx2IB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k26-20020aa7d8da000000b004483a12fba9si7929832eds.210.2022.08.31.06.35.55; Wed, 31 Aug 2022 06:36:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K28Wx2IB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230511AbiHaMlA (ORCPT + 99 others); Wed, 31 Aug 2022 08:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231304AbiHaMkv (ORCPT ); Wed, 31 Aug 2022 08:40:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C99961DA3; Wed, 31 Aug 2022 05:40:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B607BB82077; Wed, 31 Aug 2022 12:40:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D537BC433D7; Wed, 31 Aug 2022 12:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661949647; bh=TPSgl0I2qWuKYC5cFtJ2UDufyO2SqJMLBEL1mtc1IZ4=; h=From:To:Cc:Subject:Date:From; b=K28Wx2IBN5YI4BT3HcgU5dtMPA6/Smwouty2BafiJeBXCnUipgktQ6of/M+JQH2nN 8lqlJnGWglNTmfvP3l6HC1B1OLyy+SKOQf6bQnkSxRTzHYIUg7Hysfw+M8Lcv0YbeB EYHp/8sDD5HhJxHKl9rVI63EzEto8jzVxvCYa4lgY5lORQmyti8Y124MzSCryh/PqH CbRVKG1M+jELswfW2chwNCWz9OhHyyO/g1eYrbkI91wCuH8N+N2wXZkw4gINcPBySr sgOJEXYfIfnEKG9s8IMLzQ25+kGwZkaHeG68Pesf0w0e4jcXP25hu0KAVZKQvt6GCZ mp98dII/CUBSA== From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Hongtao Yu , Namhyung Kim , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Ian Rogers , linux-perf-users@vger.kernel.org Subject: [PATCH] perf script: Skip dummy event attr check Date: Wed, 31 Aug 2022 14:40:41 +0200 Message-Id: <20220831124041.219925-1-jolsa@kernel.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hongtao Yu reported problem when displaying uregs in perf script for system wide perf.data: # perf script -F uregs | head -10 Samples for 'dummy:HG' event do not have UREGS attribute set. Cannot print 'uregs' field. The problem is the extra dummy event added for system wide, which does not have proper sample_type setup. Skipping attr check completely for dummy event as suggested by Namhyung, because it does not have any samples anyway. Reported-by: Hongtao Yu Suggested-by: Namhyung Kim Signed-off-by: Jiri Olsa --- tools/perf/builtin-script.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 13580a9c50b8..304d234d8e84 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -566,6 +566,8 @@ static struct evsel *find_first_output_type(struct evlist *evlist, struct evsel *evsel; evlist__for_each_entry(evlist, evsel) { + if (evsel__is_dummy_event(evsel)) + continue; if (output_type(evsel->core.attr.type) == (int)type) return evsel; } -- 2.37.2