Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1399759rwb; Fri, 13 Jan 2023 11:43:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXv0+HLbkqdPCir3pzJyKm+nU+bmsXNi26GtWGwNHI8wbZZyOTnWdN4niveR20wl3cOPM4Ub X-Received: by 2002:a17:90b:3017:b0:228:e0c2:b0ec with SMTP id hg23-20020a17090b301700b00228e0c2b0ecmr12219226pjb.6.1673639033061; Fri, 13 Jan 2023 11:43:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673639033; cv=none; d=google.com; s=arc-20160816; b=Wf5BFRhhl3QZAyRoL6axVjWfKDGN2DNJayEA05QEf4k5f6b/i9ldyI4SFwAI2f3wKu zs5SkrJ4+EM3j1CyMooirvNThCZphWaJTLNNv1sTxJ+Ulpw1Ng+FRoCYZjg3GPzNR5ke VcElL/UBljsTffhT4LyOEL43ABfT51RtkeoIojB8M9i1TI0iWsmiM7vmEBFyl+6S4dwq nN7QZzDfxLeeBzrN7U7z6bTi2TVUA+4sDSaW2cx5/+90lHRSe4Dr/Phy4Xn3aH4T/gEq rqnQ6FHsVLs0XZ07o6i4s84qw7bleJw3h9tJDXvXD+ie1wyXRVktdXAN6YCMeMoBUZi1 2Yog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=E8V7kGrFEMEHWVSu1h0mjsTnmEFIOwHC9a9fBG7LGhU=; b=NTELjmfadDIeD0cSy+jsRkLTBiK3rJRssFv76/6D9qRXET9zpLurNUG/L01posqpTa 9omuCARuMuP+FIa8qlC1MfUy9QZkm3WWhp8KAOGysenHPgJ1Jq+Y4aQNLmrMJiV/s1xZ pd/3AH6lue5Hjsmxd/eag7vFs6TAf1Ko1GplpAt38Taxfsy9Bs/i9jgv+xNPT5Pp1qnp uPT1A3E7+tlm/arBiduD1/DvZTbfgwbx9v3Q2EQ/kv4UklsBMbQirvevuGlsEtv8Jkcr PxKp2Ari9JdRdJ29zBRWaUaV6Nmcge4LMauROWde4Fo/czFBaEVbdTnjyhTYVJv2l/Do 44lA== ARC-Authentication-Results: i=1; mx.google.com; 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 oc7-20020a17090b1c0700b00229219f7323si3484029pjb.4.2023.01.13.11.43.46; Fri, 13 Jan 2023 11:43:53 -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; 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 S229772AbjAMTda (ORCPT + 52 others); Fri, 13 Jan 2023 14:33:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjAMTcM (ORCPT ); Fri, 13 Jan 2023 14:32:12 -0500 Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FA5B88A25 for ; Fri, 13 Jan 2023 11:31:23 -0800 (PST) Received: by mail-vs1-f43.google.com with SMTP id t10so12651019vsr.3 for ; Fri, 13 Jan 2023 11:31:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E8V7kGrFEMEHWVSu1h0mjsTnmEFIOwHC9a9fBG7LGhU=; b=hr7cuqLE0gUK72WP1eEp5RyVblOszQKAhaSF6ri1gnroM9RFgYBgc7ocbiia8J+r94 10qOb3lD9DTbHszluNWBcezzVrKrYCTrCWCJE55mkUjAwyGZQ+JKaa0UTXvaUD2pV3ey opU3ZMGyTlmybQoB1tmJTuklz7iUI1jCBKA7Df2FwD7FbAMJP2LpfLTcuhvePFott+dE /P3RSl8jX13pHre0atqTNRZG22L/tZ/b8fCFAD6vqit51/zQJf4bZf3FfpDugzgTn8RI Ag5ATFLORtuHoOBGW6vQD6nDJXFyG6XqMj49WLu0KpDe5Hf6CwGiG+e6OkGP+SGqwzhR xtRQ== X-Gm-Message-State: AFqh2kpQoWkpOJiBlEmQa+ML6lmSrv+G3McXa5C7egr8tY7TRFeJHFhO RGA5Zatak5W2EaGUp2vipFQAeponhXx6bC6JiqI= X-Received: by 2002:a05:6102:160a:b0:3b2:fa7a:566a with SMTP id cu10-20020a056102160a00b003b2fa7a566amr11553441vsb.3.1673638282462; Fri, 13 Jan 2023 11:31:22 -0800 (PST) MIME-Version: 1.0 References: <20230112214015.1014857-1-namhyung@kernel.org> <20230112214015.1014857-6-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Fri, 13 Jan 2023 11:31:10 -0800 Message-ID: Subject: Re: [PATCH 5/8] perf/core: Set data->sample_flags in perf_prepare_sample() To: Peter Zijlstra Cc: Ingo Molnar , Mark Rutland , Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa , LKML , Song Liu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 On Fri, Jan 13, 2023 at 3:20 AM Peter Zijlstra wrote: > > On Thu, Jan 12, 2023 at 01:40:12PM -0800, Namhyung Kim wrote: > > > --- a/kernel/events/core.c > > +++ b/kernel/events/core.c > > @@ -7053,6 +7053,14 @@ static void perf_aux_sample_output(struct perf_event *event, > > ring_buffer_put(rb); > > } > > > > +/* > > + * A set of common sample data types saved even for non-sample records > > + * when event->attr.sample_id_all is set. > > + */ > > +#define PERF_SAMPLE_ID_ALL (PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \ > > + PERF_SAMPLE_CPU | PERF_SAMPLE_ID | \ > > + PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_STREAM_ID) > > + > > > > __perf_event_header__init_id(header, data, event, filtered_sample_type); > > + data->sample_flags |= sample_type & PERF_SAMPLE_ID_ALL; > > Why not update __perf_event_header__init_id() ? My concern was the non-sample records which don't check the sample flags at all. So I'd like to skip the write for them. But that's not a big deal. I can move it if you want. Thanks, Namhyung