From mboxrd@z Thu Jan 1 00:00:00 1970 From: Song Liu Subject: Re: [PATCH v5 0/6] enable creating [k,u]probe with perf_event_open Date: Tue, 19 Dec 2017 17:24:04 +0000 Message-ID: <3D2EBCDD-9023-4969-940E-BC03230361E2@fb.com> References: <20171206224518.3598254-1-songliubraving@fb.com> <530f908c-9c34-2db9-1d98-db1c790fa81b@iogearbox.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Peter Zijlstra , Steven Rostedt , "mingo@redhat.com" , David Miller , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kernel Team To: Daniel Borkmann Return-path: In-Reply-To: <530f908c-9c34-2db9-1d98-db1c790fa81b@iogearbox.net> Content-Language: en-US Content-ID: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org > On Dec 8, 2017, at 11:57 AM, Daniel Borkmann wrote= : >=20 > On 12/06/2017 11:45 PM, Song Liu wrote: >> Changes PATCH v4 to PATCH v5: >> Remove PERF_PROBE_CONFIG_IS_RETPROBE from uapi, use PMU_FORMAT_ATTR >> instead. >>=20 >> Changes PATCH v3 to PATCH v4: >> Remove uapi define MAX_PROBE_FUNC_NAME_LEN, use KSYM_NAME_LEN instead. >> Add flag PERF_PROBE_CONFIG_IS_RETPROBE for config field of [k,u]probe. >> Optimize ifdef's of CONFIG_KPROBE_EVENTS and CONFIG_UPROBE_EVENTS. >> Optimize checks in perf_event_is_tracing(). >> Optimize perf_tp_register(). >>=20 >> Changes PATCH v2 to PATCH v3: >> Remove fixed type PERF_TYPE_KPROBE and PERF_TYPE_UPROBE, use dynamic >> type instead. >> Update userspace (samples/bpf, bcc) to look up type from sysfs. >> Change License info in test_many_kprobe_user.c as Philippe Ombredanne >> suggested. >>=20 >> Changes PATCH v1 to PATCH v2: >> Split PERF_TYPE_PROBE into PERF_TYPE_KPROBE and PERF_TYPE_UPROBE. >> Split perf_probe into perf_kprobe and perf_uprobe. >> Remove struct probe_desc, use config1 and config2 instead. >>=20 >> Changes RFC v2 to PATCH v1: >> Check type PERF_TYPE_PROBE in perf_event_set_filter(). >> Rebase on to tip perf/core. >>=20 >> Changes RFC v1 to RFC v2: >> Fix build issue reported by kbuild test bot by adding ifdef of >> CONFIG_KPROBE_EVENTS, and CONFIG_UPROBE_EVENTS. >>=20 >> RFC v1 cover letter: >>=20 >> This is to follow up the discussion over "new kprobe api" at Linux >> Plumbers 2017: >>=20 >> https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__www.linuxplumbers= conf.org_2017_ocw_proposals_4808&d=3DDwICaQ&c=3D5VD0RTtNlTh3ycd41b3MUw&r=3D= dR8692q0_uaizy0jkrBJQM5k2hfm4CiFxYT8KaysFrg&m=3DiAtBi3jXPYfFgvhHTsv8oWyUKiy= EwnGZ34-4jniREz4&s=3D87sxRxoRkJJenQjCtFLJFXkMLvd_rHkY8ZGON9em1Jc&e=3D >>=20 >> With current kernel, user space tools can only create/destroy [k,u]probe= s >> with a text-based API (kprobe_events and uprobe_events in tracefs). This >> approach relies on user space to clean up the [k,u]probe after using the= m. >> However, this is not easy for user space to clean up properly. >>=20 >> To solve this problem, we introduce a file descriptor based API. >> Specifically, we extended perf_event_open to create [k,u]probe, and atta= ch >> this [k,u]probe to the file descriptor created by perf_event_open. These >> [k,u]probe are associated with this file descriptor, so they are not >> available in tracefs. >>=20 >> We reuse large portion of existing trace_kprobe and trace_uprobe code. >> Currently, the file descriptor API does not support arguments as the >> text-based API does. This should not be a problem, as user of the file >> decriptor based API read data through other methods (bpf, etc.). >>=20 >> I also include a patch to to bcc, and a patch to man-page perf_even_open= . >> Please see the list below. A fork of bcc with this patch is also availab= le >> on github: >>=20 >> https://github.com/liu-song-6/bcc/tree/perf_event_open >=20 > Peter / Stephen, I presume this will be routed through one of you, if > not please yell. >=20 > Thanks, > Daniel >=20 Dear Peter,=20 Do you have further feedbacks/comments on these patches? If not, could you= =20 please confirm they are ready for merge? Thanks and Best Regards, Song