Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp22547lfe; Fri, 15 Apr 2022 17:36:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpQnNtBpihixRDYhFK3hYQoBZY/d52nNz8PdL+JMcmuONj38j+2UJgjIfyN1Fshj7zsd1a X-Received: by 2002:a63:5847:0:b0:399:3452:ffe4 with SMTP id i7-20020a635847000000b003993452ffe4mr1162785pgm.406.1650069282190; Fri, 15 Apr 2022 17:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650069282; cv=none; d=google.com; s=arc-20160816; b=06be7U0YiGJyMYd6ELJwwxB94C8zoTiqvWMbPjTn1OSnKqFyXLv/S4nyuO8JIzOq0N famzjwjDyEaNPvqdsI1/V3IIsRd1d7n9jm1XChkeXkrEhfbnDFWTn19y8W7hq17BiYY0 JJMzPiZNyW1fAMygJ1diNq6mYsihTJkHeDNNgfCysNX8m0nBcy0oxggcwWsw68IQSlY1 9y5xJ7eMctUdmo3XKer+L5RL10sHGsCAbbOTvecieRtNnaNsIZslGcLJxzFoS+bD1olG aduQqXFJiroZR2JAgTUi0JGwuNjAhbEw6momubaNLZ/TuYBKfBX4xTDlZuRkQJBrfF3y r5RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=LiFwMTDd2fdSlZNNJT9AWOWlwaivKQ5qk8KaEcQEfrs=; b=X102lfSBO7GslcLgXJ0roMeyDUFTPQ5LrRXku4rUyUHrLo5+yzN5E7IfW4GQe7EWgY dO54KM74dAXxdHOfFURySr+zKmZhaoGhaF3ZGS/wpIhgRUUM64SqIFsFBJXiDUacjrF9 Rkl+LeU4Css5j/Wqs+oZkgC7mzhvZeTufgGoh8Vkpz/glCokcMjOrY5gSdMd/eK3zVTb oMyVYFO3/ob669jID+gOcTouZNoEHnWs+GxWQV76trwvdR527/LaSxEISsM2ZKeZGz1Z 4jHXJShZekjRFpwsvcyC9x/GRZ3JVY71hUmm5TXAJHZZDzpuccJGo3IBMOZaM2ELNtRD w1Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail2 header.b=fiN8lGwS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j191-20020a6380c8000000b003a390300dfasi1428263pgd.284.2022.04.15.17.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:34:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail2 header.b=fiN8lGwS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8B68FEA362; Fri, 15 Apr 2022 17:30:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238555AbiDNWtE (ORCPT + 99 others); Thu, 14 Apr 2022 18:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347288AbiDNWtA (ORCPT ); Thu, 14 Apr 2022 18:49:00 -0400 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8698FC6F04 for ; Thu, 14 Apr 2022 15:46:32 -0700 (PDT) Date: Thu, 14 Apr 2022 22:46:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail2; t=1649976390; bh=LiFwMTDd2fdSlZNNJT9AWOWlwaivKQ5qk8KaEcQEfrs=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=fiN8lGwSeXi6yQVq95169CY5q0fzkvN7gW6UYs2Gv4qL+WDStjwwjCQh0hCFYvksU KnswdJkdUtU5G9GqL5Gxkii4Kk5V4ypSMXwAFRhB8ERjsorTeeAsUqVoT+zdEMMnjf oJiycRhG9r7gmPG8gH0louf++DYLLAv75knuCVPX+ca7M2uTv/1VQdT18IzG6xzs/a 6g4MF5ZXxirNHeYPobCikPiutt8fL50asp7vfCzUqKz1WsQRnWgrgFEHA5NMdKI4K0 ZaO3DghoEjFcnwImnLGE3V49hSOiewYZfIPHt/9yi4wVZ+k81z8SzXwdnbzSqnD24V tQqte9gKKFnUQ== To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko From: Alexander Lobakin Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , =?utf-8?Q?Bj=C3=B6rn_T=C3=B6pel?= , Magnus Karlsson , Jonathan Lemon , Nathan Chancellor , Nick Desaulniers , Alexander Lobakin , Dmitrii Dolgov <9erthalion6@gmail.com>, Quentin Monnet , Tiezhu Yang , Kumar Kartikeya Dwivedi , Chenbo Feng , Willem de Bruijn , Daniel Wagner , Thomas Graf , Ong Boon Leong , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev Reply-To: Alexander Lobakin Subject: [PATCH bpf-next 07/11] samples: bpf: fix uin64_t format literals Message-ID: <20220414223704.341028-8-alobakin@pm.me> In-Reply-To: <20220414223704.341028-1-alobakin@pm.me> References: <20220414223704.341028-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 There's a couple places where uin64_t is being passed as an %ld format argument, which is incorrect (should be %lld). Fix them. Fixes: 51570a5ab2b7 ("A Sample of using socket cookie and uid for traffic m= onitoring") Fixes: 00f660eaf378 ("Sample program using SO_COOKIE") Signed-off-by: Alexander Lobakin --- samples/bpf/cookie_uid_helper_example.c | 12 ++++++------ samples/bpf/lwt_len_hist_user.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/bpf/cookie_uid_helper_example.c b/samples/bpf/cookie_u= id_helper_example.c index f0df3dda4b1f..1b98debb6019 100644 --- a/samples/bpf/cookie_uid_helper_example.c +++ b/samples/bpf/cookie_uid_helper_example.c @@ -207,9 +207,9 @@ static void print_table(void) =09=09=09error(1, errno, "fail to get entry value of Key: %u\n", =09=09=09=09curN); =09=09} else { -=09=09=09printf("cookie: %u, uid: 0x%x, Packet Count: %lu," -=09=09=09=09" Bytes Count: %lu\n", curN, curEntry.uid, -=09=09=09=09curEntry.packets, curEntry.bytes); +=09=09=09printf("cookie: %u, uid: 0x%x, Packet Count: %llu, Bytes Count: %= llu\n", +=09=09=09 curN, curEntry.uid, curEntry.packets, +=09=09=09 curEntry.bytes); =09=09} =09} } @@ -265,9 +265,9 @@ static void udp_client(void) =09=09if (res < 0) =09=09=09error(1, errno, "lookup sk stat failed, cookie: %lu\n", =09=09=09 cookie); -=09=09printf("cookie: %lu, uid: 0x%x, Packet Count: %lu," -=09=09=09" Bytes Count: %lu\n\n", cookie, dataEntry.uid, -=09=09=09dataEntry.packets, dataEntry.bytes); +=09=09printf("cookie: %llu, uid: 0x%x, Packet Count: %llu, Bytes Count: %l= lu\n\n", +=09=09 cookie, dataEntry.uid, dataEntry.packets, +=09=09 dataEntry.bytes); =09} =09close(s_send); =09close(s_rcv); diff --git a/samples/bpf/lwt_len_hist_user.c b/samples/bpf/lwt_len_hist_use= r.c index 430a4b7e353e..4ef22571aa67 100644 --- a/samples/bpf/lwt_len_hist_user.c +++ b/samples/bpf/lwt_len_hist_user.c @@ -44,7 +44,7 @@ int main(int argc, char **argv) =09while (bpf_map_get_next_key(map_fd, &key, &next_key) =3D=3D 0) { =09=09if (next_key >=3D MAX_INDEX) { -=09=09=09fprintf(stderr, "Key %lu out of bounds\n", next_key); +=09=09=09fprintf(stderr, "Key %llu out of bounds\n", next_key); =09=09=09continue; =09=09} @@ -66,7 +66,7 @@ int main(int argc, char **argv) =09for (i =3D 1; i <=3D max_key + 1; i++) { =09=09stars(starstr, data[i - 1], max_value, MAX_STARS); -=09=09printf("%8ld -> %-8ld : %-8ld |%-*s|\n", +=09=09printf("%8ld -> %-8ld : %-8lld |%-*s|\n", =09=09 (1l << i) >> 1, (1l << i) - 1, data[i - 1], =09=09 MAX_STARS, starstr); =09} -- 2.35.2