From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751563AbdLSRZp (ORCPT ); Tue, 19 Dec 2017 12:25:45 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:43188 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbdLSRZl (ORCPT ); Tue, 19 Dec 2017 12:25:41 -0500 From: Song Liu To: Daniel Borkmann CC: Peter Zijlstra , Steven Rostedt , "mingo@redhat.com" , David Miller , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kernel Team Subject: Re: [PATCH v5 0/6] enable creating [k,u]probe with perf_event_open Thread-Topic: [PATCH v5 0/6] enable creating [k,u]probe with perf_event_open Thread-Index: AQHTbuP/xqeEhhUyekSddMETxiIlJaM539aAgBEetwA= 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> In-Reply-To: <530f908c-9c34-2db9-1d98-db1c790fa81b@iogearbox.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3273) x-originating-ip: [2620:10d:c090:200::7:ff15] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR15MB1512;20:saGADeyu6cB0Xe2wxYfoLNw4IAzFjd34Y5jXy8vTUfJhfvZgYRVJps+eBztrPjUiIKounsGmnxB3v+Z6vnWlDtva/614lSciXFTpZbvRv0dfUHeFcLFtoCP3229mE1tigh3UbQDlg849bBYHkju3jBRT/rQ8Mt5PjqaxPWnCXLU= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 30095333-e17b-458c-b0ca-08d547054db3 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:CY4PR15MB1512; x-ms-traffictypediagnostic: CY4PR15MB1512: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(10436049006162)(166708455590820); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(11241501184)(6041248)(20161123555025)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:CY4PR15MB1512;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY4PR15MB1512; x-forefront-prvs: 052670E5A4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(376002)(346002)(189003)(199004)(24454002)(5890100001)(33656002)(105586002)(2900100001)(57306001)(36756003)(966005)(82746002)(99286004)(2906002)(3660700001)(3280700002)(478600001)(5660300001)(53546011)(6916009)(106356001)(6306002)(7736002)(305945005)(54906003)(86362001)(76176011)(68736007)(59450400001)(77096006)(2950100002)(6436002)(6246003)(6486002)(229853002)(14454004)(25786009)(6506007)(97736004)(6512007)(83716003)(4326008)(316002)(81166006)(8936002)(81156014)(8676002)(575784001)(50226002)(102836003)(53936002)(6116002)(142933001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR15MB1512;H:CY4PR15MB1512.namprd15.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 30095333-e17b-458c-b0ca-08d547054db3 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2017 17:24:04.6042 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1512 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-19_09:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vBJHPn6D001681 > On Dec 8, 2017, at 11:57 AM, Daniel Borkmann wrote: > > 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. >> >> 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(). >> >> 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. >> >> 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. >> >> Changes RFC v2 to PATCH v1: >> Check type PERF_TYPE_PROBE in perf_event_set_filter(). >> Rebase on to tip perf/core. >> >> 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. >> >> RFC v1 cover letter: >> >> This is to follow up the discussion over "new kprobe api" at Linux >> Plumbers 2017: >> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.linuxplumbersconf.org_2017_ocw_proposals_4808&d=DwICaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=dR8692q0_uaizy0jkrBJQM5k2hfm4CiFxYT8KaysFrg&m=iAtBi3jXPYfFgvhHTsv8oWyUKiyEwnGZ34-4jniREz4&s=87sxRxoRkJJenQjCtFLJFXkMLvd_rHkY8ZGON9em1Jc&e= >> >> With current kernel, user space tools can only create/destroy [k,u]probes >> 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 them. >> However, this is not easy for user space to clean up properly. >> >> To solve this problem, we introduce a file descriptor based API. >> Specifically, we extended perf_event_open to create [k,u]probe, and attach >> 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. >> >> 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.). >> >> 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 available >> on github: >> >> https://github.com/liu-song-6/bcc/tree/perf_event_open > > Peter / Stephen, I presume this will be routed through one of you, if > not please yell. > > Thanks, > Daniel > Dear Peter, Do you have further feedbacks/comments on these patches? If not, could you please confirm they are ready for merge? Thanks and Best Regards, Song