From patchwork Mon Mar 12 20:39:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Liu X-Patchwork-Id: 884866 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=fb.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.b="ULbZrb4B"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 400VHl59wrz9sSK for ; Tue, 13 Mar 2018 07:40:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932360AbeCLUkt (ORCPT ); Mon, 12 Mar 2018 16:40:49 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:58588 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932171AbeCLUks (ORCPT ); Mon, 12 Mar 2018 16:40:48 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2CKZADT003250 for ; Mon, 12 Mar 2018 13:40:47 -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=h5UjnUmfeaowF85hpvvfDha/FOt8ljmYDbzI2R69QuA=; b=ULbZrb4BLyUKu4F1QnkrIwdJ/SS4B/jCVPtvVliC45ZdTpDMEvZYcRtMaQsZWA4XMkol weTGBzPnXdiu+3Bd2hjuDeNTVaRRaloFdaZAPf/xnttTNH+LkQAq1KlvYnVbLLeBxCFK R0q40n6uxgjpwHugz/BmbtKEFTsxsCAPneo= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2gnx2t0jv8-8 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 12 Mar 2018 13:40:47 -0700 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB08.TheFacebook.com (192.168.16.18) with Microsoft SMTP Server id 14.3.361.1; Mon, 12 Mar 2018 13:40:11 -0700 Received: by devbig102.frc2.facebook.com (Postfix, from userid 4523) id 52DE5428274B; Mon, 12 Mar 2018 13:40:11 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Song Liu Smtp-Origin-Hostname: devbig102.frc2.facebook.com To: , , , CC: , , , Song Liu Smtp-Origin-Cluster: frc2c02 Subject: [PATCH bpf-next v4 0/2] bpf stackmap with build_id+offset Date: Mon, 12 Mar 2018 13:39:55 -0700 Message-ID: <20180312203957.2025833-1-songliubraving@fb.com> X-Mailer: git-send-email 2.9.5 X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-12_11:, , signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This is v4 of this work. Changes since v3: 1. Add fallback when build_id lookup failed. In this case, status is set to BPF_STACK_BUILD_ID_IP, and ip of this entry is saved. 2. Handle cases where vma is only part of the file (vma->vm_pgoff != 0). Thanks to Teng for helping me identify this issue! 3. Address feedbacks for previous versions. Song Liu (2): bpf: extend stackmap to save binary_build_id+offset instead of address bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID include/uapi/linux/bpf.h | 22 ++ kernel/bpf/stackmap.c | 251 +++++++++++++++++++-- tools/include/uapi/linux/bpf.h | 22 ++ tools/testing/selftests/bpf/Makefile | 12 +- tools/testing/selftests/bpf/test_progs.c | 164 +++++++++++++- .../selftests/bpf/test_stacktrace_build_id.c | 60 +++++ tools/testing/selftests/bpf/urandom_read.c | 22 ++ 7 files changed, 529 insertions(+), 24 deletions(-) create mode 100644 tools/testing/selftests/bpf/test_stacktrace_build_id.c create mode 100644 tools/testing/selftests/bpf/urandom_read.c --- 2.9.5