From patchwork Wed Oct 14 04:36:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 270008 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16A7DC433E7 for ; Wed, 14 Oct 2020 04:36:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6B332222A for ; Wed, 14 Oct 2020 04:36:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="aFeEuhWh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730021AbgJNEgz (ORCPT ); Wed, 14 Oct 2020 00:36:55 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:18210 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbgJNEgy (ORCPT ); Wed, 14 Oct 2020 00:36:54 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09E4ZM1k011016 for ; Tue, 13 Oct 2020 21:36:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=facebook; bh=sl7Keq768JmYFP2QGaRO4xIW+BR0M1wIdYM0fJxUwXE=; b=aFeEuhWhXweCDqnRWk9q5mMw5Vmj7Wl/9zKjNPKtt9umKDdv39fEYy/lbgZn/c7lwg6B HgI8eZsGZ7MbNSz77b/+gTlrR64rbsTiSsuRO4Gpz69W9NxJPMLIbI/FPcGHHkXejHZj iakMx35SwnAUPpUWBjDsFHZK7a/e/Kc6WxI= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 345ff5k721-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 13 Oct 2020 21:36:53 -0700 Received: from intmgw003.03.ash8.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 13 Oct 2020 21:36:52 -0700 Received: by devbig006.ftw2.facebook.com (Postfix, from userid 4523) id 662C862E1AE9; Tue, 13 Oct 2020 21:36:41 -0700 (PDT) From: Song Liu To: , CC: , , , , , Song Liu Subject: [PATCH bpf-next] selftests/bpf: fix compilation error in progs/profiler.inc.h Date: Tue, 13 Oct 2020 21:36:38 -0700 Message-ID: <20201014043638.3770558-1-songliubraving@fb.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-14_02:2020-10-14,2020-10-14 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxscore=0 spamscore=0 impostorscore=0 priorityscore=1501 phishscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140031 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix the following error when compiling selftests/bpf progs/profiler.inc.h:246:5: error: redefinition of 'pids_cgrp_id' as different kind of symbol pids_cgrp_id is used in cgroup code, and included in vmlinux.h. Fix the error by renaming pids_cgrp_id as pids_cgroup_id. Fixes: 03d4d13fab3f ("selftests/bpf: Add profiler test") Signed-off-by: Song Liu Reported-by: Jiri Olsa Acked-by: John Fastabend --- tools/testing/selftests/bpf/progs/profiler.inc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/profiler.inc.h b/tools/testing/selftests/bpf/progs/profiler.inc.h index 00578311a4233..b554c1e40b9fb 100644 --- a/tools/testing/selftests/bpf/progs/profiler.inc.h +++ b/tools/testing/selftests/bpf/progs/profiler.inc.h @@ -243,7 +243,7 @@ static ino_t get_inode_from_kernfs(struct kernfs_node* node) } } -int pids_cgrp_id = 1; +int pids_cgroup_id = 1; static INLINE void* populate_cgroup_info(struct cgroup_data_t* cgroup_data, struct task_struct* task, @@ -262,7 +262,7 @@ static INLINE void* populate_cgroup_info(struct cgroup_data_t* cgroup_data, BPF_CORE_READ(task, cgroups, subsys[i]); if (subsys != NULL) { int subsys_id = BPF_CORE_READ(subsys, ss, id); - if (subsys_id == pids_cgrp_id) { + if (subsys_id == pids_cgroup_id) { proc_kernfs = BPF_CORE_READ(subsys, cgroup, kn); root_kernfs = BPF_CORE_READ(subsys, ss, root, kf_root, kn); break;