Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009AbdLDSZx (ORCPT ); Mon, 4 Dec 2017 13:25:53 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:59726 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbdLDSZs (ORCPT ); Mon, 4 Dec 2017 13:25:48 -0500 From: Song Liu To: Alexei Starovoitov CC: Peter Zijlstra , Steven Rostedt , "mingo@redhat.com" , David Miller , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "daniel@iogearbox.net" , Kernel Team Subject: Re: [PATCH v3 1/6] perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe Thread-Topic: [PATCH v3 1/6] perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe Thread-Index: AQHTajYQKJbJFCkg5UmzbkvzfKlS6qMx3MoAgAGpKwA= Date: Mon, 4 Dec 2017 18:24:59 +0000 Message-ID: References: <20171130235023.1414663-1-songliubraving@fb.com> <20171130235023.1414663-4-songliubraving@fb.com> <20171203170312.rvjo6ifl2pgpjkcs@ast-mbp> In-Reply-To: <20171203170312.rvjo6ifl2pgpjkcs@ast-mbp> 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::6:3732] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR15MB1509;20:fJ71x+kn4FCKAxC17BiVoDBG2T56Xa1lyw/qDfeOC96+ufy3Lw7U2/u/zpRtxqlC9mo0LBce2ShlnldBRDasYC3x5cykiqxm7A5sMIqrHwlUx+6GVNWsnTIw0aPWH6QTzw2g36yG3lNaUGaZh4gDGCoehD+HUEk88E8kI0pbyMQ= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 30f90da5-215e-4e38-6345-08d53b4453b5 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286);SRVR:CY4PR15MB1509; x-ms-traffictypediagnostic: CY4PR15MB1509: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(67672495146484); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(11241501159)(6040450)(2401047)(8121501046)(5005006)(3231022)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123558100)(6072148)(201708071742011);SRVR:CY4PR15MB1509;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY4PR15MB1509; x-forefront-prvs: 051158ECBB x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(376002)(346002)(366004)(189002)(24454002)(199003)(8936002)(81166006)(81156014)(8676002)(97736004)(305945005)(14454004)(33656002)(68736007)(6506006)(76176011)(86362001)(6436002)(99286004)(77096006)(7736002)(53546010)(82746002)(50226002)(229853002)(6486002)(3660700001)(6116002)(2900100001)(36756003)(2906002)(83716003)(189998001)(57306001)(3280700002)(102836003)(54906003)(53936002)(4326008)(478600001)(39060400002)(106356001)(105586002)(5660300001)(25786009)(6512007)(2950100002)(6916009)(6246003)(101416001)(316002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR15MB1509;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: <7A3C3E4CB1C17341929F637C488F1448@namprd15.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 30f90da5-215e-4e38-6345-08d53b4453b5 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2017 18:24:59.0223 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1509 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-04_06:,, 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 vB4IPvRp017584 Content-Length: 2264 Lines: 53 > On Dec 3, 2017, at 9:03 AM, Alexei Starovoitov wrote: > > On Thu, Nov 30, 2017 at 03:50:18PM -0800, Song Liu wrote: >> Two new perf types, perf_kprobe and perf_uprobe, will be added to allow >> creating [k,u]probe with perf_event_open. These [k,u]probe are associated >> with the file decriptor created by perf_event_open, thus are easy to >> clean when the file descriptor is destroyed. >> >> kprobe_func and uprobe_path are added to union config1 for pointers to >> function name for kprobe or binary path for uprobe. >> >> kprobe_addr and probe_offset are added to union config2 for kernel >> address (when kprobe_func is NULL), or [k,u]probe offset. >> >> Signed-off-by: Song Liu >> Reviewed-by: Yonghong Song >> Reviewed-by: Josef Bacik >> Acked-by: Alexei Starovoitov >> --- >> include/uapi/linux/perf_event.h | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h >> index 362493a..247c6cb 100644 >> --- a/include/uapi/linux/perf_event.h >> +++ b/include/uapi/linux/perf_event.h >> @@ -299,6 +299,8 @@ enum perf_event_read_format { >> #define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */ >> #define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */ >> >> +#define MAX_PROBE_FUNC_NAME_LEN 64 > > I think we have to remove this restriction. > There are already functions with names longer than 64 characters > in the current vmlinux: > trace_event_define_fields_ext4_ext_convert_to_initialized_fastpath > trace_event_define_fields_mm_vmscan_direct_reclaim_begin_template > > How about we drop this restriction and use NAME_MAX internally > without adding new uapi defines ? Yeah, I agree that we should drop this uapi define. How about we use #define KSYM_NAME_LEN 128 If a function name is longer than KSYM_NAME_LEN, we get warning like: Symbol long_long_name_abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_ too long for kallsyms (204 vs 128). Please increase KSYM_NAME_LEN both in kernel and kallsyms.c Thanks, Song