Message ID | 166601792750.401.18306154915385335790.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1492034wrs; Mon, 17 Oct 2022 07:53:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7wQZwGJP78FW5wbGYtMDP9ZUr/GaJwy1KZ9JOu8y5w9RBuMchCRsyV+nyOYFJYcEuNyyU6 X-Received: by 2002:a17:90b:1d11:b0:20d:4c69:6886 with SMTP id on17-20020a17090b1d1100b0020d4c696886mr33176951pjb.14.1666018404331; Mon, 17 Oct 2022 07:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666018404; cv=none; d=google.com; s=arc-20160816; b=a3/E3v1c32M2/LV/wKG2SdLiEuGVc6aJZ+k7dl8S6T5zvL1Cyzkm5Tx3dAMrHoGQMH orEKNzB4JHOPvYb9UmRO5U2XuzNZSfnTjJbl/gKN9eWOecmkVDJp1m/FHMoFnP6gNQg8 Osh/86pUctASaafc/ZYtx4gAu27mC/j7hXP+UfN2ixYW3zkrfHS1RjyRcBARAN07Pq5S r8HLpyZzjTtPF+Mo756MopZpGSTzuZtS30tBRXry3vn0i5tz8vs2VynM88RSUHA7FkRq I2+aapLRF6b5EPzudsV4dHSlmWs61cxtepAaMa19D4uh/OK0qEz6wHWbA8+6GDnIyFCm jsjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=F9QpAqs6GyUJEi3LXVbk4btEPF2HufReWPHZpghC9FY=; b=WEjbWxVl9D+G6jWl2jqmAXSTJXg3Q4wiApqmaUDcktr6cIa3joZvaaZFLIvfypvKid fnvh765rFX4wdAhzeiPhnvAcip0Kl510743rHSh1gGzn9F6efC2gehrHwZLEbot0eOGY v+0EGIzd/1sxPZKaVB2/lR9ncgafl53r+FjXJJZJzXWLI3bvRdCff0SMK2H/c6psw4UQ x1l4s6/WEwAm8JniqNqQMgBamAiYKqh593H3eRtkPb+kvs6VtNhL7/V7F8RvWZyJGL/D /jmKR4tosrBJomksMCgyP4S+0C0aeqFSTJWpJt70nKGTQU101taWjgIIOc3J9MhFea2U kTzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WCxycd4D; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j30-20020a63231e000000b0043c1481a835si12718230pgj.267.2022.10.17.07.53.09; Mon, 17 Oct 2022 07:53: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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WCxycd4D; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbiJQOpg (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Mon, 17 Oct 2022 10:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbiJQOpc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Oct 2022 10:45:32 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F3A42F65E; Mon, 17 Oct 2022 07:45:30 -0700 (PDT) Date: Mon, 17 Oct 2022 14:45:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666017929; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F9QpAqs6GyUJEi3LXVbk4btEPF2HufReWPHZpghC9FY=; b=WCxycd4DgNHnbQFpQWAhIxkbwZsNCWJ/C29nq17PHPxihtOAREqI28Uij/A13ypQnMjQjz PjC/hcrNFuSl07WqiG7kMjgSLU2q0rxRhfdRSu/uYj7csk+uJaRO5/8KBC+NQ2P3n10gUZ gjKaSlBnxB47JDXnObnKC1eueZzSMaVNJftXV9gtxX2DT/SX/IStKSQK+s2KD8lJvnZLED l4pUW+Pqwmua0M/JvImxuZnqvviaR0pRXBi+OnNnUeoFTivMl4Y3Ea/vssbzqFyrgRygWU ZJ3Nk4gDV2GMc8HxGzOOyoWqMzqeh/vv0Jr28KB3ZcGoZ+RRJ20X4H42bHzi9Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666017929; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F9QpAqs6GyUJEi3LXVbk4btEPF2HufReWPHZpghC9FY=; b=YNc+pHLGOPHw6egVEbDMffAEHjmNuIc75GsP74HsaSvqE9eMspoy+1MIlDZp39zSDwObiO 0LFHrC+wlgMC+xBw== From: "tip-bot2 for Sumanth Korikkar" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] bpf: Fix sample_flags for bpf_perf_event_output Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>, "Peter Zijlstra (Intel)" <peterz@infradead.org>, Namhyung Kim <namhyung@kernel.org>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221007081327.1047552-1-sumanthk@linux.ibm.com> References: <20221007081327.1047552-1-sumanthk@linux.ibm.com> MIME-Version: 1.0 Message-ID: <166601792750.401.18306154915385335790.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746946914117644171?= X-GMAIL-MSGID: =?utf-8?q?1746946914117644171?= |
Series |
[tip:,perf/urgent] bpf: Fix sample_flags for bpf_perf_event_output
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Oct. 17, 2022, 2:45 p.m. UTC
The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 21da7472a040420f2dc624ffec70291a72c5d6a6 Gitweb: https://git.kernel.org/tip/21da7472a040420f2dc624ffec70291a72c5d6a6 Author: Sumanth Korikkar <sumanthk@linux.ibm.com> AuthorDate: Fri, 07 Oct 2022 10:13:27 +02:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Mon, 17 Oct 2022 16:32:06 +02:00 bpf: Fix sample_flags for bpf_perf_event_output * Raw data is also filled by bpf_perf_event_output. * Add sample_flags to indicate raw data. * This eliminates the segfaults as shown below: Run ./samples/bpf/trace_output BUG pid 9 cookie 1001000000004 sized 4 BUG pid 9 cookie 1001000000004 sized 4 BUG pid 9 cookie 1001000000004 sized 4 Segmentation fault (core dumped) Fixes: 838d9bb62d13 ("perf: Use sample_flags for raw_data") Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/r/20221007081327.1047552-1-sumanthk@linux.ibm.com --- kernel/trace/bpf_trace.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 49fb9ec..1ed0896 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -687,6 +687,7 @@ BPF_CALL_5(bpf_perf_event_output, struct pt_regs *, regs, struct bpf_map *, map, perf_sample_data_init(sd, 0, 0); sd->raw = &raw; + sd->sample_flags |= PERF_SAMPLE_RAW; err = __bpf_perf_event_output(regs, map, flags, sd); @@ -745,6 +746,7 @@ u64 bpf_event_output(struct bpf_map *map, u64 flags, void *meta, u64 meta_size, perf_fetch_caller_regs(regs); perf_sample_data_init(sd, 0, 0); sd->raw = &raw; + sd->sample_flags |= PERF_SAMPLE_RAW; ret = __bpf_perf_event_output(regs, map, flags, sd); out: