Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4088564rwi; Wed, 12 Oct 2022 10:24:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JsHX7D3V3NoF5yWh//YW2zrtV8CYi3h82No89f1UKL8ojcXDFAj7/Xa++chSVDtIaiJFE X-Received: by 2002:aa7:c157:0:b0:458:8ef7:eaff with SMTP id r23-20020aa7c157000000b004588ef7eaffmr27608716edp.82.1665595462035; Wed, 12 Oct 2022 10:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665595462; cv=none; d=google.com; s=arc-20160816; b=ZLIFXi3GrxZYnJ+EaKb+aXx6NRFCyZuhuaJnDtbf5zoZwCGV4QoQmLC3ntxJgsG3H5 NrOMICIspdfAY/adBAdSHSuA8UENz/k8RHWuAvTw5t7yTBsVrW/i2uG9BjBmYnla34Ks z2MIIZuXldRv9RbnQAqv+476C6xdMDZlb7na2/+mLT1P2bh06WMIvk5bTaBinp2AQHAx IFKa53khrj3z1NyhaQWsKC+9zfkr1iHTugA62yC2lR5NZiYUO7CfxNlSW5KO4a0RvbfN 3797XvbUMMmV369dlbhA4W1YEspXFy4hwZhRPG2Euca0W6IdDG603GyPApWqrjjbpR8K Ti3Q== 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=S/5xq2x209F1HQNndofzRRLO7+fGWFD7vQy4M5xyyDo=; b=G9jeOBgZZkO7hqNykircLXjPuE1lCWV+UE8d5bbFHQ/hPDPv5oVwFofguwKZGQO1z0 R72Nx8XKNmR1gkAcmyLzABlwmvWWwSp7T9qDsRXykNKzzpf+yzrtSwOIjGwBJuqVl1p5 qmOo4DSE7pzdJ5MMV2LAb727NyI3RFRiIDRkkElTTVYyFBk+w+C5WYYTBUjP/nnrE84l 6L+Md9umJ0hKRjziVuKd3mkRPJQ5y+cyfdMVCjXYTuDor1hJBvcMCJemdsyCBzNIgsD8 pdpqyTYMrEffibP75gNY8D942tt6tgXVLpKjk/hmyoAVv+ZF2ZQm+N4j7l07LVfuHD57 eQeQ== 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 q12-20020a056402518c00b004573c1ae3fasi12447555edd.285.2022.10.12.10.23.56; Wed, 12 Oct 2022 10:24:22 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbiJLQwr (ORCPT + 99 others); Wed, 12 Oct 2022 12:52:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbiJLQwq (ORCPT ); Wed, 12 Oct 2022 12:52:46 -0400 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E3DE0729; Wed, 12 Oct 2022 09:52:45 -0700 (PDT) Received: by mail-oi1-f170.google.com with SMTP id l5so19702023oif.7; Wed, 12 Oct 2022 09:52:45 -0700 (PDT) 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=S/5xq2x209F1HQNndofzRRLO7+fGWFD7vQy4M5xyyDo=; b=1gVhmmi6hlg5BVqoQbRfIzeiSW56V1QoPdbjP0jLFKLGCxLzQ9s+77DVbeaXiXENMt gnsYbrdVnbffsNpxYdCXDQsgxeYT9NW741tzW8SDhWka6twuyZCOA2XINn7398QRJy1b iUukZisJpZ1/2akPQNMaEl3nL60pZXsAp/juPajX4Q08hOB4bdx+g6dTQoyWrgkqqzzi Yx+gF8IGvfaTF9BqZckCPkB0pnd9CH3Ft547UTvJC3JodeablpUiV7uoMPkfH1wpO90V 78t1UA5JbJvH1Q0QVyn63aBzrfprvdYR+nyBqvPWP2+f/+4lUDRzAGOzQ/H4GTf35bti i3Kw== X-Gm-Message-State: ACrzQf02GEma37xa9f1zq14AnnZXTaIrqmcFhwEZn4DJGDsirG6cO/h/ uU9/ZpAosSpnhvL0fSR59NUTrFvGcV35PsN6XqY= X-Received: by 2002:a05:6808:1a09:b0:350:107b:f89a with SMTP id bk9-20020a0568081a0900b00350107bf89amr2644451oib.218.1665593564509; Wed, 12 Oct 2022 09:52:44 -0700 (PDT) MIME-Version: 1.0 References: <20221012143857.48198-1-james.clark@arm.com> In-Reply-To: <20221012143857.48198-1-james.clark@arm.com> From: Namhyung Kim Date: Wed, 12 Oct 2022 09:52:33 -0700 Message-ID: Subject: Re: [PATCH] perf: Fix missing raw data on tracepoint events To: James Clark Cc: linux-perf-users , Peter Zijlstra , linux-kernel , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 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 Wed, Oct 12, 2022 at 7:39 AM James Clark wrote: > > 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: Peter Zijlstra (Intel) > Signed-off-by: James Clark Ouch.. thanks for the fix. Acked-by: Namhyung Kim Thanks, Namhyung > --- > 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 >