Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp58423lfe; Fri, 15 Apr 2022 19:23:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoIhatwT/MbwIPVp2/7J4Zfg0Dc+7vRYIPjymxF4X4mY0KdhGW8FOvi27qLQdpRVrBFnEF X-Received: by 2002:a17:90b:4b84:b0:1ca:cb5a:1930 with SMTP id lr4-20020a17090b4b8400b001cacb5a1930mr7219219pjb.39.1650075826065; Fri, 15 Apr 2022 19:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650075826; cv=none; d=google.com; s=arc-20160816; b=tpLadSjGEExZ8ncPIpZpSFGfFEtsRRcStqlCnTB4V1RjpMmok9ehblqbmPVOnFFWTq sP6LWojQs7J3aVIEIGgtpGJzya5P23Qm858cFLkWARgChsQIBB/P0YloATJfztEXn2y1 BI/VTdPrqXiFK/drM/O1CjEiMVQO0fErCeviN88oJ8nUyMR4O/xs5wxyPxiBmoDffqs7 GSwLENxA11mvog4RpaFVXSmVPCUnzS+U5pkBAXMqQWGjtLBRxUK2lCt+fNX5PXYEdGrX fgnmtiU4y3rTtK5JED+F12R/yjD0B90rm64UYZGQYxEsUdhwGjcWtvPg51PzWSKsWEtC t40g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:hmm_source_type:hmm_attache_num :hmm_source_ip; bh=jGh6xKyjlh8KmPi6/l4QfeJmLZOdQ/qGhfQJK3noDJ8=; b=S3hWC3P1qGWdfw6yUrHglL/NGcfttMwix1OhDTGDxpmCNUcCEbn9Dj7S87lXnZEGtD anrY4ZDD5JWbcaEwBw619Oaruz4M/N1UkQEjRuAv0iMLFV+uHW2cA7wT/fjLgiGHm2CM Neo/08Op+/6oIhsMkbi5+sZ3C3h9GL8UO8R0wfCzHeOGzAin3BBVWhc+3PeVr1/LA8yI GDXYUP2fFcnqeXXB6xI9ccFWKqvtjNAMcc2qV7WwemkS+RjcHbHObCnloGHo2mwXYB++ fhhRGYXNEabxQl9B3Wv0GDx5q8C/i+lOnhx9pKlnfXsYPKRv06MmTJNmJaOfWA8tIUc7 QMXg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s14-20020a63b40e000000b0039d4d2e587asi3162100pgf.656.2022.04.15.19.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:23:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 182F738A732; Fri, 15 Apr 2022 18:38:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348547AbiDOCAt (ORCPT + 99 others); Thu, 14 Apr 2022 22:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243450AbiDOCAs (ORCPT ); Thu, 14 Apr 2022 22:00:48 -0400 Received: from 189.cn (ptr.189.cn [183.61.185.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ED03BB18A0; Thu, 14 Apr 2022 18:58:20 -0700 (PDT) HMM_SOURCE_IP: 10.64.8.41:45858.1005876200 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-123.150.8.42 (unknown [10.64.8.41]) by 189.cn (HERMES) with SMTP id D152B100213; Fri, 15 Apr 2022 09:58:18 +0800 (CST) Received: from ([123.150.8.42]) by gateway-153622-dep-749df8664c-mvcg4 with ESMTP id 8d21f9a5c5c543a7be347287fe62d021 for daniel@iogearbox.net; Fri, 15 Apr 2022 09:58:19 CST X-Transaction-ID: 8d21f9a5c5c543a7be347287fe62d021 X-Real-From: chensong_2000@189.cn X-Receive-IP: 123.150.8.42 X-MEDUSA-Status: 0 Sender: chensong_2000@189.cn Message-ID: <7b6e0e08-4440-f1aa-8e94-068e2e129aac@189.cn> Date: Fri, 15 Apr 2022 09:58:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC PATCH 0/1] sample: bpf: introduce irqlat Content-Language: en-US To: Daniel Borkmann Cc: ast@kernel.org, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, brendan.d.gregg@gmail.com References: <1649927240-18991-1-git-send-email-chensong_2000@189.cn> <2e6ee265-903c-2b5c-aefd-ec24f930c999@iogearbox.net> From: Song Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, SPOOFED_FREEMAIL_NO_RDNS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 bcc and bpftrace should be able to match my requirement, I will look into them, many thanks. BR Song 在 2022/4/14 23:32, Daniel Borkmann 写道: > Hi Song, > > On 4/14/22 1:25 PM, Song Chen wrote: >> hi Daniel, >> >> Thanks for liking the idea. >> >> My target is embedded devices, that's why i get started from ebpf >> C.bcc and bpftrace is a good idea, but i prefer taking one thing at a >> time, what's more, i'm not familiar with python, it might take longer. >> >> Once C code is accepted, i will move myself to bcc and bpftrace. Is it >> ok for you? > > The libbpf-based tools from the mentioned link in BCC are all C, not > Python. Also bpftrace > has guidelines for building it more portably that would be suitable for > embedded devices [2]. > I'd presume these should still match your requirements? > > Right now samples/bpf/ is a bit of a dumping ground of random things, > some BPF samples better > maintained than others, but generally samples/bpf/ is a bit of a mess. > BPF has a huge ecosystem > outside of kernel in its various areas it covers, so it has outgrown the > few samples in there > long ago, and you'll find many resources on how to get started in the wild. > > Adding this as a samples/bpf/ will have little value to others, since > people may not be aware > of them, and if they are they need to manually build/ship it, etc. If > you upstream and can improve > the tools in bpftrace/bcc as pointed out, then a lot more people will be > able to consume them > and benefit from it, and you get the shipping via distros for free. > >   [2] > https://github.com/iovisor/bpftrace/blob/master/docs/embedded_builds.md > > Thanks again, > Daniel > >> BR >> >> Song >> >> >> 在 2022/4/14 17:47, Daniel Borkmann 写道: >>> On 4/14/22 11:07 AM, Song Chen wrote: >>>> I'm planning to implement a couple of ebpf tools for preempt rt, >>>> including irq latency, preempt latency and so on, how does it sound >>>> to you? >>> >>> Sounds great, thanks! Please add these tools for upstream inclusion >>> either to bpftrace [0] or >>> bcc [1], then a wider range of users would be able to benefit from >>> them as well as they are >>> also shipped as distro packages and generally more widely used >>> compared to kernel samples. >>> >>> Thanks Song! >>> >>>    [0] https://github.com/iovisor/bpftrace/tree/master/tools >>>    [1] https://github.com/iovisor/bcc/tree/master/libbpf-tools >>> >>>> Song Chen (1): >>>>    sample: bpf: introduce irqlat >>>> >>>>   samples/bpf/.gitignore    |   1 + >>>>   samples/bpf/Makefile      |   5 ++ >>>>   samples/bpf/irqlat_kern.c |  81 ++++++++++++++++++++++++++++++ >>>>   samples/bpf/irqlat_user.c | 100 >>>> ++++++++++++++++++++++++++++++++++++++ >>>>   4 files changed, 187 insertions(+) >>>>   create mode 100644 samples/bpf/irqlat_kern.c >>>>   create mode 100644 samples/bpf/irqlat_user.c >>>> >>> >>> > >