From patchwork Fri Nov 5 23:42:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12606117 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78978C433F5 for ; Fri, 5 Nov 2021 23:42:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A16F611C1 for ; Fri, 5 Nov 2021 23:42:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232861AbhKEXpa (ORCPT ); Fri, 5 Nov 2021 19:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbhKEXpa (ORCPT ); Fri, 5 Nov 2021 19:45:30 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35862C061570 for ; Fri, 5 Nov 2021 16:42:50 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id k4so11996350plx.8 for ; Fri, 05 Nov 2021 16:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2SeNb4k/4YBOHy+QmKmFWsHUMABAVKw3pqy2CSsibyg=; b=RTb+HMvn9TJsr1YUYE2JlXXwXGe4eg/4o5rUYF7PRoLipqmD9Vj09LKyV4+Dw2FcGD 4NV2/Zaxmefow+mJ32h8qzFtXAue8QLtuskZ9pjBGN2RJGYsKJEZnBI0XnbDVoN8HHWz dPK4bq+4ENIIsZjx0T+me8yQgTmru4fK+BKZQ61u7wHgaYQqmBomyTnMK7HbFa41n7EC LGyT0la3JI41CoEI6xck1JYsEOkbALjmpyyDwzoRqDgq5m3cVQPNv+FEvOshglRjwDa6 g7+KPv5TAe2SLOxTQUAr1dloWgKE2Bu1RxIy/q6D+zoBz6RZUMsCxk2HHHRUcWlYlU+C hd5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2SeNb4k/4YBOHy+QmKmFWsHUMABAVKw3pqy2CSsibyg=; b=YjTPO1it+FSO+KGSi45ZgfzKybwIHeu4Wi89rVaVBZkcs3+Lpg6cPmsZCod2C/LfRY 5LhOv+cT4op75osmNVoJ+MHExq9Yz3Tnimn+0Qn0aV22G1NdGmAeSuPV/LpDQqs7xcyE qkK2RQyrAu7oudPn603K+qAWd0fddOUSMgKIjsfCw+7CK0I3XfffwiBLYWzQBiu3DoUN C5FbZLfx0GHQh9wTQbSf8S8UuLosu1uzYsmVvnIEsuJ8Rs4GuTZ9MKlqKH8EQUkNCYHi bVVJd9WDdtm0Tcs0GYhmSWsXS0iqXMfklnH/9DQ08Wl4dRWIbXj2bUO6J44n8ul1SmSS y97A== X-Gm-Message-State: AOAM532nMxC/Hna3NfOFvuSma9KaDLPapCeQOrvNnTQ4FajqPTLi3Yvk 3tUtmI5tB+oH355sZs4lmOHeE8rXMSRTww== X-Google-Smtp-Source: ABdhPJxfFyHCwOgLCjR+h9YvX+HkPkO71AEO1+MdYKnmuxf9kB/1Pq8On3wByCeURoBZgfPUGv0lSg== X-Received: by 2002:a17:90a:f182:: with SMTP id bv2mr33476840pjb.139.1636155769616; Fri, 05 Nov 2021 16:42:49 -0700 (PDT) Received: from localhost ([2405:201:6014:d916:31fc:9e49:a605:b093]) by smtp.gmail.com with ESMTPSA id 13sm7049194pjb.37.2021.11.05.16.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 16:42:49 -0700 (PDT) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Andrii Nakryiko Subject: [PATCH bpf-next v1 1/6] bpftool: Compile using -std=gnu89 Date: Sat, 6 Nov 2021 05:12:38 +0530 Message-Id: <20211105234243.390179-2-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211105234243.390179-1-memxor@gmail.com> References: <20211105234243.390179-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=951; h=from:subject; bh=jjqhhJOqHI+re0/7VdKKBPTosygXpRDE9rJeGfUMKDQ=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhhb9ASpPKhiRKyyov0zVlIXE0XesQ14LJiV0/D8z1 JW8ivfiJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYYW/QAAKCRBM4MiGSL8RymwiD/ 9gXKNswoGtVQjUDtadPcx/VF1ul0lHIaa4IjRDNhKrs/Ia3PMfqya+8ysI1dfDPgdhm80chiG8mU+n cInmpSyKsOro+GachfOctd9pG9BwO+gXwZu5DyWZeocAA/t9YYV/ZEraVs1k0icZHWZFxh/usx2cUz KBJ/Hdi8QTn6Z7aMM5Tv8uieb4QgMT0t7qrapYdXbGGD2laWZ9bVFsl6LU+RMnAVn1JF055wUAfI2Q PwnwZAApESUd87yVCJYmTaSsFYM/f4+aEb+cOaQpnEmdi9iwCPC+hLFDFhnirkTRErcaGxYRae64dx SWIHpt7noCgMu65idV/wwdtqh0Ay8BG78tjk0V2dTW+xRFGmdLPPTdwMSYaD5gg+aYP/J2oGRdL21M 72XXwTl210KYCCha3MNSufYYIUojl5NToMSQrZUOHn2kVw7cAb4fi597eSk1stN8yCrO2F4jvmAE56 NS38/TRVDWN15xpL1KbxN03pug5oNbXCoqERYGTHBUNQYviZmgaSZDSj5e2eyejzK3B5FxmhmIfjp0 CPbmnviVdUzX2UcCRfvg9zW5lXKKRBjxxJOQEbE5RJfkNRIKiwKA1E3Z3qKXvI3BAdTxj87pGcbYft BRiDMFojQ3LBo7QE/GYVQPVNoHg6iaiizFwwpK0B2U/GED4iXcVp7TdiNw3A== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The minimum supported C standard version is C89, with use of GNU extensions, hence make sure to catch any instances that would break the build for this mode by passing -std=gnu89. Signed-off-by: Kumar Kartikeya Dwivedi --- tools/bpf/bpftool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index c0c30e56988f..71a7b7194c2c 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -65,7 +65,7 @@ $(LIBBPF_BOOTSTRAP)-clean: FORCE | $(LIBBPF_BOOTSTRAP_OUTPUT) prefix ?= /usr/local bash_compdir ?= /usr/share/bash-completion/completions -CFLAGS += -O2 +CFLAGS += -std=gnu89 -O2 CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers CFLAGS += $(filter-out -Wswitch-enum -Wnested-externs,$(EXTRA_WARNINGS)) CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \ From patchwork Fri Nov 5 23:42:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12606119 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C621AC433EF for ; Fri, 5 Nov 2021 23:42:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2D28611CE for ; Fri, 5 Nov 2021 23:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232695AbhKEXpd (ORCPT ); Fri, 5 Nov 2021 19:45:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbhKEXpd (ORCPT ); Fri, 5 Nov 2021 19:45:33 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31D91C061570 for ; Fri, 5 Nov 2021 16:42:53 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id l3so8258730pfu.13 for ; Fri, 05 Nov 2021 16:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ABQOeB9AdPtbQJY+ocY7DetEIFVmOp4s/zu0NqDdUfI=; b=i8Fj+Oq8P8UcUZWHmsE1AsEGw/QjjjLewox2Cb0GXcWecBatFUr28ykZFsWLCdUbtJ a7p0rJRKooJDAydazVXW/y/hW21xheV1TRIscYZpWdYfUtUAZq8vLz0ySxlOaDBs/1Wu iDwRVwTEHCtSDpyGanVpCrfDWwOvB2d/45fUlGGP3nz/Yz/659e5VsqfBEf3poj9AU4z AUlprp3lyuEG0OIV++Plu0s9gfxMBj0n0hI+8dYA+izygQ/KT25ELdoOrLETUOpeeTvG d9zVUdCFluxkMOMyMMOhLUra2IUaPhrUOLPULR44Aj+j0AYpAYTBqvkTRrJ4NsEMPPTH 4ZgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ABQOeB9AdPtbQJY+ocY7DetEIFVmOp4s/zu0NqDdUfI=; b=3wZ3RGBGSCgWXyvy1OPVwNe/Qjo/5A8VRzVY3zPePd2ug0WBrUivumVmbJZvM196YR 98mTpY0SwW+lCTRy4noixQEc74J9+T0vHN7FDyKrU5TX0n6OOi4toRyOpda9gXhndPY6 yqdDrLv7bAtJ0Yb9BOw55F12JAQc/7nrP+bYXAxEk/JutI/Qpz/Flirpx3Ku5RAbKWhP 5PmEEkXOq2A2aSRdlW9LLvaqkfRAYt3nScHL1sztsfk3woXRgLAzXMDzuiFKtGB/5pjc muRSI+yHlXMX2MjHcxVVA/pPk76+yOC/oC1e0r4jio3vZFs6//9ZTiFvRSaYRrSsd52C 72dQ== X-Gm-Message-State: AOAM533dT/K0Y8xQ4xn90tM7DqzkFjFESsdZQxzKLTqTFCd6eTn2YLtE kS60Gz5PplcULaglwYFBpCiFj9gFMa8QCw== X-Google-Smtp-Source: ABdhPJzRdctZwCwl/Cm2F+rpyFL7d7kbkzQ7CQeQN/6HuszoSLTgc66f+EQxFZNtunbAV86HMLqv1Q== X-Received: by 2002:a63:bf41:: with SMTP id i1mr47434805pgo.412.1636155772564; Fri, 05 Nov 2021 16:42:52 -0700 (PDT) Received: from localhost ([2405:201:6014:d916:31fc:9e49:a605:b093]) by smtp.gmail.com with ESMTPSA id m4sm10320992pjl.11.2021.11.05.16.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 16:42:52 -0700 (PDT) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Andrii Nakryiko Subject: [PATCH bpf-next v1 2/6] libbpf: fix non-C89 loop variable declaration in gen_loader.c Date: Sat, 6 Nov 2021 05:12:39 +0530 Message-Id: <20211105234243.390179-3-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211105234243.390179-1-memxor@gmail.com> References: <20211105234243.390179-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1087; i=memxor@gmail.com; h=from:subject; bh=641ALvgZw7a8zc4U/CSTvGJ0wLN+uKQSpctSEAZW8Wk=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhhb9AZCxLeFfs1X2183T5UeQ4Qv259tzQ0z1NhcQZ 8QDnTpaJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYYW/QAAKCRBM4MiGSL8RykMqD/ sEJgKiMOQAhXupIfMOIds91FV/AxLpVbMSYZpAKP4nIq6UhVgud477vYlwL5oqaxIcENy5tC2PLZGb UOVwtMHeuEs12NQ2C4ZvPm5SkpV/AtTe5puX8CYBPxk61Mr40kwTNxeV+f+VEwGcmqLvvKzxwm5PKC Ti3hykQrohlpfRjoOkBZvmz4JvRYudZBKxTeyot3x3Ia1iS+YnVfOLgi28l6/IuH7dFx9g5i0e1hZ+ UX6cIQOx518oc5tkZc4f7IH/QNTG8G3WWMV0FaEZHM5z7vO+23UKc5EfAD7GrN/sGtfe/39SWmndVO csK/nZ7o4rc9YM1Xd5782OWVDWacnbeX9ojoWssxXL+jlJYk6XaxD7o1zf+L7nsG/sO+eZ8foUNF1C l4yEEW2T52f0oTWIw+ymsEQaLgaI3SI14w2NYPhBLKrGcDQV56MHVEY6babbntgBp3Y7fQox5qf6iv sZIxMOQRIR9nmDia6LW2ruMJIA/Pj/Ohk49gxh6s68u4L7jnb/A9NGxaj+J1gAe4IvaS6oUjMj+asU RnfLTBIMno2ATEmW90nT9noCMiRHFv+74nwqqO/ekGjvG9pdDVqC87M2HJnT7tJBZaUwaD+hM65sq7 ZrGIU3uBxK2ixG0qEZc6oS7QtSh0QorOLMhpYIj09lVvP5crS+D/GvG7XaMw== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net From: Andrii Nakryiko Fix the `int i` declaration inside the for statement. This is non-C89 compliant. See [0] for user report breaking BCC build. [0] https://github.com/libbpf/libbpf/issues/403 Fixes: 18f4fccbf314 ("libbpf: Update gen_loader to emit BTF_KIND_FUNC relocations") Signed-off-by: Andrii Nakryiko Acked-by: Kumar Kartikeya Dwivedi --- tools/lib/bpf/gen_loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c index 502dea53a742..2e10776b6d85 100644 --- a/tools/lib/bpf/gen_loader.c +++ b/tools/lib/bpf/gen_loader.c @@ -584,8 +584,9 @@ void bpf_gen__record_extern(struct bpf_gen *gen, const char *name, bool is_weak, static struct ksym_desc *get_ksym_desc(struct bpf_gen *gen, struct ksym_relo_desc *relo) { struct ksym_desc *kdesc; + int i; - for (int i = 0; i < gen->nr_ksyms; i++) { + for (i = 0; i < gen->nr_ksyms; i++) { if (!strcmp(gen->ksyms[i].name, relo->name)) { gen->ksyms[i].ref++; return &gen->ksyms[i]; From patchwork Fri Nov 5 23:42:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12606121 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52B7DC433F5 for ; Fri, 5 Nov 2021 23:42:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BD9560F70 for ; Fri, 5 Nov 2021 23:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbhKEXpg (ORCPT ); Fri, 5 Nov 2021 19:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232923AbhKEXpg (ORCPT ); Fri, 5 Nov 2021 19:45:36 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14887C061570 for ; Fri, 5 Nov 2021 16:42:56 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id t11so11952029plq.11 for ; Fri, 05 Nov 2021 16:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y3qUN7Q6vHz1/cNFucwj2czWifJwk5nCJLMum+Tt9nQ=; b=i84S42fAeDPUxN30Ob/3alT0un319o3FOY9wlVB2mgyIz2Nlq8v7V6QS4/2J2DxWGi 4Y90hgor+hVM/gnZSfc7qzOjmyY9E2i8DSvE32MbzGvKdmo9Ib3ZZOY9nn5v6WTcyU5x Oln8jlOg12OZxwh8onlRTc8Zy3uVdD1Qg/9ZvRwcBZgT2y22ArsleuMYaAZ0ZM7mU+C7 tkQ5KmDvXJ+WJXWUfQI15pAlKxN3uUFr5N1xAWotRPMyiRcq57iQE5Lnlw0QM+j1UsVO YrroH6LKTWf3+MVt5xKqFPGjxVv/vEEqsLXl57VgYy1xJXhA3F/I8s/01ft2AEhvDIKT SV9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y3qUN7Q6vHz1/cNFucwj2czWifJwk5nCJLMum+Tt9nQ=; b=w4a9WkkSyAb2YnQhBrf+ZsqkLtkyhItHjGBhcizMZKYrLrfhw+cIKd1uIgoBqu9Q4S 4/iZC9302aBDS5ChXfL7Wm3VSELmO5vwqv7zu77uGmd0+k1zHb4+y5Wl6/R84VaOjyYT HaIoMUyqI6qZh/dwTiYgcfCKo2DUltOIPosF+U+yqkXq2/Vkzqc52qS5Gu5bMWgHlj7h 3MxSaGJY9jYN6+Sb+h34+8yCev4Nfx7CX9t7ReslD26S/tHJVRO0Sr+GSytcf5ve4Xue TOIxsH94eQ/tfXEqUf17geiQDM+nlZB9wj3u+9xQw9j1zPsupQCWzlIDNafyOjuCj2le LL9g== X-Gm-Message-State: AOAM531yVAMMO4XUrltbA9av/ZOUz9TVH7Sk0EcP0y4eLy2VrhZgqjmS WFGShcH3ZkIdakDvDqEdEkBJpuEmzQAzjg== X-Google-Smtp-Source: ABdhPJyw1HiSXT8fblwbO2ljwYoClGJyFNpi3iPmh1s3zB7ikFcU4CwZWAwYu5sYsHE2sJvcvRpewg== X-Received: by 2002:a17:902:7608:b0:141:9a53:ceff with SMTP id k8-20020a170902760800b001419a53ceffmr51718862pll.78.1636155775462; Fri, 05 Nov 2021 16:42:55 -0700 (PDT) Received: from localhost ([2405:201:6014:d916:31fc:9e49:a605:b093]) by smtp.gmail.com with ESMTPSA id f3sm159709pfg.167.2021.11.05.16.42.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 16:42:55 -0700 (PDT) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Andrii Nakryiko Subject: [PATCH bpf-next v1 3/6] libbpf: Compile using -std=gnu89 Date: Sat, 6 Nov 2021 05:12:40 +0530 Message-Id: <20211105234243.390179-4-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211105234243.390179-1-memxor@gmail.com> References: <20211105234243.390179-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=709; h=from:subject; bh=kaZmcZxbO1LcThXofU2qQtWMmvcubBwOGn2qVhrVF1c=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhhb9A+Og280rCTOInJOgGOL9xQSchgsqCp9OEIKtQ qMlwWvaJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYYW/QAAKCRBM4MiGSL8RyizCD/ wMZIkm4IIXbXKE/rVVJXxtcthAT3bmCHEn1ghw2F2g4f7DmSlRN45mOCwEESHuyFTyphhgDbfhqVXS qeu9zwsXLA1MBRr/Kts+qelkve3xhJ5JBL5NhDhqW7A3XHCw7NtQULdlJJ/NvBG0HcG99IYAxWFdWl zSrPonk8ywFDrsAVLlSL53dp/oDGnrx/UjmiQVIAhk430Ie3loVNWJGD1BMC40u3OuZcgmQOl0EV4c pVhgFDI81Llk5Ju1t+a+XcezvLDhbNJUbqJEC19WMDQVYdFnogxfGjYYpCHr13omsIpi1vCdISg8GU BKLtl41ykfLYeR7UwXJLesA2B+gRWnSNd/KaYBLtgY5qiOl7b35qnjEqDmTt7azFZbPQmMAJop4y9b b4RsxXXPrZMQYrDzGb4F7YONv+wwzbryMx8u2v1rTq9AhXf9wTg6qhPigWQeMtGU/9yczxqwKi0nOa IRrMNp0wxeL8FRpYwycRIlwrABoknB+2iDDsF1Jp+/UB0viO9TIxGuXWQMNs4XoqZCWRKNQcSNamep s/V9UzzM57fqMybkmnEAhcUiK6nTMiU2dgWpCRqBWooz+cjfZ+pQcxwBPiK4Xjg9JZ622GIX+hRKYf nf/Vpzn6eJft3yx8DlaUcnlTaIUu2NZmCah8hzWnSGv8CwwIaFEgC4u7ZTig== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The minimum supported C standard version is C89, with use of GNU extensions, hence make sure to catch any instances that would break the build for this mode by passing -std=gnu89. Signed-off-by: Kumar Kartikeya Dwivedi --- tools/lib/bpf/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index b393b5e82380..5f7086fae31c 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -84,6 +84,7 @@ else endif # Append required CFLAGS +override CFLAGS += -std=gnu89 override CFLAGS += $(EXTRA_WARNINGS) -Wno-switch-enum override CFLAGS += -Werror -Wall override CFLAGS += $(INCLUDES) From patchwork Fri Nov 5 23:42:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12606123 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B7D7C433EF for ; Fri, 5 Nov 2021 23:43:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70FF4611C1 for ; Fri, 5 Nov 2021 23:43:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232930AbhKEXpj (ORCPT ); Fri, 5 Nov 2021 19:45:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232923AbhKEXpj (ORCPT ); Fri, 5 Nov 2021 19:45:39 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BE4BC061570 for ; Fri, 5 Nov 2021 16:42:59 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id u141so2247717pfc.4 for ; Fri, 05 Nov 2021 16:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RcW1TMa8i021xAugZ9tpKPX8GKQUfG/oqDAu9xJXZmM=; b=Pv8rS/p5EmImmdZp30MnevnHIJq2GuZ6HDn3OO1y5xjMHk9w9oqTsnM5vgkM2aJvsi XMcE8vi94i+/viqgq+i3/fk50y/Hr2Gt6WyT/iAp+qAoYDsFSZ4IhvMS7fIXO8sdMHP3 wdW/FU9Ml6sJwJseV8rE4TjUUJiA0YU1ykreQ0vyKKv/baUKz19+W9Mim28E3TkR6WWP BiTyuxdCV8frJ37vn1L6XCehlKXlbebGB3DBo0pOCZmz1QRFsBiv+KYMHdShPbPd56TL fcqlGCFp1KdKia2IZwhVyeHgQX0FSXGxHpNAvhEusXsgEDVib3B/VmT2g9bJmlDr6K0S WvYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RcW1TMa8i021xAugZ9tpKPX8GKQUfG/oqDAu9xJXZmM=; b=32ja5HoUVqVmA8kQ1sLsRbvu23Huuybi5m9NT5dAEUQIYPeRsel17UiS8493KPQ85Y o8puXoQxrqcIhzWwClWK/w55YHj7VAgeBrkGp06GGTIZE6UNMx1Ei+o7AnSkvTZ7c+R9 Bjy9Ll1ERX4TzS68I6kWwqMSuPdWNWIIOz9GsHjqiyOST7ei1OxMUxFBBR3wLDEAgZfx CUWDQsSN8wF2ylL7Tpr+d/o/N+0fhQpgzabUF8Jz10tqtHjBwXqfVLnPIc4AN/IYJJ1g /Nz/sdbSqgWf76ORI2bVXQ1GdTtMdgMRHWpc19ckFwayBIxYq0mQ7lGaGJrZpIvZpcxm frkg== X-Gm-Message-State: AOAM530iWjBB8yPaQdFOaJtN5lQyy2c/uSeiQ95shiSSmqeHgRnz6rb4 fPtrQH5GNnC0p/XLfVvKtgu3UqWQmURUqA== X-Google-Smtp-Source: ABdhPJyNklMlwqOGPFoi0OJEQMc7iv9JOix1Ir7etzL1rcCWkKJK3wD8wE6f9LwKxKqHE8+FqKI7bQ== X-Received: by 2002:a63:82c7:: with SMTP id w190mr30106542pgd.13.1636155778556; Fri, 05 Nov 2021 16:42:58 -0700 (PDT) Received: from localhost ([2405:201:6014:d916:31fc:9e49:a605:b093]) by smtp.gmail.com with ESMTPSA id c198sm6838557pga.6.2021.11.05.16.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 16:42:58 -0700 (PDT) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Andrii Nakryiko Subject: [PATCH bpf-next v1 4/6] selftests/bpf: Fix non-C89 loop variable declaration instances Date: Sat, 6 Nov 2021 05:12:41 +0530 Message-Id: <20211105234243.390179-5-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211105234243.390179-1-memxor@gmail.com> References: <20211105234243.390179-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4129; h=from:subject; bh=SI9IDJn+6GPGCEu0/Mil2+ybHWj1m+z829zOGoWH/B8=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhhb9AJEgQp7uhXVRR4q7lsZg4gW9cny2TS6B4q+tQ HZwwmCOJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYYW/QAAKCRBM4MiGSL8RytJAD/ 9/v/1cd/XBEx+7jW0KyiVTZKzfP6rdVbRgNNK1skDWONkZ2N56ehp98J1QgMaqdroVuDDLeHUuf7om X3hl5R0PEZIJkb6UKZN+qc1c2VXCePRyU+atb76sZS3+U00q0U0gX8hLaqm6ZR0ypvTDHPbjLUrLwW UXQp0+CdVimSZh1wfDdmKT9b5gsYpvlj8PptQFatgZYAw1XS7L8XfSdI2Zt2+cYCMVsOVOILIrOa40 r0oKfBKEKI3YpunHXZYZPy0erYHG+MFc+sJGWKy7KXmQhGw7xD3ADzm4Q1GTtjylnMh8qeswEqNRx4 DDyQwOK5ah4YVv/ZRMIJla/rfqolN2uU61BjjqgCC9aNb/o2q9ZL+vufqXCsdLcE1LkNJbGnL5TANa F4fS9kGB1EtiQ3MKSz28AiTZfbVZR8PbZ5G6RFgKMWfESViQuTwnc8gl42SN2S1X/Ko85uavi1eB/d HPryZXwTA74BXW4dx0Ex/NkEJ4mi8kaaN/GBIhYTiA8gAdsosEmM0NAbYMWgjOVpViKMyy9RojJLZ5 3J4kfrEvQY6okwbytSxRqWASDfKE4IhxNqXxfTwpYygL5+dDXvP/vJHfA/Yoq5UcwkVXxFB5ZvWcZF HyKR3hU45XxJIige/qD3hiURBV7h6popvm2UfTrczXu3u6J4lHxuScPuV1QQ== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Fix the `int i` declaration inside the for statement. This is non-C89 compliant. Doing all of them in this change since they are trivial. Signed-off-by: Kumar Kartikeya Dwivedi --- tools/testing/selftests/bpf/prog_tests/d_path.c | 4 ++-- tools/testing/selftests/bpf/prog_tests/timer_mim.c | 6 +++--- tools/testing/selftests/bpf/prog_tests/xdp_bonding.c | 4 ++-- tools/testing/selftests/bpf/test_progs.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/d_path.c b/tools/testing/selftests/bpf/prog_tests/d_path.c index 0a577a248d34..cc787ad68081 100644 --- a/tools/testing/selftests/bpf/prog_tests/d_path.c +++ b/tools/testing/selftests/bpf/prog_tests/d_path.c @@ -103,7 +103,7 @@ void test_d_path(void) { struct test_d_path__bss *bss; struct test_d_path *skel; - int err; + int err, i; skel = test_d_path__open_and_load(); if (CHECK(!skel, "setup", "d_path skeleton failed\n")) @@ -130,7 +130,7 @@ void test_d_path(void) "trampoline for filp_close was not called\n")) goto cleanup; - for (int i = 0; i < MAX_FILES; i++) { + for (i = 0; i < MAX_FILES; i++) { CHECK(strncmp(src.paths[i], bss->paths_stat[i], MAX_PATH_LEN), "check", "failed to get stat path[%d]: %s vs %s\n", diff --git a/tools/testing/selftests/bpf/prog_tests/timer_mim.c b/tools/testing/selftests/bpf/prog_tests/timer_mim.c index 949a0617869d..f12536c32e2d 100644 --- a/tools/testing/selftests/bpf/prog_tests/timer_mim.c +++ b/tools/testing/selftests/bpf/prog_tests/timer_mim.c @@ -6,9 +6,9 @@ static int timer_mim(struct timer_mim *timer_skel) { + int err, prog_fd, key1 = 1, i; __u32 duration = 0, retval; __u64 cnt1, cnt2; - int err, prog_fd, key1 = 1; err = timer_mim__attach(timer_skel); if (!ASSERT_OK(err, "timer_attach")) @@ -23,7 +23,7 @@ static int timer_mim(struct timer_mim *timer_skel) /* check that timer_cb[12] are incrementing 'cnt' */ cnt1 = READ_ONCE(timer_skel->bss->cnt); - for (int i = 0; i < 100; i++) { + for (i = 0; i < 100; i++) { cnt2 = READ_ONCE(timer_skel->bss->cnt); if (cnt2 != cnt1) break; @@ -41,7 +41,7 @@ static int timer_mim(struct timer_mim *timer_skel) /* check that timer_cb[12] are no longer running */ cnt1 = READ_ONCE(timer_skel->bss->cnt); - for (int i = 0; i < 100; i++) { + for (i = 0; i < 100; i++) { usleep(200); /* 100 times more than interval */ cnt2 = READ_ONCE(timer_skel->bss->cnt); if (cnt2 == cnt1) diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_bonding.c b/tools/testing/selftests/bpf/prog_tests/xdp_bonding.c index faa22b84f2ee..e5b8666e59eb 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_bonding.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_bonding.c @@ -335,7 +335,7 @@ static void test_xdp_bonding_redirect_multi(struct skeletons *skeletons) { static const char * const ifaces[] = {"bond2", "veth2_1", "veth2_2"}; int veth1_1_rx, veth1_2_rx; - int err; + int err, i; if (bonding_setup(skeletons, BOND_MODE_ROUNDROBIN, BOND_XMIT_POLICY_LAYER23, BOND_ONE_NO_ATTACH)) @@ -346,7 +346,7 @@ static void test_xdp_bonding_redirect_multi(struct skeletons *skeletons) goto out; /* populate the devmap with the relevant interfaces */ - for (int i = 0; i < ARRAY_SIZE(ifaces); i++) { + for (i = 0; i < ARRAY_SIZE(ifaces); i++) { int ifindex = if_nametoindex(ifaces[i]); int map_fd = bpf_map__fd(skeletons->xdp_redirect_multi_kern->maps.map_all); diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index c65986bd9d07..0096051e7560 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -1146,7 +1146,7 @@ static int server_main(void) /* run serial tests */ save_netns(); - for (int i = 0; i < prog_test_cnt; i++) { + for (i = 0; i < prog_test_cnt; i++) { struct prog_test_def *test = &prog_test_defs[i]; struct test_result *result = &test_results[i]; From patchwork Fri Nov 5 23:42:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12606125 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 448A4C433EF for ; Fri, 5 Nov 2021 23:43:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CB47611C1 for ; Fri, 5 Nov 2021 23:43:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232944AbhKEXpn (ORCPT ); Fri, 5 Nov 2021 19:45:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232923AbhKEXpm (ORCPT ); Fri, 5 Nov 2021 19:45:42 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD419C061570 for ; Fri, 5 Nov 2021 16:43:02 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id m26so10226509pff.3 for ; Fri, 05 Nov 2021 16:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rlGRxPJS9wpE4HPUTRYoQun0WGMv1Fh8N+2am+AWBZM=; b=fhr4Zek0S4+bj4kai68RKFCm5Q+Ko5w8YOdFRyR6zxGg8p8PY0TyhVGeU4deUWT+Wj 2i/LDR0jfBrPe8FVcdG1mx6OJUsVFoItKOx8VcQUlv+vXbZx4ZvNF24GSwDDDA5w4Oj9 8nPIqXfEmmOsAke0hDQ3bTwTxz3asgLmGbFjTxkI4f9ioU6qVBeIc/iBgM2PxptlyhiY P7uxPUegmxNrLUaMxj2PyTxNKf97ltKsqzzV6JR3iFX8JFTyxs8PqRBiyxIQ3eIF97Iq fn9McUEiH3S/eJM9LPFR2snzU0yEHZS2XPb1ywBDngg0fZHZvflam57seuzxTtcqOLYx tTqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rlGRxPJS9wpE4HPUTRYoQun0WGMv1Fh8N+2am+AWBZM=; b=rvXNQn6jKQIPXRvrtHAyz9rkGPJnJxkM4MFsEtoRzhpQeO/VVNSBw6BMnmDTa+LCBQ VjwvvgKKas2bEy6tcXDouYAxOt0gi2vfsyoLkqd1Bd3CrHaCM4utAijwaPLPET/K0jfX QvsVtcTLIqxfWhoIEo0sy1bLX2clZshN52qQgrpN4HeodASLIVL7Pk4MoLpOoj9dIJuw f/EIF1imIn2hCnGk4eimWwhhqRavVGadQ+PJUYI9Xf3BWu5k2nbhykE34v+5U0iMzLzV m21QzoUVTVfwW+YWHfgZxDF3C+UDudvAWkPnNt8mvPGft8ZM2yQi+Ckw9kmt5YYzl41F V3zg== X-Gm-Message-State: AOAM532Co7051WxReTMaSTonJRo3hZQQoHU1ZBRXnn6+7te9dGWfLQBP JwplQ/RI8iRZ8RYaNxYAfUPphw00JWT2ng== X-Google-Smtp-Source: ABdhPJyuOTpwKNl+6bb/9moi1bUsiH+uYz0rDOhr/6+NKKyZtdgbs9ch9JgdGaBQ8QDSZdmkvzrUyg== X-Received: by 2002:a65:460f:: with SMTP id v15mr11926495pgq.430.1636155782203; Fri, 05 Nov 2021 16:43:02 -0700 (PDT) Received: from localhost ([2405:201:6014:d916:31fc:9e49:a605:b093]) by smtp.gmail.com with ESMTPSA id i76sm6648995pgd.69.2021.11.05.16.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 16:43:01 -0700 (PDT) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Andrii Nakryiko Subject: [PATCH bpf-next v1 5/6] selftests/bpf: Switch to non-unicode character in output Date: Sat, 6 Nov 2021 05:12:42 +0530 Message-Id: <20211105234243.390179-6-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211105234243.390179-1-memxor@gmail.com> References: <20211105234243.390179-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1251; h=from:subject; bh=sWVGM/cgEVt6obywBtebfMquYECOMhAWqlkkvllMdA8=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhhb9BYcBURvsDExwzgvHEVoVR3QbPt1CmDUxT5N3N MLE5jgCJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYYW/QQAKCRBM4MiGSL8RymJLEA C689e4FdR9J/qWhvqgXB1468ZvhdlbUdDxnYKkAJtmj+bKKNx/OUVYyaI3Xh2RSUmCZ7z6Cej1Z5fo 1uFr3qxC8cUgIHgkmWFvL31mTSO/yJpTdsqyJzYOJncMdPaZGpZW9AxJY7ZzD8kopkBaDfAl1r4eWG R+Kb0Ue59TVN1ALoClepJVPQL4lu0vmuTtVZf9nHjuS1/cOwU742jsS6gHODKo2ZM1y2UXBwzgyJ4g 3a1RjJx2QDluJCr+I87f4gPWcdJ7BNBTT/4ElJqUxFJK8D0x9bCOiSKlml5u6pRhAJ0Adwi2OG85p0 xUWfxurXjniaTOHa+HHUnCqDfbiWTdN728m2GqCVFKJuBk5QGZUvgID4PUKH7eG+jeI4G8cj4UPuru NDQl2tayoliZPRB2ZRzv2fyii2SkeN+gSSunfgGx39gRk6ZK0oSmFOp8aE34z5kd4C8yhiFML/Z5iN 8kv7Y6oo4cd9dVPDwx1l/j3BDDkQLXZQBG3tuTZj2PFWWHTsxWVRUl1prQuJebvrOYqr3nEWu2hUJb xm3GsvR/Wsw7HIRMdzTIU+iXUmYgj16jlH5CtDP9t6TDnOSPGR6FplVYlbmRnhePFIooaTraurZ96b Fmn4mz673dU8Kb1t9AqwPlFNxgsGto6KS1P3t7NhQVOjsEuuAjkEYDeeefXQ== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net GNU89 doesn't allow unicode characters in printf output, and build gives the following warning: warning: universal character names are only valid in C++ and C99 Fix by using ASCII +/-. Signed-off-by: Kumar Kartikeya Dwivedi --- tools/testing/selftests/bpf/bench.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/bpf/bench.c b/tools/testing/selftests/bpf/bench.c index cc4722f693e9..58a32ff2eb1b 100644 --- a/tools/testing/selftests/bpf/bench.c +++ b/tools/testing/selftests/bpf/bench.c @@ -126,11 +126,11 @@ void hits_drops_report_final(struct bench_res res[], int res_cnt) drops_stddev = sqrt(drops_stddev); total_ops_stddev = sqrt(total_ops_stddev); } - printf("Summary: hits %8.3lf \u00B1 %5.3lfM/s (%7.3lfM/prod), ", + printf("Summary: hits %8.3lf +/- %5.3lfM/s (%7.3lfM/prod), ", hits_mean, hits_stddev, hits_mean / env.producer_cnt); - printf("drops %8.3lf \u00B1 %5.3lfM/s, ", + printf("drops %8.3lf +/- %5.3lfM/s, ", drops_mean, drops_stddev); - printf("total operations %8.3lf \u00B1 %5.3lfM/s\n", + printf("total operations %8.3lf +/- %5.3lfM/s\n", total_ops_mean, total_ops_stddev); } From patchwork Fri Nov 5 23:42:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kumar Kartikeya Dwivedi X-Patchwork-Id: 12606127 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 224DFC433EF for ; Fri, 5 Nov 2021 23:43:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A5C2611CE for ; Fri, 5 Nov 2021 23:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232950AbhKEXpq (ORCPT ); Fri, 5 Nov 2021 19:45:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232923AbhKEXpq (ORCPT ); Fri, 5 Nov 2021 19:45:46 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E393BC061570 for ; Fri, 5 Nov 2021 16:43:05 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id g11so10190681pfv.7 for ; Fri, 05 Nov 2021 16:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0eybG4zgHlHZXaO8p1AODx4E9lk0YJrK/wZsukAYNjw=; b=g9i0qkcGuQ7KLO5DRxzRKkEhp7ZMRTYWbr2oRHMTTKHtaoCd52ZQVJgjg5mtQzgKIZ 56DoSwzTsKOHDBp30u/+tLMsOjnXLkcPuUoL/5Oj+eGXDeeIy59V5y7vET3GIlUE/9k+ yIsOqXJvCG+JcqG47u3nCadTwrJ+QL4tAwYiLn4ymMJlcplT+3rBApT5x10rUBsXzeEn COmtgzPLt5nbXc87s3zmnB2cv4esDzEhfvZqRhT6o0v64OXFBm6FilNg+wCf/kwY+mqy Zx9SNpuwN9dqNGdRGoHQFpXRf5hMhznUk187mL7md9szfiWWNXbfA3q3jF6aZ7cemrXH 76Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0eybG4zgHlHZXaO8p1AODx4E9lk0YJrK/wZsukAYNjw=; b=69FvGuPTnslZJI+frl3ErjHoxZfNZ34RA+AGxBS0v3ik0Mxgq1JT1k0mqe12I6rCLF bE10M9bAadxW3kt4lIH8XBpxHa/3VXdEvhMpOETqZXy8GpQ3tPiYluoH5m9TmskFWRIi 0RxySRLMCmmKbVgiytEZgz89tUP0PcK2xJYBjX2dVClEaqUIhLy6ifElBfHxOK0Yl8w0 qqc+7ujYE2TGm6Gg51QIuMrE+wjAYmup42DnDTaID1/SGs73wbAqXs8ihXqZqpjahb4N ctc9LrU+xQ3Uudlgw3Y98u61vBSL3JPF9dRXnbZ/54/R6t4s+8OwYRByeap1i0IyI2e+ 3pcA== X-Gm-Message-State: AOAM530dqEf3QXSuOReDHTMyEFEA8EbN32Ei+uSFZllhwLHNN+9SC/tn QG5ieaN3jvicvQx8aQaNHPDUzkxkrBIypw== X-Google-Smtp-Source: ABdhPJyCRmGt4d7+qUg3Jd1XloF1LBkh0Kt6xByJRPcoxZG4VHbVY6i/WNJpaNvXrPdETTffCvKVzg== X-Received: by 2002:a05:6a00:c81:b029:30e:21bf:4c15 with SMTP id a1-20020a056a000c81b029030e21bf4c15mr62314964pfv.70.1636155785203; Fri, 05 Nov 2021 16:43:05 -0700 (PDT) Received: from localhost ([2405:201:6014:d916:31fc:9e49:a605:b093]) by smtp.gmail.com with ESMTPSA id s6sm8580213pfu.137.2021.11.05.16.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 16:43:04 -0700 (PDT) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Andrii Nakryiko Subject: [PATCH bpf-next v1 6/6] selftests/bpf: Compile using -std=gnu89 Date: Sat, 6 Nov 2021 05:12:43 +0530 Message-Id: <20211105234243.390179-7-memxor@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211105234243.390179-1-memxor@gmail.com> References: <20211105234243.390179-1-memxor@gmail.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1624; h=from:subject; bh=E6MXCGxoOvlgGE9ca71nhl0pQaB51dC/kNCa6tTnyhk=; b=owEBbQKS/ZANAwAIAUzgyIZIvxHKAcsmYgBhhb9BJuvuXyfVou8At7IZJTi5/CboTE2qzZvr/GW/ rmAaZGiJAjMEAAEIAB0WIQRLvip+Buz51YI8YRFM4MiGSL8RygUCYYW/QQAKCRBM4MiGSL8RyiIBD/ 9JU/GeU1xwSbW2iPIh16vB0KsU0OM4jGOltpyCsO2C81a5e553JTiIXrxRfRKvW/+Lzp8jB4qgV4Iv ORlVE8AozzgdOW6lVvRQPx8DpjkAUocgPEgoKDBKK9C1xhfx238sGZR9hKCv6vAEdi4ZycjCHP6k8U 0F2K13fsMVseg89+wczrlzZLFjpQJ8QVBMNS5zZlJYcw7kFagPtxS1UGaH+KjcwHUdedtWpByfo9BA JuYBvA3U8yp7RJS4u70ZBUdmIDZSDTd8QbPZNanAyYfihehcxqJSFPriTwo4frMCmyOa1xX9aWC1TW B0slr9So6qaox5/mdorw5K/ek/ZAZRYjW7k/Qs7FXiomyW/vJyQaXptZ7WPjryENL9hbi9EIuWEdvf 2c+yFgI08njp7KLSkv7KazgXssmnygv7Ps4ojrBUdo3t8hIA4/ur18p6eE9+GaFgDZOg5tPRb1o9Zq IvCQb4gLjdlz3zb2NZYJYh4xjhNoPCk5GL0qEJ0q82LdbJ+x8iuPXtZI4tWeE9Idjb4lLbwJnUQts5 ftKFJYZNJNQ+XBavFc7/4Hbu8HbVlxssmLO3j4UNSLAAF4bDQ2i1Spvo+1u51pwt97ypdAckBWYtoM 0ITthS0ZSJtHxB87WgqilKRm6600EGfAVM/OkvJN+55rXMdJzHjRRNQbkRKQ== X-Developer-Key: i=memxor@gmail.com; a=openpgp; fpr=4BBE2A7E06ECF9D5823C61114CE0C88648BF11CA Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The minimum supported C standard version is C89, with use of GNU extensions, hence make sure to catch any instances that would break the build for this mode by passing -std=gnu89. Also, copy out CFLAGS for C++ test so that we don't end up passing -std=gnu89 to g++, otherwise the build generates a (harmless) warning: cc1plus: warning: command-line option ‘-std=gnu90’ is valid for C/ObjC but not for C++ Signed-off-by: Kumar Kartikeya Dwivedi --- tools/testing/selftests/bpf/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 54b0a41a3775..6239e51c310f 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -33,6 +33,9 @@ ifneq ($(LLVM),) CFLAGS += -Wno-unused-command-line-argument endif +CXXFLAGS := $(CFLAGS) +CFLAGS += -std=gnu89 + # Order correspond to 'make run_tests' order TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs \ test_verifier_log test_dev_cgroup \ @@ -519,7 +522,7 @@ $(OUTPUT)/test_verifier: test_verifier.c verifier/tests.h $(BPFOBJ) | $(OUTPUT) # Make sure we are able to include and link libbpf against c++. $(OUTPUT)/test_cpp: test_cpp.cpp $(OUTPUT)/test_core_extern.skel.h $(BPFOBJ) $(call msg,CXX,,$@) - $(Q)$(CXX) $(CFLAGS) $(filter %.a %.o %.cpp,$^) $(LDLIBS) -o $@ + $(Q)$(CXX) $(CXXFLAGS) $(filter %.a %.o %.cpp,$^) $(LDLIBS) -o $@ # Benchmark runner $(OUTPUT)/bench_%.o: benchs/bench_%.c bench.h $(BPFOBJ)