From patchwork Sat Apr 2 03:37:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Chen X-Patchwork-Id: 12798910 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E268C433F5 for ; Sat, 2 Apr 2022 03:31:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348721AbiDBDc6 (ORCPT ); Fri, 1 Apr 2022 23:32:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351338AbiDBDcu (ORCPT ); Fri, 1 Apr 2022 23:32:50 -0400 Received: from 189.cn (ptr.189.cn [183.61.185.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AE7B2F846C; Fri, 1 Apr 2022 20:30:58 -0700 (PDT) HMM_SOURCE_IP: 10.64.8.41:56134.210091896 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-123.150.8.43 (unknown [10.64.8.41]) by 189.cn (HERMES) with SMTP id 9DCD51002BE; Sat, 2 Apr 2022 11:30:48 +0800 (CST) Received: from ([172.27.8.53]) by gateway-151646-dep-b7fbf7d79-9vctg with ESMTP id 398d774f4ce7412e8266f9abe1d427ff for ast@kernel.org; Sat, 02 Apr 2022 11:30:57 CST X-Transaction-ID: 398d774f4ce7412e8266f9abe1d427ff X-Real-From: chensong_2000@189.cn X-Receive-IP: 172.27.8.53 X-MEDUSA-Status: 0 Sender: chensong_2000@189.cn From: Song Chen To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Song Chen Subject: [PATCH] sample: bpf: syscall_tp_user: print result of verify_map Date: Sat, 2 Apr 2022 11:37:25 +0800 Message-Id: <1648870645-1046-1-git-send-email-chensong_2000@189.cn> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net At the end of the test, we already print out prog : map ids <...> <...> Value is the number read from kernel through bpf map, further print out verify map: val:<...> will help users to understand the program runs successfully. Signed-off-by: Song Chen --- samples/bpf/syscall_tp_user.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/bpf/syscall_tp_user.c b/samples/bpf/syscall_tp_user.c index a0ebf1833ed3..c55383068384 100644 --- a/samples/bpf/syscall_tp_user.c +++ b/samples/bpf/syscall_tp_user.c @@ -36,6 +36,9 @@ static void verify_map(int map_id) fprintf(stderr, "failed: map #%d returns value 0\n", map_id); return; } + + printf("verify map:%d val: %d\n", map_id, val); + val = 0; if (bpf_map_update_elem(map_id, &key, &val, BPF_ANY) != 0) { fprintf(stderr, "map_update failed: %s\n", strerror(errno));