From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no 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 25F50C10DCE for ; Fri, 13 Mar 2020 07:56:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E387A206FA for ; Fri, 13 Mar 2020 07:56:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="QIVyIuLS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726533AbgCMH4K (ORCPT ); Fri, 13 Mar 2020 03:56:10 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:14906 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726437AbgCMH4K (ORCPT ); Fri, 13 Mar 2020 03:56:10 -0400 Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02D7rj8W003847 for ; Fri, 13 Mar 2020 00:56:09 -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; s=facebook; bh=BIF+5CYAkd9IPXwEHks5M7IGzncNGEgnEWJtzXAmHYA=; b=QIVyIuLSBRY7UsoFVbVa8Vx9c8fNVVVlKgJBpGIX7qNUffSDF5J+d9mWQImQYAlNIKDk 6Ciq/xixnAbGwKP8bCWLXp/6qUoWs3wVXdUrsNohBGHDx5cgIH7cbn7eVhzr3QNZ2WRg AFsBzpkCzSR6BQVMsJiguJ5xdd3cUgVHxTE= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 2yqt96aw59-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 13 Mar 2020 00:56:09 -0700 Received: from intmgw004.03.ash8.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1847.3; Fri, 13 Mar 2020 00:56:06 -0700 Received: by devbig012.ftw2.facebook.com (Postfix, from userid 137359) id 71D1B2EC2DC7; Fri, 13 Mar 2020 00:56:01 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Andrii Nakryiko Smtp-Origin-Hostname: devbig012.ftw2.facebook.com To: , , , CC: , , Andrii Nakryiko Smtp-Origin-Cluster: ftw2c04 Subject: [PATCH bpf-next 0/4] CO-RE candidate matching fix and tracing test Date: Fri, 13 Mar 2020 00:54:37 -0700 Message-ID: <20200313075442.4071486-1-andriin@fb.com> X-Mailer: git-send-email 2.17.1 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-03-13_03:2020-03-11,2020-03-13 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 bulkscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 adultscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 suspectscore=8 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003130044 X-FB-Internal: deliver Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org This patch set fixes bug in CO-RE relocation candidate finding logic, which currently allows matching against forward declarations, functions, and other named types, even though it makes no sense to even attempt. As part of verifying the fix, add test using vmlinux.h with preserve_access_index attribute and utilizing struct pt_regs heavily to trace nanosleep syscall using 5 different types of tracing BPF programs. This test also demonstrated problems using struct pt_regs in syscall tracepoints and required a new set of macro, which were added in patch #3 into bpf_tracing.h. Patch #1 fixes annoying issue with selftest failure messages being out of sync. Andrii Nakryiko (4): selftests/bpf: ensure consistent test failure output libbpf: ignore incompatible types with matching name during CO-RE relocation libbpf: provide CO-RE variants of PT_REGS macros selftests/bpf: add vmlinux.h selftest exercising tracing of syscalls tools/lib/bpf/bpf_tracing.h | 103 ++++++++++++++++++ tools/lib/bpf/libbpf.c | 4 + tools/testing/selftests/bpf/Makefile | 7 +- .../selftests/bpf/prog_tests/vmlinux.c | 43 ++++++++ .../selftests/bpf/progs/test_vmlinux.c | 98 +++++++++++++++++ tools/testing/selftests/bpf/test_progs.c | 10 +- tools/testing/selftests/bpf/test_progs.h | 8 +- 7 files changed, 263 insertions(+), 10 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/vmlinux.c create mode 100644 tools/testing/selftests/bpf/progs/test_vmlinux.c -- 2.17.1