Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp169227imm; Fri, 6 Jul 2018 16:42:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdyQqZTzYv+XDj4yyS2A3kmVSx9XItQNGGXiGaeFf4mogXEZhozgiRQRgj263vQpUcaA1zB X-Received: by 2002:a17:902:82c7:: with SMTP id u7-v6mr6064659plz.83.1530920553106; Fri, 06 Jul 2018 16:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530920553; cv=none; d=google.com; s=arc-20160816; b=trfmt2JGvAgbtOI5cSn6V77zCcjsFTAkrw9LND4NyzBaToVsn4CtyOwLXc/qs5mDA2 tTNap/HdBA3ttrFg03Qn+l170k8UyeFmyVoZb1qjFYCDVbqOjmiDDwe10qrMRRM1znWC LMX6f3aydi9YC4zjBkOOvkjum+mPiEEI+CqBK7rkwCbCVL6sY6RNux1Nnwl9B0sM7peB TCNCqdi1FjawrYjgoO8LwuAseM0GxGTsoZRYN2HKtfA6mvSVCxXJT8MQq7q1alL6iLNb LFm2X6mlT4cR22Sl6TgR7olLvNl4CTH3o2bucIa3G5jmENGuTIFJDJeYtjkhPrdBku5P gn6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=o+JTZ6GpoV7FMspljZUL1pXKp8dVuaqCZ4JIUOH6O3g=; b=G4xZGITKMlqpaQUuSxrPjBPuESRruX+3vbQmdi23OjFSmSozhTMTQXqwlWww89OoSW 7+PNn0k2/uiLhQY/QUaLsMWvalnA9WRn2bqHJ4SmBoSsZVKnGMqtcsi9azTGfays5pZF 837Hzld/5bBvY+ohHr2sS0jcArkUG/wDyGqnOK8audCzrHGsw0tfIQ4mguZwf5C2a4VV MzzfLwMIZEeF+epwcQ8IXxRMEJuT2qfEw/eUMJAEC1Tl5BYItae0ieULv4ZnBUNFoZqS 9rODw6gE2FOjWHyqats36yv4MHbGiyKIcDlqR5OUGjutr8YCRhCA6h8DNMj0nM3nZdSm lSgA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19-v6si9122155pll.493.2018.07.06.16.42.18; Fri, 06 Jul 2018 16:42:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933504AbeGFXkv (ORCPT + 99 others); Fri, 6 Jul 2018 19:40:51 -0400 Received: from www62.your-server.de ([213.133.104.62]:60367 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932992AbeGFXku (ORCPT ); Fri, 6 Jul 2018 19:40:50 -0400 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1fbaLI-00085x-BC; Sat, 07 Jul 2018 01:40:48 +0200 Received: from [62.203.87.61] (helo=linux.home) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1fbaLI-00016u-6D; Sat, 07 Jul 2018 01:40:48 +0200 Subject: Re: [PATCH v3 bpf-next 1/3] bpftool: introduce cgroup tree command To: Roman Gushchin , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, Jakub Kicinski , Quentin Monnet , Alexei Starovoitov References: <20180706212816.3760-1-guro@fb.com> From: Daniel Borkmann Message-ID: <2cc264ac-d1c2-7d98-a0f1-72f11d70b167@iogearbox.net> Date: Sat, 7 Jul 2018 01:40:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180706212816.3760-1-guro@fb.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.0/24729/Fri Jul 6 22:46:13 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/06/2018 11:28 PM, Roman Gushchin wrote: > This commit introduces a new bpftool command: cgroup tree. > The idea is to iterate over the whole cgroup tree and print > all attached programs. > > I was debugging a bpf/systemd issue, and found, that there is > no simple way to listen all bpf programs attached to cgroups. > I did master something in bash, but after some time got tired of it, > and decided, that adding a dedicated bpftool command could be > a better idea. > > So, here it is: > $ sudo ./bpftool cgroup tree > CgroupPath > ID AttachType AttachFlags Name > /sys/fs/cgroup/system.slice/systemd-machined.service > 18 ingress > 17 egress > /sys/fs/cgroup/system.slice/systemd-logind.service > 20 ingress > 19 egress > /sys/fs/cgroup/system.slice/systemd-udevd.service > 16 ingress > 15 egress > /sys/fs/cgroup/system.slice/systemd-journald.service > 14 ingress > 13 egress > > Signed-off-by: Roman Gushchin > Acked-by: Jakub Kicinski > Cc: Quentin Monnet > Cc: Daniel Borkmann > Cc: Alexei Starovoitov Very useful! Applied to bpf-next, thanks everyone!