Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp216446ybe; Wed, 18 Sep 2019 15:51:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtg95JNmE3H8n5V7CFYx8MuBKm2LABktqph7i0OXuqe5mmNj9Fa0/OILyHMdxLsecNUYFh X-Received: by 2002:a17:906:76c2:: with SMTP id q2mr11811064ejn.202.1568847114803; Wed, 18 Sep 2019 15:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568847114; cv=none; d=google.com; s=arc-20160816; b=zmkRJI11PwNoaMtuf13E0U9UUmmOdTC/NDW9vUHiJ0QH7t4vZVXznHXy9eKsPUf6mc kzby8wtPtRoac/Jyr5XorQdXQzmv+p2HbtjLrdjRI7lx7SWVMavG6x2GV47UQNozJTzH UI00LWhv3AjuPnfqEFZ5UtZGk2g3xy1cYhpS5POyQyBtD8a+Vh+PtyEbGZbm09kXla/t f7Gkv0VqfXvy0nEmvKu6LImjfhMXvnwKnDM1je6Z4mdCOwVwuGOisNpFOtee1dDWqzbs N106CPdhcCIut+byoEVrFK6PPaSVyNLytXrEb71O3st44BrpXZRs4lFjczxb4kCs7vUT Ayyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=meIVwwcdmP/nxLwROeZNJKv2MKcCbPHX7tUkS9zAbzM=; b=mloYSltlwLRkGm6bNVqExShhy9GjuFkqzhWOxwzgS4nKbmpaIthzy5SnzL52mDO7fc TlIuG7cjil85weSDtEyNOONhVjx9/ennIeT5QlSlkvaIKHbJud2kKLwmPd8qKAR9ob9X TZO+vaRNHOBFLFZhA1VRqUF8v2Sfl040iuCkmoejuu49YPeMerx2Me3zM/Kz8hkzHRL0 Eh5dkeFW50OIHXySjMXe3UfAcy2VcWoM2z+JCQq0AILFwYi7KbztpPpi+XePhaJHHRnK QI04KftllaXDrcoHerMkiFg0P60DcU2WPip58YGl7chVrKd6OeiH2yg9pQE55m0PhAUQ fShA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z7ucb399; 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 a54si4269637edc.333.2019.09.18.15.51.31; Wed, 18 Sep 2019 15:51:54 -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=Z7ucb399; 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 S1730610AbfIRUWd (ORCPT + 99 others); Wed, 18 Sep 2019 16:22:33 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34749 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbfIRUWc (ORCPT ); Wed, 18 Sep 2019 16:22:32 -0400 Received: by mail-lj1-f195.google.com with SMTP id h2so1288292ljk.1; Wed, 18 Sep 2019 13:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=meIVwwcdmP/nxLwROeZNJKv2MKcCbPHX7tUkS9zAbzM=; b=Z7ucb399RGF9U9tQvgEYnaf/GVv/5O8JGgljOfEFbS59akeP8ua3MG96LGv6gp1/Bl FRSBFhV8554T6+PhvCNurUGqIj+l/5zx463jRffXiOBWGdWnibHtbhPZbIWJJYIFVLR8 R7+Km/dNqvXLb24XWRPhA558QSW5AN4Q8vSFrSOQiNb7le2PSpSVDNHDQX+faujSuxDc galQGlc3OMS7mOrIOzPA+T9hOCj+UuiuYbICOnw1hnawKxFIpi8pmgiuDg65GPGc0HcY 18rouYHLHbwxRZT4rY/1Zm6raqoxWfvkET9CUioERjOMJcE0WeLu/6fI89cdL29DmaZB M3bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=meIVwwcdmP/nxLwROeZNJKv2MKcCbPHX7tUkS9zAbzM=; b=Jd/XCGOieUU2vYzsiFhRa79qeBtDcdBZuvg0+E+Z2aw+y8JZ6X8kn8ezpjKfB+0KZ+ 4ldC7BX0WtR6HdaGSkoHCnKn7s+3zybkMesFVyUzxPZJInK6RbYKlLKCc+GUd5paZyd1 cVXtJaKUfGGsTSiMwzZ9tVkrcIev8HpMgY6OMMVS2+V3bKtEma5INZoP75IRfeBnOy5U +REOi7CudX/ZbQ7ga9Aq2s7vEBKbCV6PKPIWgUzShqZ8i/vn1T4XfhP/elj8Q1R1bokI +3bBuXQqvPUMrNsctt+fNqWMzXuWBgShpl83xCpuZ/GTLpWnB+1mBhHf58V0Df0aPR2E SjyA== X-Gm-Message-State: APjAAAUqnn9jmQBfhbCuc6BpABEJ/7Vcbe9CfH+Iv4zf+v7xZNIJ4XHU QbHnGvRIp/EkgoU/yMogFOnc5WrDs83SuIATT+A= X-Received: by 2002:a2e:6a13:: with SMTP id f19mr3209725ljc.17.1568838150069; Wed, 18 Sep 2019 13:22:30 -0700 (PDT) MIME-Version: 1.0 References: <20190918052406.21385-1-jinshan.xiong@gmail.com> <5302836c-a6a1-c160-2de2-6a5b3d2c4828@fb.com> <20190918143235.kpclo45eo7qye7fs@ast-mbp.dhcp.thefacebook.com> In-Reply-To: From: Alexei Starovoitov Date: Wed, 18 Sep 2019 13:22:18 -0700 Message-ID: Subject: Re: [PATCH] staging: tracing/kprobe: filter kprobe based perf event To: Jinshan Xiong Cc: Yonghong Song , "jinshan.xiong@gmail.com" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "mingo@redhat.com" , "bpf@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" 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 8:13 AM Jinshan Xiong wrote: > > The problem with the current approach is that it would be difficult to filter cgroup, especially the cgroup in question has descendents, and also it would spawn new descendents after BPF program is installed. it's hard to filter it inside a BPF program. Why is that? bpf_current_task_under_cgroup() fits exactly that purpose.