Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp877938ybk; Wed, 13 May 2020 15:52:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYExfMyaDpdX310zeI197Ekp3p+vpV56ib4UDW/49iNAYyACn/OW0A8m+jfUElVNBXtdQ5 X-Received: by 2002:a50:f98c:: with SMTP id q12mr1773397edn.172.1589410336733; Wed, 13 May 2020 15:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589410336; cv=none; d=google.com; s=arc-20160816; b=G+keJz2r44lkA0iBc2dgWu4uPWyegTHTpRCe/rugKBAqkB9M26DOuXbTWwL0rPrd8l c8IoCReWQ1BJE4IWTOrjRqo/zjrQs7Kqn6AnlI/xsRa5zBP07LZuNQOxudzrtLn6fV7u Sq8jUUh316Wqa9MGQv7j63GTBqmY8Akq+K+eTdJsGMrk71d6GpRP0Y1YLqMeC6hu4iEU yIxYkPLPad2M/rp9qa3bajZJYzcq6b9E8JLPAnxXsPX/FdvFGOsST5RjrHJoYpEEYSJZ /A394btgWCvSLgap0bkbWlpIGcA7uyfX3UPBD297Jd+DwY5Ti6vdz7zFFjL5BUbdPguA jTNA== 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=q/Oigr+3uZfiLaPfc3epkA1fLtCLP5pj4EA6nPtKRSc=; b=oIcM5W5pv2N9Tcqwx98Lz9G5H+efXZDiEuWWeuXsvKj5DQnpJM8sJnwkdesqUbo+Mg I06NhlhwfomesB7Mfs6AWbQvzsG6BM+29hYQO1yjg9n3xuoGxpyX8HLqRhIbdBwFRyHV 6U1yHbzezxgXKJ6l4OTTwMw+Qi41qeD9oo/7/XxnOmY0N596KrqHi8eGg5RnHF9T258q JQTUCj2M9IPZbIfxAwJZ+eUGEKQdZ+jPflZrkvNfZlcvUaxEkm/AH8o75uuv6Ky/0U3o u0jcP2KcCWSFIxNx95ykNHpBvGp3LvVX2PERdhPhmiAb0CW9Yj2vrX3HcTod5lMeRaJp yEmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nguQYG41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u23si794421ejr.391.2020.05.13.15.51.52; Wed, 13 May 2020 15:52:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nguQYG41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731879AbgEMWuc (ORCPT + 99 others); Wed, 13 May 2020 18:50:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731523AbgEMWub (ORCPT ); Wed, 13 May 2020 18:50:31 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54896C061A0C; Wed, 13 May 2020 15:50:31 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id u6so1386259ljl.6; Wed, 13 May 2020 15:50: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=q/Oigr+3uZfiLaPfc3epkA1fLtCLP5pj4EA6nPtKRSc=; b=nguQYG41jvXLgEprtQDdE6GosUcmgMemKIqnlJFnYAKpswtpWrij3m9IxHQf2uybjk YDCXvtRdVkyWV97328Fmx0UIzdICAfkJSCtgy2iJVvgEd7y6+goFlrxA3hF7tVbD293m Qxd6YFQZOd+kaEVycgFI3ckc6myLE/UZoEBQVHoh5SIwqUjpK9tiG0mtM99sr2xscQJ7 GJ3QMagKYZcu/CYzlasjlUEbN/gw8sKobma0dlViXzzLCy/9WzdfnjSTJ4roo+pf8KQc K2ri1f2rWt4nkcV+tqzPXw/rWiYtMXdS/k49iXL0fZQzUljf5lQAUL5EBPienMqLsmz6 3jPw== 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=q/Oigr+3uZfiLaPfc3epkA1fLtCLP5pj4EA6nPtKRSc=; b=Qs/Vux6XASl5JOki3TI0QacvsxXJiH81pTcBfxdYZNr2fMaqekwtYcWxfER+dfCjQR e927IanvpvedaGyKQ7duPKu53V8W6AleDg1lWm7Da4CDA5mvQa8UBhU0gPkPLE+ErxCN gwzYD2fJ0cmRAmbCIfuI3iMj5JIkHfrcRbUUr3xL2at3rpwFd+PjrFq3DXdifwaByUYn Vk6GpAE81tYsufdnKzRNOjPEHn9ZtLTz5L3YXxIP05bNvqcElf9WON8DL64aIdU0r2rj QENhTw4o0Bmw8TpLhSVe/SozX44K1F3UlQepmyzFNU/7EaWQcgCEckqlFxb4fZjNm9hZ rHAg== X-Gm-Message-State: AOAM530K85fiYEuyg4zxl/44nLrhwLzcgND4bRsx3UwQfVk2mH6b2l75 2ViW15b8jzFOwRCL/a+L08uBZp60pCGYi5B0pfY= X-Received: by 2002:a2e:a169:: with SMTP id u9mr816187ljl.144.1589410229680; Wed, 13 May 2020 15:50:29 -0700 (PDT) MIME-Version: 1.0 References: <1589263005-7887-1-git-send-email-alan.maguire@oracle.com> <20200513222424.4nfxgkequhdzn3u3@ast-mbp.dhcp.thefacebook.com> In-Reply-To: From: Alexei Starovoitov Date: Wed, 13 May 2020 15:50:17 -0700 Message-ID: Subject: Re: [PATCH v2 bpf-next 0/7] bpf, printk: add BTF-based type printing To: Joe Perches Cc: Alan Maguire , Alexei Starovoitov , Daniel Borkmann , bpf , Rasmus Villemoes , Arnaldo Carvalho de Melo , Yonghong Song , Martin KaFai Lau , Song Liu , Andrii Nakryiko , John Fastabend , KP Singh , LKML , Network Development 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, May 13, 2020 at 3:48 PM Joe Perches wrote: > > On Wed, 2020-05-13 at 15:24 -0700, Alexei Starovoitov wrote: > > On Tue, May 12, 2020 at 06:56:38AM +0100, Alan Maguire wrote: > > > The printk family of functions support printing specific pointer types > > > using %p format specifiers (MAC addresses, IP addresses, etc). For > > > full details see Documentation/core-api/printk-formats.rst. > > > > > > This patchset proposes introducing a "print typed pointer" format > > > specifier "%pT"; the argument associated with the specifier is of > > > form "struct btf_ptr *" which consists of a .ptr value and a .type > > > value specifying a stringified type (e.g. "struct sk_buff") or > > > an .id value specifying a BPF Type Format (BTF) id identifying > > > the appropriate type it points to. > > > > > > pr_info("%pT", BTF_PTR_TYPE(skb, "struct sk_buff")); > > > > > > ...gives us: > > > > > > (struct sk_buff){ > > > .transport_header = (__u16)65535, > > > .mac_header = (__u16)65535, > > > .end = (sk_buff_data_t)192, > > > .head = (unsigned char *)000000007524fd8b, > > > .data = (unsigned char *)000000007524fd8b, > > > > could you add "0x" prefix here to make it even more C like > > and unambiguous ? > > linux pointers are not emitted with an 0x prefix So? This is not at all comparable to %p