Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4069688ybi; Tue, 18 Jun 2019 11:13:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoOszevZDKJu9OJe3QgxCFe/ooHmoyPfQ/y3YiYtU1Tz/G62/GP5/F8kt8QrPaWOVA7+sG X-Received: by 2002:a63:d458:: with SMTP id i24mr3823672pgj.171.1560881601117; Tue, 18 Jun 2019 11:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560881601; cv=none; d=google.com; s=arc-20160816; b=Qly2DMUKTWIIxTvqYTicQVwRC5xjpnjDhZ2q3hQAznPiGKYR6HOhpxW2j4lzP0pOD6 l+USIULsb+QwbemHFUumsSwEPoHhs2MEGe3BG3oVbl89otGN5AflsGwsZZHikcIEKBxn OTxQMMY9wV1oAtY42iLST1G82oBN7w8AX4342iHR6upQ08aPAI5aCMlwqW705tz4xJWB IT0p5+a0p4oHfO8CUJ8BklDqJE6AS7ez48shR7/Ig9pmcj3TsknJzmSTatGBxGFnxZtj jNg3FcvJmyQ4tt1ygnymw09FStGxww0z/+3JDZ0hDSJKxfJw7pVL62nCfbzBpxu8E2O4 obBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=1tcIUy4p7PIqwGw5lw7NMVKnYmUd9JXNaK0BVMRsrk8=; b=MbXM1cd3KbymoD1o9kJg8yC4VSuP50Pas3A95xe/wK7dmQ2cSB0kxZPw7rdjze2Srt +BN1gJHn/g+wn+/rxI4qh0/ZePHE8owHGm5SpW1ug6qMs5Ad2qoM+EeaPKRo5CzKUDrI emlJ2mWWjOS+q4YsXlMRkE+ER1b6MEsF1BmUpMITrgPPzVfzPgLqx0co1y1nC7z4eK9o 56gMdCR4Np0Vu5zSiikpgRPuGKsMgsdY8krQBlzW1O7wBCcajzTsW5UbuliAAmQ/NB2c +85bzEkfrfdIO1O1CoSDaSoiLU3IVo1u4AatCHwX8/m6OVFRc0ihyn7gxSM8S1iZXs8g WqkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l70si2921565pje.68.2019.06.18.11.13.05; Tue, 18 Jun 2019 11:13:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730268AbfFRSMf (ORCPT + 99 others); Tue, 18 Jun 2019 14:12:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:46954 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbfFRSMf (ORCPT ); Tue, 18 Jun 2019 14:12:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CFC64AFEF; Tue, 18 Jun 2019 18:12:33 +0000 (UTC) From: Michal Rostecki Cc: Michal Rostecki , Doug Ledford , Jason Gunthorpe , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next] samples: bpf: Remove bpf_debug macro in favor of bpf_printk Date: Tue, 18 Jun 2019 20:13:18 +0200 Message-Id: <20190618181338.24145-1-mrostecki@opensuse.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ibumad example was implementing the bpf_debug macro which is exactly the same as the bpf_printk macro available in bpf_helpers.h. This change makes use of bpf_printk instead of bpf_debug. Signed-off-by: Michal Rostecki --- samples/bpf/ibumad_kern.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/samples/bpf/ibumad_kern.c b/samples/bpf/ibumad_kern.c index 38b2b3f22049..f281df7e0089 100644 --- a/samples/bpf/ibumad_kern.c +++ b/samples/bpf/ibumad_kern.c @@ -31,15 +31,9 @@ struct bpf_map_def SEC("maps") write_count = { }; #undef DEBUG -#ifdef DEBUG -#define bpf_debug(fmt, ...) \ -({ \ - char ____fmt[] = fmt; \ - bpf_trace_printk(____fmt, sizeof(____fmt), \ - ##__VA_ARGS__); \ -}) -#else -#define bpf_debug(fmt, ...) +#ifndef DEBUG +#undef bpf_printk +#define bpf_printk(fmt, ...) #endif /* Taken from the current format defined in @@ -86,7 +80,7 @@ int on_ib_umad_read_recv(struct ib_umad_rw_args *ctx) u64 zero = 0, *val; u8 class = ctx->mgmt_class; - bpf_debug("ib_umad read recv : class 0x%x\n", class); + bpf_printk("ib_umad read recv : class 0x%x\n", class); val = bpf_map_lookup_elem(&read_count, &class); if (!val) { @@ -106,7 +100,7 @@ int on_ib_umad_read_send(struct ib_umad_rw_args *ctx) u64 zero = 0, *val; u8 class = ctx->mgmt_class; - bpf_debug("ib_umad read send : class 0x%x\n", class); + bpf_printk("ib_umad read send : class 0x%x\n", class); val = bpf_map_lookup_elem(&read_count, &class); if (!val) { @@ -126,7 +120,7 @@ int on_ib_umad_write(struct ib_umad_rw_args *ctx) u64 zero = 0, *val; u8 class = ctx->mgmt_class; - bpf_debug("ib_umad write : class 0x%x\n", class); + bpf_printk("ib_umad write : class 0x%x\n", class); val = bpf_map_lookup_elem(&write_count, &class); if (!val) { -- 2.21.0