Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3932805rwi; Wed, 12 Oct 2022 08:31:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4AUQ7OU8Cn3uP83xWM9AeyrvA4u8I42wA9ZmU0leajTa3F7lJT/+Qb5r9AGT7vL7XfC2EF X-Received: by 2002:a17:906:478e:b0:78e:4b5:a547 with SMTP id cw14-20020a170906478e00b0078e04b5a547mr262099ejc.81.1665588684970; Wed, 12 Oct 2022 08:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665588684; cv=none; d=google.com; s=arc-20160816; b=D1/rprkRaK7gu6I5AdrYj2jZWt12HnnmZ0bcgCERuwfev1Jl8rL+G7WDsA4B3m0dr3 29FB6nqS6nvVTTK94EnW6qKGspDm/nuweZ9Y6sfC7+Mgd8a9T/MdjHchRwkMA2QJ5Dog CNhORu3L6ivMOkHJ/LlvbB7x626AGSqObB95vyaRFDriAk0yIWrL5FANkwUGIqK/1Mqu dhtpxLIXDKwY2u1eU2Y7joXqdQxnb7HzufSEznhtTOnsVJfIQZvt6L8tavLXZVjB2q+Y Tc0BGM/f+wJhbClgNbAET5KfYWH1ZDefSRaSt3oGoEH6joV0meYJ5IR6XOhNF3g5pslY 2EMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=GFbp/K0aMKZi9jGh7zOx/P8f7fd3BLJphBt2xIaa38o=; b=Dr830g+vQAuel3+K+KPiBIlQ8+cz8m5kr8YKJcCtsHA2d+bYRCMpVkp6GJG6nm9WOL eKw6fVoC/WMw8THhX8NGpxIuiJ2/wLDrYNR7weSN94sCR7vJdZ42vy+MAfzLcnOC1f2R TInw4KoOQMg6gxURh43nx/2jS8x4jFv0IknKRG7knt3155VLAo1EFO+CtNZTGlWy3xTX mJR2vePZmlTKpJTO0XddJMCQH1IEm076lW3pWP0RcXQWyOZ41nLEgcLEr2YyQrUDLsEU LHQsXjLhQ7XTkTP671BA5RnGut3tOmBZ35TSXdf9a7Oo8Y2wsvzEvlMfY/EKrLG+dI+T g2gQ== 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a056402430d00b0045927e95c88si18685507edc.282.2022.10.12.08.30.55; Wed, 12 Oct 2022 08:31:24 -0700 (PDT) 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbiJLOjQ (ORCPT + 99 others); Wed, 12 Oct 2022 10:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbiJLOjG (ORCPT ); Wed, 12 Oct 2022 10:39:06 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 08E844DF0B; Wed, 12 Oct 2022 07:39:05 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 05DE5113E; Wed, 12 Oct 2022 07:39:11 -0700 (PDT) Received: from e121896.Emea.Arm.com (e121896.Emea.Arm.com [10.32.36.24]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 67A133F792; Wed, 12 Oct 2022 07:39:02 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, peterz@infradead.org, namhyung@kernel.org Cc: linux-kernel@vger.kernel.org, James Clark , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa Subject: [PATCH] perf: Fix missing raw data on tracepoint events Date: Wed, 12 Oct 2022 15:38:57 +0100 Message-Id: <20221012143857.48198-1-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 Since commit 838d9bb62d13 ("perf: Use sample_flags for raw_data") raw data is not being output on tracepoints due to the PERF_SAMPLE_RAW field not being set. Fix this by setting it for tracepoint events. This fixes the following test failure: perf test "sched_switch" -vvv 35: Track with sched_switch --- start --- test child forked, pid 1828 ... Using CPUID 0x00000000410fd400 sched_switch: cpu: 2 prev_tid -14687 next_tid 0 sched_switch: cpu: 2 prev_tid -14687 next_tid 0 Missing sched_switch events 4613 events recorded test child finished with -1 ---- end ---- Track with sched_switch: FAILED! Fixes: 838d9bb62d13 ("perf: Use sample_flags for raw_data") Cc: Namhyung Kim Cc: Peter Zijlstra (Intel) Signed-off-by: James Clark --- kernel/events/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/events/core.c b/kernel/events/core.c index b981b879bcd8..824c23830272 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -9759,6 +9759,7 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size, perf_sample_data_init(&data, 0, 0); data.raw = &raw; + data.sample_flags |= PERF_SAMPLE_RAW; perf_trace_buf_update(record, event_type); -- 2.28.0