Return-Path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:44386 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753071AbeCFS4E (ORCPT ); Tue, 6 Mar 2018 13:56:04 -0500 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w26Isd1d008289 for ; Tue, 6 Mar 2018 10:56:04 -0800 Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2ghx4m0pwb-8 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 06 Mar 2018 10:56:03 -0800 From: Teng Qin To: , , CC: , , Subject: [PATCH bpf-next 0/2] bpf: add support for bpf program to read perf event sample address Date: Tue, 6 Mar 2018 10:55:00 -0800 Message-ID: <20180306185502.1948838-1-qinteng@fb.com> MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org List-ID: These patches add support that allows bpf programs attached to perf events to read the address values recorded with the perf events. These values are requested by specifying sample_type with PERF_SAMPLE_ADDR when calling perf_event_open(). The main motivation for these changes is to support building memory or lock access profiling and tracing tools. For example on Intel CPUs, the recorded address values for supported memory or lock access perf events would be the access or lock target addresses from PEBS buffer. Such information would be very valuable for building tools that help understand memory access or lock acquire pattern. Teng Qin (2): bpf: add support to read sample address in bpf program samples/bpf: add example to test reading address include/uapi/linux/bpf_perf_event.h | 1 + kernel/trace/bpf_trace.c | 20 ++++++++++++++++---- samples/bpf/trace_event_kern.c | 4 ++++ samples/bpf/trace_event_user.c | 15 +++++++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) -- 2.9.5