Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp190956lqo; Thu, 9 May 2024 17:39:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV0/5JbxIUNCAHDUQN88PvpCYW/KRpc5mmcSSaPGi6UNR3OMV+fv9YKuTO+Yo+De3NMFps0bbSkoqWho5yOYJqWzvTizptdUXJfzqEiBA== X-Google-Smtp-Source: AGHT+IGIM7hXTwbWcdiqnbMiyYfDS2VIIKs/c0Z+47+aEOCbvjiQYvEbtCKwCeW4TTLX+sO5sO39 X-Received: by 2002:a17:902:ccd0:b0:1ef:442c:a023 with SMTP id d9443c01a7336-1ef442ca12bmr16657225ad.38.1715301576827; Thu, 09 May 2024 17:39:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715301576; cv=pass; d=google.com; s=arc-20160816; b=07EhgiOmBeujOsRoruWqQRwjkDzqQV6atixi8LZYZrtJa6iQSjveFY6XA4ssszF/ny gBz2NH88wBR5bkx27ls9yTou/b8t9NF2QrGnwrSiSvw2EzTIIOHT0cJzF5cIejQ8L88o LocCFnlskLIKj3Grc3MKusyCm0rp/CMR+GuSpxBuyayTrfm5qNfGwwW4yInoSb8/vAfh YANgHwG9YHGppXCDqELVKPXd8Y16u9shM+a2IMDY4sg7ncWvo4GlEON9E5PpArB2XfWz Jrdg2+ZoJIdZMC+/DaaXzNSu5vCM/NAu8TjF3u6P5LHbBOwNruXSG5nRLNEd1ZyTuhIS TQeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=6eqm/BqIluFQHvpRuckwNPKwG5hWXwTVWnnYkmrJGUM=; fh=QgIVkpRq41GOQB4puhz2AgA7Sn5kCRqbO0mVwllpTBU=; b=uXJDHaetr2ZZgGopnvqJHML0RRZZfjP7SBPD5HflvrG57H2QNg6TkvAabtLmYLdxXa NUB4yJZvFE5s/Jpa7xjlieLPIFwqwCCaDgtg02/4GCgyLSc2YdXwcXJP+gzm/TXYePsb u8fTsASPU0LTk4YB7my57nr2vY4kG1GX0RDVm5TI/9ePVC5ZTcCYTgx5LSJe0iMaFhkE pT+QDOOeae9UhLEBVg0ififxKyuhphm/PRz04VOyfU2EqomQAAq19OAB+TQ1NqSaBSLJ Mg8c7LButW6Su7vyG4dmsAZPStNNnhsWJ06iwHAW6I7lY3ApFmlo6xKoGWWVPRM++sfT p8GQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Q6oP6eX2; arc=pass (i=1 spf=pass spfdomain=flex--yabinc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-175171-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bf31aa1si3043695ad.275.2024.05.09.17.39.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 17:39:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175171-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Q6oP6eX2; arc=pass (i=1 spf=pass spfdomain=flex--yabinc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-175171-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B5261286478 for ; Fri, 10 May 2024 00:37:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FB9F179A7; Fri, 10 May 2024 00:24:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Q6oP6eX2" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCE805C89 for ; Fri, 10 May 2024 00:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715300683; cv=none; b=mgA79+r3vBpOympOeygA4aM3JdQ8CPAgRg2wlmFEXf+/PYZcF3NEuI6o2s4XQegvHq7WVsGDbTvNvu66bzbXuu91APY9Ct3f2B54WGfuhEbLhBAJi24fLFOeEUFtnxnZ0ZJjCRJ7n5nb99srRQmqR8orJ3K5qh/ZozMHEjdGE5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715300683; c=relaxed/simple; bh=EavCetVSCgCq8a1RaVsXoOaflK2PYWCs6cIGsY45SPs=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=PyvUB+xeZo/Pwm5KNks+tEuT9ibIGh1e1CT9JvFEZHVYUC+4jwxCdyT+22Tld6ADNc4kgrYJ2CjrjlB1l7Lnc6V2NT+AUYtCEeqkM5kAUqdry0oR7OMVj4zdF8mdHPAp61kiKyIhBZTMQEu9/DpjA7Q2sDwjINkn1n4zLk2qaKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yabinc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Q6oP6eX2; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--yabinc.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-61bef0accddso29973317b3.0 for ; Thu, 09 May 2024 17:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715300681; x=1715905481; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=6eqm/BqIluFQHvpRuckwNPKwG5hWXwTVWnnYkmrJGUM=; b=Q6oP6eX2EIg9SP1I0c1rti1vPfhT1ZObGGUb1pfzKVkMS39ZugHbj+zCZzGU2pqKLp QIDQo3ODwrvmjaxT9hftZeLGvA+qfWYTnvFNzYTXmCKqe817XbG/5HcM1VswKYQin8R5 qrmHmouRUiGyz6g3jIq0IpsKMidRf6i8ShKx+fIpVdqz0AoqnfdaN2jCNqgssErcjuUp ui8pas8lprR+rKq8F2xlFjy5TLVeYLj3zumCNz8JWN39TjoPuya2eIFXE9ZIseDwTSXv 7TY/sCogBvsKnQ54qEVVHhbDlr5cejO8CQ5/A/AkrOyEpkWTU4139dCBPvv2OmBJtRJ4 QpYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715300681; x=1715905481; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6eqm/BqIluFQHvpRuckwNPKwG5hWXwTVWnnYkmrJGUM=; b=uotFX2sp0QayW8Wbl92cJZNka5lhNL/Q8so8+++4bvmAseHLxCow89TI0cHoTS5ycl B63yl5G5vwUzUeNmbNsdi5EIU1gQlchZJeSacxtgwh4zSi7n9G5ivtlWqmQvEKgPOIba PEWo896mclKxjp1b8g6GPAwlKlO2wGfQG3cWdiVbpBaE4Qrc1dO9mI4IxsjQOcX9dUKt KU6kHNoysIgqIh8CmgLRvwrgGx4017/mlEyb0DtwCBLxT1vRKhGsYHDrBVUqA2oAdjdB xhbah99MW6dJh9RS5RuEGzOez/df8Tt+xFkxm+6f81T5sSIbRePRYn93dI4OCRDNLSSA cNVw== X-Forwarded-Encrypted: i=1; AJvYcCUW/SSUuJEP2USA+1zZ85vEpNUJroCyg2euTmun0N8h73xi9loeGtUKDCYW59vr0JOi74qda45bbFoDmZ9HexqaNDVQx2ZTKi0sxWXv X-Gm-Message-State: AOJu0YxuO7SCwYRs928mhttX1/Nn8wChbsl9mA5CaRceJ/mtNuevu1jY aBL+LrxxjcMSqKwftSMdd9IcKCzX0vnXk1CM1atKHnFnpt9NbKXP99qFLn5A1y4b4Sv53MKFOaV S X-Received: from yabinc-desktop.mtv.corp.google.com ([2620:15c:211:202:1b7d:8132:c198:e24f]) (user=yabinc job=sendgmr) by 2002:a05:6902:1002:b0:de5:9f2c:c17c with SMTP id 3f1490d57ef6-dee4f37bbfbmr295036276.9.1715300680883; Thu, 09 May 2024 17:24:40 -0700 (PDT) Date: Thu, 9 May 2024 17:24:21 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.45.0.118.g7fe29c98d7-goog Message-ID: <20240510002424.1277314-1-yabinc@google.com> Subject: [PATCH v3 0/3] perf:core: Save raw sample data From: Yabin Cui To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Yabin Cui Content-Type: text/plain; charset="UTF-8" Changes since v1: - Check event->attr.sample_type & PERF_SAMPLE_RAW before calling perf_sample_save_raw_data(). - Subject has been changed to reflect the change of solution. Changes since v2: - Move sample_type check into perf_sample_save_raw_data(). - (New patch) Move sample_type check into perf_sample_save_callchain(). - (New patch) Move sample_type check into perf_sample_save_brstack(). Original commit message from v1: perf/core: Trim dyn_size if raw data is absent Yabin Cui (3): perf/core: Save raw sample data conditionally based on sample type perf: core: Check sample_type in perf_sample_save_callchain perf: core: Check sample_type in perf_sample_save_brstack arch/s390/kernel/perf_cpum_cf.c | 2 +- arch/s390/kernel/perf_pai_crypto.c | 2 +- arch/s390/kernel/perf_pai_ext.c | 2 +- arch/x86/events/amd/core.c | 3 +-- arch/x86/events/amd/ibs.c | 5 ++--- arch/x86/events/core.c | 3 +-- arch/x86/events/intel/ds.c | 9 +++----- include/linux/perf_event.h | 10 +++++++++ kernel/events/core.c | 35 +++++++++++++++--------------- kernel/trace/bpf_trace.c | 11 +++++----- 10 files changed, 44 insertions(+), 38 deletions(-) -- 2.45.0.118.g7fe29c98d7-goog