From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 732B5C2D0E4 for ; Wed, 18 Nov 2020 03:05:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14A142468E for ; Wed, 18 Nov 2020 03:05:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E3trQV8w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726202AbgKRDEo (ORCPT ); Tue, 17 Nov 2020 22:04:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725613AbgKRDEo (ORCPT ); Tue, 17 Nov 2020 22:04:44 -0500 Received: from mail-yb1-xb41.google.com (mail-yb1-xb41.google.com [IPv6:2607:f8b0:4864:20::b41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FE0BC0613D4; Tue, 17 Nov 2020 19:04:44 -0800 (PST) Received: by mail-yb1-xb41.google.com with SMTP id s8so266347yba.13; Tue, 17 Nov 2020 19:04:44 -0800 (PST) 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=iRbmAywHDNueRKdeuUhZNpbWAVgCvINl7dg2GFG1n3k=; b=E3trQV8wy/eNGvtmZimNtsCb8Dv4a5BKI6pPUAzg6OWXT9zgNA/K6HQ5qgQg868ggG oSDKj/ogNmCFr3Ffkx+IMKxCSdyr2Zh4YONqw4wDXKh7OC35zd8Drk5AlrprUVQuk9JB +0KerD6VpL80sGUEallKiSd+WrDGi+zDID52GLMaoyOw6a6/JdVbnYkbDz+gpXdb64xo 7XEHzTtr1FXv04Y64clgJX2IbHMC88/ZVZ95TE56Jq8/YKFNETddkFKhbzmraM3KwAbx vIyFTI6LBzWAY6ewf16ufZGIOrIZwmi/u5Bto66L6O4bMHmf9IfMzSB/IZ5BC6W2b1/4 2Usw== 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=iRbmAywHDNueRKdeuUhZNpbWAVgCvINl7dg2GFG1n3k=; b=NbeQkq+yFkF1OwdkcQBcu5vHMTdIUHy2lr4MkhAt1ICw8v5BLgY2KU3X/aDY2c0v++ vG0D3cqSASCXv04c7DNbvhm8Vc0q9ykk6GdxyQB6ECJ5FUM2TWBx75k/Q9cFH974dZ8M fJbYJwTsCfeJAhu3KQmrttsyrqytg1RH+tx/9bSBXqhsrdfQVtCQ+7V8+vhuitdGa9FG fQel9hzpZt1IbujwMIQlp7ZtzZR9CMPBCkieFXrXY9tWCLXXab8SgCtEfTRcsAwMVulg m4u6SapSXohdvAMH26/lQGwtyAxHVmTWhbeHDRZ0f+eurnIeAWEasNUW1Ke56wobQ+x4 YOQQ== X-Gm-Message-State: AOAM533FXYO4xlFkPgW3hoMPPwELymaiWdDdBn1SGOaTrV5wZwtZfIwS G+ERqxikg/2+NxSVD7644BkPi75hHKRQM5gpGOE= X-Google-Smtp-Source: ABdhPJx4RNXYPYXjte+dwwOp5bqg7fUFgAyEAYuEnN8JdnVE5B5pZ1cLsEyAmUYtrKLZPlogeJUNIr5QRSc1j17kVME= X-Received: by 2002:a25:df8e:: with SMTP id w136mr3553019ybg.230.1605668683391; Tue, 17 Nov 2020 19:04:43 -0800 (PST) MIME-Version: 1.0 References: <20201117145644.1166255-1-danieltimlee@gmail.com> <20201117145644.1166255-2-danieltimlee@gmail.com> In-Reply-To: From: Andrii Nakryiko Date: Tue, 17 Nov 2020 19:04:32 -0800 Message-ID: Subject: Re: [PATCH bpf-next 1/9] selftests: bpf: move tracing helpers to trace_helper To: "Daniel T. Lee" Cc: Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko , brakmo , Jesper Dangaard Brouer , Lorenzo Bianconi , David Ahern , Yonghong Song , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Ira Weiny , Thomas Graf , Jakub Kicinski , Martin KaFai Lau , John Fastabend , bpf , Networking , Xdp Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Tue, Nov 17, 2020 at 6:55 PM Daniel T. Lee wrote: > > On Wed, Nov 18, 2020 at 10:58 AM Andrii Nakryiko > wrote: > > > > On Tue, Nov 17, 2020 at 6:57 AM Daniel T. Lee wrote: > > > > > > Under the samples/bpf directory, similar tracing helpers are > > > fragmented around. To keep consistent of tracing programs, this commit > > > moves the helper and define locations to increase the reuse of each > > > helper function. > > > > > > Signed-off-by: Daniel T. Lee > > > > > > --- > > > [...] > > > -static void read_trace_pipe2(void) > > > > This is used only in hbm.c, why move it into trace_helpers.c? > > > > I think this function can be made into a helper that can be used in > other programs. Which is basically same as 'read_trace_pipe' and > also writes the content of that pipe to file either. Well, it's not used > anywhere else, but I moved this function for the potential of reuse. Let's not make premature extraction of helpers. We generally add helpers when we have a repeated need for them. It's not currently the case for read_trace_pipe2(). > > Since these 'read_trace_pipe's are helpers that are only used > under samples directory, what do you think about moving these > helpers to something like samples/bpf/trace_pipe.h? Nope, not yet. I'd just drop this patch for now (see my comments on another patch regarding DEBUGFS). > > Thanks for your time and effort for the review. > > -- > Best, > Daniel T. Lee