Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6695704ybe; Wed, 18 Sep 2019 07:37:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcnIrG8xIK11s2NXwqN7X1Z0+hNFqilvO5zKuRHX0922uneQVPQAYmmpdXAfVEXP3RVAcQ X-Received: by 2002:a17:906:1c4e:: with SMTP id l14mr9872838ejg.276.1568817467932; Wed, 18 Sep 2019 07:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568817467; cv=none; d=google.com; s=arc-20160816; b=PsKfcuyXyrRSODP204THY7lVmmrRwgDhSzZ0zVUEZKQOlTA29m6cr4xvOlaFJ3jIkW KhWGcVkux5RalExvHzAlvHWXgpQK3pRSqNXmfmOU0GJSQPN/Z7xJmqHj1SulbDoo0VlE bcf1VHmKHUEM9faSewG5X+g47bEVWdDehDrt8b6z3WqrfN7OfzuJKZ3heqz5dfW9ytfI I3axCtYobjzcLQMn9Oodmnn5v1/5BDJmNg6WJFBECQcE6oaL4QGEeWC9rfD6tYcoiQnp 3T/EChL1ZKVcYerDZ1VGn11hcT9DQBT2vKCLkmSHSsMFfyqCaBDEaICcEqc2cVsjyBtA tDaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RkYCmzxFtZ+pNCP1urZOYVz3GVAlckblbbr0pEk0OxU=; b=V1c91Qw2+RpHmN1kiKsFgWcmZLaC1C0WJqdcRb1wAFKZlQODy2be+VWZXrcl9qkthl DWMap1SmUWagDby38F/nkNgZ+qP4tzDtHa2ZJQCcPuje+6bWzlL5Ky9dUd4zxSG9q/7U mlLIADkS0UKuGxM6dQ4PrC00Si6V3PNmLPPJLGmGyQqXFkMyLRGgfX9yelY+m66oYGr4 lyhB8HaQtESsVckPkPDT/mQ3GILEsU2vCn7oCzdMI/qUvKFIdRecWOmfGf+pBNLU7i55 3FjXAPg+6rxwj/8LNMa38iThUVfEUZhYAR+n1w5rcUWxnB9MXZphyk8o5G9YGeo0gaTL 80xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bhyly7ev; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s54si3723883edm.215.2019.09.18.07.37.23; Wed, 18 Sep 2019 07:37:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bhyly7ev; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730029AbfIROcl (ORCPT + 99 others); Wed, 18 Sep 2019 10:32:41 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40045 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728872AbfIROck (ORCPT ); Wed, 18 Sep 2019 10:32:40 -0400 Received: by mail-pg1-f193.google.com with SMTP id w10so4230376pgj.7; Wed, 18 Sep 2019 07:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RkYCmzxFtZ+pNCP1urZOYVz3GVAlckblbbr0pEk0OxU=; b=bhyly7evHYK8D39RoerQ8i88epE+rmfGrFFX4DRBzpghw/Jb+hj84/eQpNYESzVBtN o6IdpmFaDGUiwlEwnY2dG+bD7PtM/PqCoaW7FagwKDUrWy11Q0LhV8RzEugwnuqoiZhU vcUNo+Lx/N6L8gCm5NPY3wM3X2Z/3FDtkCgnqSTmBk/NMEgYNzy7nNi8MFHVOMtLLovZ iA4C80k9pgu5DLGIe+7/e1C5G0UE2IngwsoP6k2in79eRuocbGHex3H4Fa1T3FaoxPkt SqMKUloCVFX9Ptd/uMdfJ22FXVtobYBzucbQOCa/aBonTpNcXgUr4U5tEu/Nnz3FGNW6 hopQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RkYCmzxFtZ+pNCP1urZOYVz3GVAlckblbbr0pEk0OxU=; b=J3vNHz20NuhaIVoJ+18e9jZfAffAY3un3DhtVA7L05GLc+LVRb+seZ3VYeU4QI9Klb AiBIQERs4Q2bD6EIHYDinIxQWAo5B6Fm1VBiSO7F2D+UPxkQbjTuRClTfAZhgOFPMp8k pRqWjgxNDb066lGOQicTFudRBiWFG4OEBrz/twYGlVl3hCQ4bSUVqV1rIDlIdaEMtMKX au/dCl9CuCNYEPfGJD1QK9qFBkx2x1WrGxuhtnBr4tZ8r4XRBe9cTF8seKOoL8CwOC1l GU32lI3zWFlnbOW20M+C5l3rs/rVPLMEhKJ/goHIrmVxu5uTU7vBEDF0IVGYccmoH70c rznA== X-Gm-Message-State: APjAAAUoNDsrSaTH89NDzsuE7Pdk8YPwdP64jqzW+H7+FIKjAsGkraA1 6UAVCq0lhRGkIbj14h1wi70= X-Received: by 2002:a62:ac02:: with SMTP id v2mr4393606pfe.109.1568817159880; Wed, 18 Sep 2019 07:32:39 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:180::75fa]) by smtp.gmail.com with ESMTPSA id c9sm1774328pfd.100.2019.09.18.07.32.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Sep 2019 07:32:38 -0700 (PDT) Date: Wed, 18 Sep 2019 07:32:37 -0700 From: Alexei Starovoitov To: Yonghong Song Cc: "jinshan.xiong@gmail.com" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "mingo@redhat.com" , "jinshan.xiong@uber.com" , "bpf@vger.kernel.org" Subject: Re: [PATCH] staging: tracing/kprobe: filter kprobe based perf event Message-ID: <20190918143235.kpclo45eo7qye7fs@ast-mbp.dhcp.thefacebook.com> References: <20190918052406.21385-1-jinshan.xiong@gmail.com> <5302836c-a6a1-c160-2de2-6a5b3d2c4828@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5302836c-a6a1-c160-2de2-6a5b3d2c4828@fb.com> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 18, 2019 at 05:51:10AM +0000, Yonghong Song wrote: > > Adding cc to bpf@vger.kernel.org mailing list since this is really > bpf related. > > On 9/17/19 10:24 PM, jinshan.xiong@gmail.com wrote: > > From: Jinshan Xiong > > > > Invoking bpf program only if kprobe based perf_event has been added into > > the percpu list. This is essential to make event tracing for cgroup to work > > properly. > > The issue actually exists for bpf programs with kprobe, uprobe, > tracepoint and trace_syscall_enter/exit. > > In all these places, bpf program is called regardless of > whether there are perf events or not on this cpu. > This provides bpf programs more opportunities to see > the events. I guess this is by design. > Alexei/Daniel, could you clarify? Yes. It is by design. When bpf is attached to kprobe it will fire on all cpus. Per-cpu or per-task or per-cgroup filtering is already done inside bpf programs. We cannot make this change now it will break all users.