From patchwork Wed Jan 18 11:37:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 45202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2304716wrn; Wed, 18 Jan 2023 04:20:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXta4Dqlj5kD8+pBip/ebsHzocGdebkOj/QVfhkl5CZn0fESG350BEMtPV6WeNEeXFHBLAOC X-Received: by 2002:a50:eac3:0:b0:499:b48b:2c3 with SMTP id u3-20020a50eac3000000b00499b48b02c3mr6628765edp.25.1674044411877; Wed, 18 Jan 2023 04:20:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674044411; cv=none; d=google.com; s=arc-20160816; b=QGw7bI0ttzcBqokOMpYJ9Ji0ixToCoDRt1I2Vwmoqv0jpWFlthOxWcv7IQyUTUO2yC UOLUTCVFA6s5+PpGWdTkJiy2Cixc76bO//LdMB7r2KMaGEgnvbzE2YfXkvSW4MtT6pVO wrQGNm5JdvugWbPQ5AyiUAjL2mi9F4LH7YYAfTUowKeoaa1it/Tn4ygrIO8+LiBtL3QG IqJgSSq+EzrHs0FJiY12lOascCuudXHUbxCnXDxqX7+llhwcRD3RV5+nJmhRCJ4OnTZg 9aIbw/5MgV82qmS8LShjiL62aIir1gYhAP/EX7CUopOOattjOw0xY68Rj9ahzhq6U9ZJ v44A== 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=oc6LSVj5uaQ9n8lKpp69By84LMttGwGUBFJoT+Qh+9E=; b=yFqieFrlh0KQ4FEsqL1nAz+sLjpip1E6F66XNOIilKZ9zb4y19WI6cO2p01msTqZFC +ruDJrHb/8vHDSs69e2s/vxlHs+JvS4jvxbmd204+sD/DcPPgosNefJ5J9v5nXgHhiK5 3oZVJJEGxF4MQcX0JnFUtZJwsG+DtgMugumJ5TtHR0h3FVAKcCGqPvEJVJJhqlg4aXZj Yjiy1EvPYsVkHW+1NAgldsNK4okSeoTHTfDnGT94ta6nAUYWqPToXTkOXr2lAQVurayn +jeoC/aVcqekPPJ+d3pEDsz0zYSSynEfhHM4vBtXw94xXAIaFMtihEbyBjSvVyokMjfQ 0gEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ednBWYIG; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="xZDr/NjE"; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a056402084900b0047d1cac0428si45067386edz.502.2023.01.18.04.19.47; Wed, 18 Jan 2023 04:20:11 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=ednBWYIG; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="xZDr/NjE"; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230360AbjARMQh (ORCPT + 99 others); Wed, 18 Jan 2023 07:16:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbjARMQF (ORCPT ); Wed, 18 Jan 2023 07:16:05 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7387B875B6; Wed, 18 Jan 2023 03:37:53 -0800 (PST) Date: Wed, 18 Jan 2023 11:37:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1674041871; 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=oc6LSVj5uaQ9n8lKpp69By84LMttGwGUBFJoT+Qh+9E=; b=ednBWYIGF63iNsMBPIBAy4uHwxgbk+WciCKC7rsJ1izsVMnELa/RF0AKmQ3Z8CpqtbAa4a H+Z/VfZaMBnMPeqBEjUVZaW5ebwmZN3Oulh1UdJjGRvoFn1dWvzlY5dW2baOw7R0I+rAX3 sy+ulgqkUus185nNjHUsaBfx9dFlA6eaR+K0pPqBYNzRPBApogBLw86maa/xPHCy22VKXJ en2Nt8PtRljcfQAlF2Cz5BAChilkDBIvSGT5s+LWDuPXtG6S7sZZveZliArl7WIiHocTOO IGNOocALMQjj7WrB5MyFl/a14TG90faIuTP7IN4ZYnD9Z1u+Ej93a0aYPP5Mbg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1674041871; 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=oc6LSVj5uaQ9n8lKpp69By84LMttGwGUBFJoT+Qh+9E=; b=xZDr/NjExB8Lle79hTpslsVVdyFPbfTfPU9oSCYwNRAuQPFDuA7wf2g7Ctu8Nt6gsh6Wv4 JJlnHIOai25ZMVDQ== From: "tip-bot2 for Namhyung Kim" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/core: Do not pass header for sample ID init Cc: Namhyung Kim , Ingo Molnar , Jiri Olsa , Song Liu , Peter Zijlstra , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230118060559.615653-7-namhyung@kernel.org> References: <20230118060559.615653-7-namhyung@kernel.org> MIME-Version: 1.0 Message-ID: <167404187141.4906.14797462329290153602.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755362792821725938?= X-GMAIL-MSGID: =?utf-8?q?1755362792821725938?= The following commit has been merged into the perf/core branch of tip: Commit-ID: a7c8d0daa87581cab8435c83cc6ecbfbcb8b60cf Gitweb: https://git.kernel.org/tip/a7c8d0daa87581cab8435c83cc6ecbfbcb8b60cf Author: Namhyung Kim AuthorDate: Tue, 17 Jan 2023 22:05:57 -08:00 Committer: Ingo Molnar CommitterDate: Wed, 18 Jan 2023 11:57:20 +01:00 perf/core: Do not pass header for sample ID init The only thing it does for header in __perf_event_header__init_id() is to update the header size with event->id_header_size. We can do this outside and get rid of the argument for the later change. Signed-off-by: Namhyung Kim Signed-off-by: Ingo Molnar Tested-by: Jiri Olsa Acked-by: Jiri Olsa Acked-by: Song Liu Acked-by: Peter Zijlstra Link: https://lore.kernel.org/r/20230118060559.615653-7-namhyung@kernel.org --- kernel/events/core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 7135cb9..47bfd99 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -7054,14 +7054,12 @@ out_put: PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID | \ PERF_SAMPLE_CPU | PERF_SAMPLE_IDENTIFIER) -static void __perf_event_header__init_id(struct perf_event_header *header, - struct perf_sample_data *data, +static void __perf_event_header__init_id(struct perf_sample_data *data, struct perf_event *event, u64 sample_type) { data->type = event->attr.sample_type; data->sample_flags |= data->type & PERF_SAMPLE_ID_ALL; - header->size += event->id_header_size; if (sample_type & PERF_SAMPLE_TID) { /* namespace issues */ @@ -7088,8 +7086,10 @@ void perf_event_header__init_id(struct perf_event_header *header, struct perf_sample_data *data, struct perf_event *event) { - if (event->attr.sample_id_all) - __perf_event_header__init_id(header, data, event, event->attr.sample_type); + if (event->attr.sample_id_all) { + header->size += event->id_header_size; + __perf_event_header__init_id(data, event, event->attr.sample_type); + } } static void __perf_event__output_id_sample(struct perf_output_handle *handle, @@ -7577,7 +7577,7 @@ void perf_prepare_sample(struct perf_event_header *header, u64 filtered_sample_type; header->type = PERF_RECORD_SAMPLE; - header->size = sizeof(*header) + event->header_size; + header->size = sizeof(*header) + event->header_size + event->id_header_size; header->misc = 0; header->misc |= perf_misc_flags(regs); @@ -7595,7 +7595,7 @@ void perf_prepare_sample(struct perf_event_header *header, PERF_SAMPLE_REGS_USER); filtered_sample_type &= ~data->sample_flags; - __perf_event_header__init_id(header, data, event, filtered_sample_type); + __perf_event_header__init_id(data, event, filtered_sample_type); if (filtered_sample_type & PERF_SAMPLE_IP) { data->ip = perf_instruction_pointer(regs);