Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp879553pxb; Fri, 22 Apr 2022 13:17:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFEOFzCFqkxFBWUF7Vqm3ZWJlhr3GYcBG59NDQ/vhGT+TYpH6MBMENg2GgWfjXA8wccGwe X-Received: by 2002:a05:6a00:1702:b0:50a:8181:fed3 with SMTP id h2-20020a056a00170200b0050a8181fed3mr6626947pfc.60.1650658646241; Fri, 22 Apr 2022 13:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650658646; cv=none; d=google.com; s=arc-20160816; b=zo+yQhz47vO2qGeXMUSaeO1KcTgGPtLPFNdmSMNCONnemEoZ9mxWlPR1VU9pFCahrZ Iv/JiKKffffiTTnzCTH0BKjtcb4ecHlUx3/W79XkZUmpz29eNcIGdDuLZANRpdQcn8Y7 SUavB8AHS+Nxpna8S3tNKM6RvUz57+qQzAs6PK8HY4QWoPmdCskW5T2rsaOaOzfxHuzU twGge4iVspTCBIdBxjqHhd1GdB82czA7NTZa11w6ufbNGUYUy93kFIH1Mpf3yyyqF2Jd ARt/P14DY5XICMIw24gO0jHnCsrr9jgcvo9ZQBro6aWZEktH/qYCmKaqxhfmAxLV0I6L bWdQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=wqQRIgQO3ULhYUlV88GiQPjDyhm28U+v+Mde/WfWJ9Y=; b=FqXi7Al2SM4ji8d4uMdAoY+R7Vixg57JxgaNFo7QDcYAz7pkxtlmH+YP+uDRZQX7ny YRpJbXACHa2ZoIQE0r4YMCsFbYtWbCAjQ6YcRcoymVtGMsw8HWP5cqXTkRUG3lmJbA7r zYvL2rd8t28FuPaY59+76n1btXX7/zso/LbGBaQCoxz5dNcefUzVB0v2V4hijKJMzDLq n8Tm17jJkGv9umVyD2PKDxhzi7NJDrLI9UrVpd9X/a96Kb/xcZhJyrcDOP2qNjGkmoN5 CVqjrwAI8K0V10oXiFVn0vanjFZ8TDtjQNnwrl/IzC+xDyBHgfkGnJGHfkyQEJfTJ40X Fl4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qqEoI8eo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y19-20020aa78053000000b004fa3e2a9b13si7879733pfm.378.2022.04.22.13.17.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:17:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qqEoI8eo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D5B7293F57; Fri, 22 Apr 2022 12:20:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232671AbiDVFlT (ORCPT + 99 others); Fri, 22 Apr 2022 01:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444170AbiDVFg6 (ORCPT ); Fri, 22 Apr 2022 01:36:58 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F44D4F448; Thu, 21 Apr 2022 22:34:05 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id h12so4830011plf.12; Thu, 21 Apr 2022 22:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wqQRIgQO3ULhYUlV88GiQPjDyhm28U+v+Mde/WfWJ9Y=; b=qqEoI8eo8BjZkhFVwnf33n6mNuwkFG3qjyshIpZsVXo8tMiLniU0/PIaAOXuFvRYSz 8/vazd6OKW5VyOzzIi9NrRELj5I2osHK54ZJLG8EMuHZo6Ewn2tJyVW4UTzMlJEDmhE9 piEzbIny8mf4BoAhdE9EB0tS58Kqq1Q56wkjVyRtGOCOqgbl3fHB/QZQHeRxLXtMCoDz LcUNK1m2KgZo3TigsdmMQyfNI0KYZyYF9uoh8xZ6AQxUUazZcaNxGRBZ+gomGK5A+kP1 KTkHwvio0yar95EvFY5gjd173eXGR3xBi/sX3JijPVk5De/E+vR07UzO4I7U0lVVvFXq SpPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wqQRIgQO3ULhYUlV88GiQPjDyhm28U+v+Mde/WfWJ9Y=; b=btpDOr/pmtQLDDh+dNA2XdzzN85ipT3VLGzg7kIdODNZN7lUAlFiByu11DoZsNIjpl u/xn6VBq+S5wYZqLdY4tCuDBk8e6UM6sTbINC7FoFnh2JVGsXAUDbYVsd4hJyPmyjczP hexAwQxh4zFbtdp/u2xMlMJl/sTqirsLjmxTV7ZBCyv6b9lCtjnGgaSJQV6wLtkqQi0a VY+TbDxwQHcj8PBkfx6opBWI9k6vH+mjOuFDmHgNe1hsu3fUdaoqwJjPYPsHJpRPuW1p 5jYUMzEkILcNxgT4QGrGdCPRFp06veqvIKMVsyIjhMr9cZct1VZ4hA6HcgCCCDCW5jBa 6lTw== X-Gm-Message-State: AOAM532WwB1w1vyfqqTXXLGkYxBqxmTi9PcC1hVduXY0u6EIoXCj3Cce 4BHEPJJoG9kae4VBhv82Cq0= X-Received: by 2002:a17:902:aa06:b0:158:f13b:4859 with SMTP id be6-20020a170902aa0600b00158f13b4859mr2812716plb.141.1650605645099; Thu, 21 Apr 2022 22:34:05 -0700 (PDT) Received: from balhae.hsd1.ca.comcast.net ([2601:647:4f00:3590:32e3:a023:46c1:80cd]) by smtp.gmail.com with ESMTPSA id 204-20020a6302d5000000b00385f29b02b2sm886519pgc.50.2022.04.21.22.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 22:34:04 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ingo Molnar , Peter Zijlstra , LKML , Andi Kleen , Ian Rogers , Song Liu , Hao Luo , bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, Blake Jones Subject: [PATCH 1/4] perf report: Do not extend sample type of bpf-output event Date: Thu, 21 Apr 2022 22:33:58 -0700 Message-Id: <20220422053401.208207-2-namhyung@kernel.org> X-Mailer: git-send-email 2.36.0.rc2.479.g8af0fa9b8e-goog In-Reply-To: <20220422053401.208207-1-namhyung@kernel.org> References: <20220422053401.208207-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Currently evsel__new_idx() sets more sample_type bits when it finds a BPF-output event. But it should honor what's recorded in the perf data file rather than blindly sets the bits. Otherwise it could lead to a parse error when it recorded with a modified sample_type. Signed-off-by: Namhyung Kim --- tools/perf/util/evsel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 2a1729e7aee4..5f947adc16cb 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -269,8 +269,8 @@ struct evsel *evsel__new_idx(struct perf_event_attr *attr, int idx) return NULL; evsel__init(evsel, attr, idx); - if (evsel__is_bpf_output(evsel)) { - evsel->core.attr.sample_type |= (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | + if (evsel__is_bpf_output(evsel) && !attr->sample_type) { + evsel->core.attr.sample_type = (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD), evsel->core.attr.sample_period = 1; } -- 2.36.0.rc2.479.g8af0fa9b8e-goog