Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752499AbdLDS17 (ORCPT ); Mon, 4 Dec 2017 13:27:59 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:58018 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbdLDS1w (ORCPT ); Mon, 4 Dec 2017 13:27:52 -0500 Subject: Re: [PATCH v3 1/6] perf: prepare perf_event.h for new types perf_kprobe and perf_uprobe To: Song Liu , Alexei Starovoitov References: <20171130235023.1414663-1-songliubraving@fb.com> <20171130235023.1414663-4-songliubraving@fb.com> <20171203170312.rvjo6ifl2pgpjkcs@ast-mbp> CC: Peter Zijlstra , Steven Rostedt , "mingo@redhat.com" , David Miller , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "daniel@iogearbox.net" , Kernel Team From: Alexei Starovoitov Message-ID: Date: Mon, 4 Dec 2017 10:26:53 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::7:15ef] X-ClientProxiedBy: BN6PR21CA0007.namprd21.prod.outlook.com (2603:10b6:404:8e::17) To SN2PR15MB0976.namprd15.prod.outlook.com (2603:10b6:804:20::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 458ea494-0514-40cd-f667-08d53b449bbe X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603286);SRVR:SN2PR15MB0976; X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB0976;3:4rVv9u5O4w9cSDwD7tiwQbbHLYcCreYdwcG7p3ibEvVzCU2gnDiMUA5b8hNl8CWn6olcuPEbzEdJL9Yi67a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3tGeX0Qv8ouysOMTm6uJpwYXRFG8zohquGHW64OTFawOF8LnfffDlrTH9gWMc8XmmY6L3QHlccBqr+slpgAy4zeLnguQexUJSAgDgtch+6QiJmMl5j0RkidMg16NNnI4ooDWw5Qy5ey6Ekpy7rvI80Lk0Ji2sXTKpAp8+1b5Bg9Bb19GushF/x9r0BIR6QWC6REmFV2Hu1tDNYbLH+xSunqzayHbF/RYDU3n01Y9vej94QdGUD2qN3wg8i;4:JdgHk+WH5vadJsDpdaLtwsF7tnHtFQkOel1wEBgUbtckSMB2JnGDtBLY4j7ETbxJdzDR7a7ZbT/E6leDTm/o1Sw5EQQJPinmn78j5D3hmqO1GgjQCCbny7YOSSn7e7vT3FO6lVoB3rA0/5p7x/gzvtWSUTMVHCfvoFH0uzb4q9GXeH0xPmvLL0uiJqbpP59by7CiPno0Z/Dc54XMPqoIphpS3UBi1XELadhoILTi1pwpIGqE/FZzFXC+D4intamxMJBknH/JMpowrcCEi1RkKpfGFqOSGCZIhcfhRgyfc4GgVJmEMbHA5k0B23MUgbVl 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231022)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:SN2PR15MB0976;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:SN2PR15MB0976; X-Forefront-PRVS: 051158ECBB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(366004)(24454002)(199003)(189002)(54906003)(110136005)(52396003)(52116002)(93886005)(54356011)(8676002)(83506002)(23746002)(316002)(67846002)(76176011)(36756003)(53546010)(58126008)(189998001)(25786009)(8936002)(65826007)(31696002)(6666003)(68736007)(5660300001)(7736002)(2950100002)(86362001)(105586002)(39060400002)(53936002)(106356001)(4326008)(65806001)(65956001)(6116002)(230700001)(33646002)(31686004)(6246003)(478600001)(229853002)(97736004)(1706002)(101416001)(305945005)(47776003)(2906002)(64126003)(81156014)(81166006)(50466002)(6486002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR15MB0976;H:[IPv6:2620:10d:c082:1055:9825:e578:2d0d:eb52];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;SN2PR15MB0976;23:JDYLqF/AiXY1OFW5cAMSnJtMlOKBszG61CYO/?= =?Windows-1252?Q?y8VEHbOgYGwueGBLqUv+OkfYLzGTO1Zsifxq9ZltZ6Z34SAqWIbac9eh?= =?Windows-1252?Q?ut11NIoIT7LT6IAYeJY/qak99RB6x5ARv5vFFzN8ahEllluacn+tEr9/?= =?Windows-1252?Q?kUc3wAMvQo3HwKXz2hoQMpZ0/ECuHyBjKkeKty4pvSby798C2jI6tVTj?= =?Windows-1252?Q?iU4BQEKSqEpa36w9o3jQXSRUdcNsAG3qXAGdXQ0W0VCkA4RA0yRbbkRz?= =?Windows-1252?Q?7s+37w1IHIa6jHrr7mob2O784gSkbmu9pI/M0Kkqjj+MlfyHm0ziqQxO?= =?Windows-1252?Q?Z5x5PuaT+tXBaKfQdwFcgz1PyNO4iJ8fbt0sCcITy0nv48wbRLseIF/2?= =?Windows-1252?Q?CyG1y2kTFO8nV2wQkhN/betb182idWEequ0SEoscXAvXilIQT2EbN1eV?= =?Windows-1252?Q?SNNUoIZYjhAAWIqyRDNoO9ev3zsgmja5KeAC93M0UFLGl1gxJI0hOrTf?= =?Windows-1252?Q?yw42C2VolscZlsBkU8jO9UCb/8jaSBbQJZy/UE52nl/g0Ft6M7h62cJ/?= =?Windows-1252?Q?REhrjsga3BY78l3ILTOCOtUyNJFqxPDF3kkNVqrAONkdokqkl8B5NX5D?= =?Windows-1252?Q?ss2gvE5wC6k1IfdTlYbdzLL46ZC60gkKe+7KSi6kR/BhI+oLPBrIO11Q?= =?Windows-1252?Q?Mw8owMRCsBOX00jM2sVlikteDdpY+YXEfri40koqBCZyW/W46LLG2oyP?= =?Windows-1252?Q?nPupjXY3v5EuueAob2IOmh0EIrIxqNJgS29q6jSHwjuG6HPXZb3NL6oe?= =?Windows-1252?Q?4LXKP2f6Sy81uXNdS7d07M4mZ0B7aWEg+885jGRb4+VDf2epNUY+19pO?= =?Windows-1252?Q?m0fS7bMM7lXYAYunm8XRkJLsWS+Ki+h693cafuaIjZx64CRaPRSLVpa3?= =?Windows-1252?Q?ExUF2FEaNYvR7plNnMxxAk+h8ja5OI8bp3JmKNEeArN0gDzZ8oUPjsp2?= =?Windows-1252?Q?QU2Mwv3TDY1WHMH3QqcCeXiX2f5GD8vvkmcja5EbzublO5P4HyQnB+U8?= =?Windows-1252?Q?9oHmiB4nz+aS03JJv0tDfSlPbjBHLbY8Fx0TXEE6pao3ePcPOCHXGcDa?= =?Windows-1252?Q?RJL4JZDOjVaMf/g6pXK6rpVplkkcjDM4JX91WHszG+U77WKWRbePxeqh?= =?Windows-1252?Q?jQxZVEMlkCW93nOYusYdA/n2T0R/RLCblOVE2vIqCiq2cwJHeBT7aBY8?= =?Windows-1252?Q?4s/imFFv5669xVZ9yUawB3ZMWZMHbmo4TifG/yLhiBXh+1XBR30AHjBi?= =?Windows-1252?Q?5HrEh/aoJ8NJGODTwr3MdJ5kmd1LxDENic3urwSs+tqB+GaMilazYHkW?= =?Windows-1252?Q?NQkQz0mJBfwwHmRgdG5UFd7XPbgYN3uek9H/b5SzJS8BGsW0wBSmAucT?= =?Windows-1252?Q?fS1uLf5i8qh/El056FdNi30OVP6iovMsfuBpIw9Ug=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB0976;6:R82pFQYvUVqiNzufX3p5D1do+ZhLSiFM7HpZKg+rTqLDwvojQJJg2HhovH3Iu4DSQhYE5M7F8UVj3kuqMS4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-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2017 18:26:58.1778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 458ea494-0514-40cd-f667-08d53b449bbe X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR15MB0976 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-Length: 2364 Lines: 54 On 12/4/17 10:24 AM, Song Liu wrote: > >> 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 right. that's better. Thanks