Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1151201rdh; Fri, 27 Oct 2023 06:17:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHD7FnorFhYgOmaQEsNgLcRDwOMS5Lrp7xPdEA+5CiT3Bgh4d4yOVxyYKV9/MRGUBzoLBX8 X-Received: by 2002:a05:6870:d694:b0:1e9:ee04:d20 with SMTP id z20-20020a056870d69400b001e9ee040d20mr3271157oap.54.1698412624186; Fri, 27 Oct 2023 06:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698412624; cv=none; d=google.com; s=arc-20160816; b=kZuXZ8ov7zrvzVlosLEYWRxvJ0PCSaDmCoa4BIOBY8KrXdAcQUJ7jqYT0phCrFcaMc xYXdMI+cmwdvnHhhExZgTQ03gqud/QBtiddri/l4bzJA4CnPEq1QKd8LKzNNk9BrW4bk /gCTq7C9WqcWPevFEtNIN+46EihiNagrP7KZ9sokj2zOsyWJ2lILo3ktPzFM6qS568xJ HxSrr4wHQnMt/zGxhIgEqIMlZuTNbLGCv+H7mFw+LYRwOK5PlT1A9MOWTBZaKmnJDC6y 5RKadmmvtOXG8o5PimEYaUGGZlqISg48CY8RdMZudSu9yfA+i0z7NkQAoRTHqQJxSz9Z NBEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=jwt9hayn6vPrZcnYrZKtCafofLuWqxGIW6u1vLVnfqw=; fh=hNrfQAbYh3Z2DJEENGJHk2DI4zZ1Z/35CV7+DFUZfaE=; b=H6u3snstKBC4oKELWLoF7vsZhTu3+a6BDnczNs9xdt6V7F7e9TE+mJPzoqvw1JDEmt c+ZDDEoOslKmG0H1uZJXyAVzpV8NcvFyA1L3bGeOPklXZzxJPme4GOOA6hviB5gHsHAv CodxGRVzs3iAaoCHi76mg5b4Hu5qggj8PqKau9cZZuThMUUPbh7sfj0Ud0Yv7S7ktAvI 1qY/dVmDcgkzNyXDC3XbDIgTZ7qsdsY7jVrX39Ywic3Mt1JdrBTLhfx2EaEEtfk1VTeJ MXlGH0yUDYi4VD88hVvroGlbOnP8j4fLChZjGAIsYgNVA3gv+e0AV+Vcs/+CpaEd5Dto FsSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Iwgz/+oK"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id r4-20020a05620a298400b0076f117f54e2si643136qkp.668.2023.10.27.06.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 06:17:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Iwgz/+oK"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 07F5C830C334; Fri, 27 Oct 2023 06:17:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345872AbjJ0NQ6 (ORCPT + 99 others); Fri, 27 Oct 2023 09:16:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbjJ0NQz (ORCPT ); Fri, 27 Oct 2023 09:16:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17B25C2; Fri, 27 Oct 2023 06:16:52 -0700 (PDT) Date: Fri, 27 Oct 2023 13:16:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1698412611; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jwt9hayn6vPrZcnYrZKtCafofLuWqxGIW6u1vLVnfqw=; b=Iwgz/+oK17eCxS4aiBIBOsriJEXa5rwVGqszG7FwC2Mwz4BJSgJwMRjEEOzPcfjiVzaV0J hoUpqDhTEYtqIgn8l8EIx3JPmMOiF8wB5zLnEMFkxkH0nd1efvlRDy8kjKPvkfHlfrJSbO xU3KKhQC7445PmCZXXS+2k8ToM93S5FposJhKCflZZ/vmQjRH25/laXLKJnfRZLNbhy1MI uWhdW16zKxgfDijveNj6/e1qSI9fZqX3pwuGhAS7pzffktB0zwwgKGOATSNbZFoEe94F46 L+OVCwS+ArfQUH/uruo1PyL/5qNdZ+EFyTYUXjUR19Bq7jwshrzEBwsUX0he7A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1698412611; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jwt9hayn6vPrZcnYrZKtCafofLuWqxGIW6u1vLVnfqw=; b=s35mDTwvw0LlKVIdhgporScUKzdR1r+raO7yMW1v2UlZxqv+FbLgGQJd5SE95eSu5GBoeV v4cA8afz2anyfEAQ== From: "tip-bot2 for Kan Liang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf: Add branch_sample_call_stack Cc: Kan Liang , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231025201626.3000228-3-kan.liang@linux.intel.com> References: <20231025201626.3000228-3-kan.liang@linux.intel.com> MIME-Version: 1.0 Message-ID: <169841261085.3135.9502675795859035116.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 27 Oct 2023 06:17:02 -0700 (PDT) The following commit has been merged into the perf/core branch of tip: Commit-ID: 1f2376cd03dd3b965d130ed46a7c92769d614ba1 Gitweb: https://git.kernel.org/tip/1f2376cd03dd3b965d130ed46a7c92769d614ba1 Author: Kan Liang AuthorDate: Wed, 25 Oct 2023 13:16:21 -07:00 Committer: Peter Zijlstra CommitterDate: Fri, 27 Oct 2023 15:05:09 +02:00 perf: Add branch_sample_call_stack Add a helper function to check call stack sample type. The later patch will invoke the function in several places. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20231025201626.3000228-3-kan.liang@linux.intel.com --- arch/x86/events/core.c | 2 +- include/linux/perf_event.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 40c9af1..0905064 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -601,7 +601,7 @@ int x86_pmu_hw_config(struct perf_event *event) } } - if (event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK) + if (branch_sample_call_stack(event)) event->attach_state |= PERF_ATTACH_TASK_DATA; /* diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 7897ef0..ac1a59c 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -1144,6 +1144,11 @@ static inline bool branch_sample_counters(const struct perf_event *event) return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS; } +static inline bool branch_sample_call_stack(const struct perf_event *event) +{ + return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK; +} + struct perf_sample_data { /* * Fields set by perf_sample_data_init() unconditionally,