Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp178146lqo; Thu, 9 May 2024 17:05:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8XTCbHJkUcYwsvxzsAedKZy+Fxsbjun0rUB96W4plNeXZFdJgI+Trw6ZxhVMEmUN+pYVxrL9LeOxrELtctSQSO2cvHN09ETawxRWW4g== X-Google-Smtp-Source: AGHT+IGJyu14O18dKFpqu52XlCKS48tscNdnp7kkY+gJ6tL/aGI63Fx8+9L+ELK3oA3O+05iLKHE X-Received: by 2002:a50:8757:0:b0:572:cfa4:3ccb with SMTP id 4fb4d7f45d1cf-5734d5c1352mr740907a12.8.1715299518096; Thu, 09 May 2024 17:05:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715299518; cv=pass; d=google.com; s=arc-20160816; b=qL2BRDewxuN6FoaOK7ndkb51Ab3cnz6jYCDP3yX/6MMy30d69n2b3GihwrUNk6OZD4 Q/IO35Cz+IudUyVvV/bbI1k53DS7RSZrndLLpeAOLunsTb9hcc5FV5Wp4CuoPl7MpUFV LrLkCXWQx2a1O3Iufp4sDQT1e486z8Ou/EkQbkYTA0mIZS0ui3++UAiaP8ZZC6ZYadSt vX2EwUGFikM3hznY9WRpMEqHePgoqMYMtT9SjKm93lxO9m8IbuDaQjSevYcTLkQDTw7N JlSHSiXhxufyjFxi9d7XrDzAKLCM0xQjtLqsAFOnfsQ6ECjt50zctKqktLSXrbhs8NwM TKCA== 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=XAFxshksMYwnQtcvHl5w5EbwyrvtP0FPHqgj3EjEBuk=; b=ogBkG49xODSrW4B+G+i+cJB0p50M2+o+BQZrVNzQaL6W/+U7HcqWsyKyVxuVyBvvW7 VdE8B6ojucfeVdEi3WvD2rrLfuoWu47Eh0xh+/9YIPHHG8qU9sVDM5fR1r/KroiokiG6 nSMduef8QCVDLS4iarrke4B8ZUCIR606CubEfwCj+w2TWHIOeLRxv9f6BiiyPTG3CCu4 /I6Wc+Dz7GvYP29gm0hr8O0fF/TJvJ6a/RtuDr1rv5U2fWhM9MKwK4v5dCVAI1OB7m9z w4jhCNrHHpc7KbGuX32Wv8aTEppcYVmj7EtGA5b2i+K7TtbqgpgHvdpy64FoCO6LdbUl yCFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=V4Rr3vEU; 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-175089-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175089-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c3782d7si1338456a12.634.2024.05.09.17.05.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 17:05:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175089-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=V4Rr3vEU; 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-175089-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175089-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D17CD1F243A0 for ; Fri, 10 May 2024 00:05:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1010D20EB; Fri, 10 May 2024 00:05:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="V4Rr3vEU" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.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 B2EBA646 for ; Fri, 10 May 2024 00:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715299508; cv=none; b=NsrOUXKZLJr3ekqJWKSo8CaCD5lwUNeRVzTDvCRynVBH+X2UGISlfh2XK8vyDRTmfavo1GBd1Ls7tKoFWKZ/JEeWdtGcnRjQOvuPBaud7j8vj7LzfbR7U36DUCEDOKAAt1eHBGD4Y1IXuGAtUCm9KD/MQxbXBI/dqkw8xYpWKKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715299508; c=relaxed/simple; bh=EavCetVSCgCq8a1RaVsXoOaflK2PYWCs6cIGsY45SPs=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=F7UHEg+Dm/69bIsgbvV8yLRkcDuXQIKd6G0m2qdJEvefBYAvFoTJ+ppelcxWE/kTUSz2+FBvnXx25pZOVeF1ftghUrZeNoWU4jkmvj8EtzDEJxXy/H21j1dAForNCO0VqqdyQT7eWXLmjMKYXlyCPNbrftaF0fTfwiO44CqqwRE= 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=V4Rr3vEU; arc=none smtp.client-ip=209.85.219.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-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc647f65573so2969043276.2 for ; Thu, 09 May 2024 17:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715299506; x=1715904306; 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=V4Rr3vEUcZWKPNh4YW0gJjYQr/4dOw5JseSRg5xD3YYEFpP0Xkw7t7/E+eZqVcO3pu 59E86u9ohhWvmP6ZovTTGoki4ra03h8dndP7byhPDoAikm3V835l40RqrOfAlD4PwASd ubtIoHXl0KU+6LgGLMaR0AQ2xRus6ooyVctjt1aAkfVIFdCjIQHd3XCSsLCOCNLQhrpP O4EweZ3Lu+EUcrk1j5vjDfUWxMJNRosirtE7GPMndqBN/nEJHd0f7Ik0Orfd0UvTy4XM UuivO139DEYuhS7TAJaQvEmFe7ynt3s2NDNkeZ474PQdDMqOEUqmXhNmaCaLmkHnfWwW YLsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715299506; x=1715904306; 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=SMQImFsaRRzHOLH11sct5Vqk+TamvPg4jIoaQbVU8QK0dFBgRZmsCTGcEMe6Ocr/vu HbC3Xa9nCqNJf9iMEnm3yFo/JgWxwr8pijGlzrsp0u1vHRn0EPrTOD4J52Fn2vjUk8mN buFN81BdupmNacpa7dXzXS7dPp2gRUBhZBxopOEo36FJ2doWv/sZQh/xYpSFcvYmfnqK 3hp78o2WTyCRYmBt7ozor95Uzv0SxcPBmORlH78UqzXm7lVjtqNUr9wTlRwV3GljfIpy e9fAKVyyh1AoMRapcF6oRhqW5ycdP/nBdTvbkpwiLxxFBQzjMfpGqLznUKInwAZ0ggtE 93oA== X-Forwarded-Encrypted: i=1; AJvYcCUQ1ja+2lnKmSi9afIasXP4sIoHinDQnAnxX3iqeep3C4R6feDP5SB+oPfOGz31fhoLW1hDVSi3BKG4NhE8WOi13WY40NK+RmK3z8TD X-Gm-Message-State: AOJu0YzYVk/LxwPLte1kvIz/BHaml8EITo6I9nNxmN/46rPFFrhzcNbn 9HXjhXRftOnP28FP+ZAV4G3xyXUfnoLPLCihWJEdwwiub5KAJG6N+/LDN6SLqPDKI85tLxI0bPQ X X-Received: from yabinc-desktop.mtv.corp.google.com ([2620:15c:211:202:1b7d:8132:c198:e24f]) (user=yabinc job=sendgmr) by 2002:a25:7486:0:b0:de5:2325:72a1 with SMTP id 3f1490d57ef6-dee4f192850mr277203276.4.1715299505730; Thu, 09 May 2024 17:05:05 -0700 (PDT) Date: Thu, 9 May 2024 17:04:59 -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: <20240510000502.1257463-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