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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 A0FD0C47404 for ; Sat, 5 Oct 2019 18:40:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 752C7222CB for ; Sat, 5 Oct 2019 18:40:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Andbxkxq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388137AbfJESkQ (ORCPT ); Sat, 5 Oct 2019 14:40:16 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:37587 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387791AbfJESkQ (ORCPT ); Sat, 5 Oct 2019 14:40:16 -0400 Received: by mail-qt1-f193.google.com with SMTP id l3so13458492qtr.4; Sat, 05 Oct 2019 11:40:16 -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=mON69cO2JyLTRxDEuuHEP2EPR7Uadvand9Zo6W62z0A=; b=AndbxkxqTIiS9cvcr/WlqpnWxOEkOzsSFb4XRe4I5VLfQpbiWNSdVFp9BvCEprZ9AW lA7FCxv7Uh7KMzOGn6CyXYLlpy+dRQuKxvFtphZMeb7ikThIsZs7mol85UcKDFlUYhCX GlOtpJLH9kCrAsK6nsXnW4M7PwsK5eNEGSFGc7WSCkvcKUw5w6NTrL8+JrReBUtQjZJ7 rY2RzMzWq/C9czoqbXXNOCzlt3XAFwg7aZ2qvlZV0F13gOUFLQzvkkR6cyS4zUB+4Rgc E+1OpGvQ3RB3hpRtgjpxUn8XG/cKY6hEOe/hMKIhHgCgA67wh8N63XFPXc+Wa4qzXYkq JurQ== 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=mON69cO2JyLTRxDEuuHEP2EPR7Uadvand9Zo6W62z0A=; b=NGQ4G0omxA/mR/1C0qYDeCEqWATlHBMxXmxDA9kZxBItRL4rSUqXpVhN2/jQWpGtkN eWIK72cCyC4/CjGDA/o17asFjrz9/7bZUTdRUCcLvyDmvkys7M6ihhGu5LS3xLz4X0hY 1ipdOmd2+sAF0SzriSnFKO8lc0oGl4TOiuGnA60nXgnIWnXW2lE10jD84rB1sLFE5pXi xQrHmkqK4YL1MuI9at3NaCePXyyox8pO7LCBFtSItA+ddfG+x5NDDDvjTBpUeaTsqyIB QCcVoPsJU68Epraow2t5xrF0H99Dljg7dy0D5SuNlGsX+UFo8F6QLp6hsdS5rzu6HvWk OTTQ== X-Gm-Message-State: APjAAAUjk6HTS+5Vkg74l8ttZ7eWZGyIXmPRf7gze6yYR3MNMQ2bFBto ZYDDypm7t1JaY0lWGUwQMqu0nV4/3pCoNVJNEmY= X-Google-Smtp-Source: APXvYqz5fUhkWbmrxPEKo+qYcK4OzSlkETzd6D+kYm7jBq8GL/40WGYjg9GmIKcyYw/G8XyYWaihpBqr1vaU5b3h8Lw= X-Received: by 2002:a0c:d284:: with SMTP id q4mr19645633qvh.228.1570300815526; Sat, 05 Oct 2019 11:40:15 -0700 (PDT) MIME-Version: 1.0 References: <20191005050314.1114330-1-ast@kernel.org> <20191005050314.1114330-2-ast@kernel.org> In-Reply-To: <20191005050314.1114330-2-ast@kernel.org> From: Andrii Nakryiko Date: Sat, 5 Oct 2019 11:40:04 -0700 Message-ID: Subject: Re: [PATCH bpf-next 01/10] bpf: add typecast to raw_tracepoints to help BTF generation To: Alexei Starovoitov Cc: "David S. Miller" , Daniel Borkmann , x86@kernel.org, Networking , bpf , Kernel Team Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Oct 4, 2019 at 10:05 PM Alexei Starovoitov wrote: > > When pahole converts dwarf to btf it emits only used types. > Wrap existing __bpf_trace_##template() function into > btf_trace_##template typedef and use it in type cast to > make gcc emits this type into dwarf. Then pahole will convert it to btf. > The "btf_trace_" prefix will be used to identify BTF enabled raw tracepoints. > > Signed-off-by: Alexei Starovoitov > --- Acked-by: Andrii Nakryiko > include/trace/bpf_probe.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/trace/bpf_probe.h b/include/trace/bpf_probe.h > index d6e556c0a085..ff1a879773df 100644 > --- a/include/trace/bpf_probe.h > +++ b/include/trace/bpf_probe.h > @@ -74,11 +74,12 @@ static inline void bpf_test_probe_##call(void) \ > { \ > check_trace_callback_type_##call(__bpf_trace_##template); \ > } \ > +typedef void (*btf_trace_##template)(void *__data, proto); \ > static struct bpf_raw_event_map __used \ > __attribute__((section("__bpf_raw_tp_map"))) \ > __bpf_trace_tp_map_##call = { \ > .tp = &__tracepoint_##call, \ > - .bpf_func = (void *)__bpf_trace_##template, \ > + .bpf_func = (void *)(btf_trace_##template)__bpf_trace_##template, \ > .num_args = COUNT_ARGS(args), \ > .writable_size = size, \ > }; > -- > 2.20.0 >