From patchwork Sun Aug 7 22:21:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Maguire X-Patchwork-Id: 596065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 948D6C25B0C for ; Sun, 7 Aug 2022 22:34:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242351AbiHGWeD (ORCPT ); Sun, 7 Aug 2022 18:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242348AbiHGWdj (ORCPT ); Sun, 7 Aug 2022 18:33:39 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E5A9E80; Sun, 7 Aug 2022 15:21:57 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 277J48t2022517; Sun, 7 Aug 2022 22:21:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2022-7-12; bh=JyyDj0EDBU3gXLp7WDCu3LF4u2KVOuFua0EfbMhPhgI=; b=aH5PgtQQ9DhAuDAlCH3dwLULWEG9MH1lVAWhhr3IyQSGGmXkXNT2w7drW2eJ5v5lZ74A VgL2Er6GO168pbj631HbwlsU9H5SD20xHqHpgu3fB5zQ/kplB6IN9y/0RXm9wgrdwW8Y s6NYvNK9QNKbLPmcoMXEqP6VJZ7RyIiqn9yU1OtrAYz+tWD/8TdCMJQcUSWityR12IeF Dkm2fzSUNvD3jDwWFBeVyyhg4WhmuNL6Ov1mR36JV8iBh8d1YRSAbsr7rxgDGYyDukCD ysFSLy1HboEjTb3nphhNom1jEcCWZuu5U/YRI4eSEzV4ifYeLRJrtRVYFc5J9C/BL9pb OQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hsgut205j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:45 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 277Cj4Wk008519; Sun, 7 Aug 2022 22:21:44 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2043.outbound.protection.outlook.com [104.47.51.43]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hser1du2g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AZsC5EwApoVZGtqYhW/rrZ8JzGHvczzh9h5sS3acX5v1evqlfBOpBLmn+gRtJ6k+FsHKC8Tux2JO1GQzmiQCv/UVXH+hucHAeP2WgXzUt4oxsIc8Bgvh54LnpYgDOTuJJKnGH7YhcVFE35fPtELTpy4B1fc04J5XlrO0K66gT9nZ2D3+LJqny+t054UzGIz4TSuGYxFqmyGP8Oi12dC1jD9Bp1eeAZ62dk1576lqtkgcd4fZCmHbUVpD2rzmZyXLqMOxHvkGvZX9WKaPO40X5bv2G/k+8unzZq3TgAt/hSZQNZC8Pt32fsUR2xDODfRyVvYUzcuyk0omhwpOJZ0J2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JyyDj0EDBU3gXLp7WDCu3LF4u2KVOuFua0EfbMhPhgI=; b=OM4tmjaOJ3H18nb7+v0jYVxaLhQrMQSlHrzlSlS9J19VyQlTX1DuRoE+TO67eJoAJupuGXpXCmsB8lhkI+2T9qTsAhEKbFpc0H0VmPaG4sjJvcuqPk2KLDPv/FAc54DZJpoyXDvWnGehoPxqz0Zyvh2A3U7zrOYp2ullToGUa2hxkG87Kh7sIdj8r86IKibWhWXT29Hx1iKc+2Jmr7XMVF/+lfXcEZEcLgfL6ZDxoRcn8029gGsAI8+n1oRMN9+Bsh3e0gf10mNhkQCWawbas7ZS3f8gDqEjsuCuNU5A3wJKcQ+sQ+A/YMRzrAO12/NIPNJaAi6nv9rNk13jdIy55g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JyyDj0EDBU3gXLp7WDCu3LF4u2KVOuFua0EfbMhPhgI=; b=Lgt9JCGcVfD+TaTHO83JcpGI7dy4ymLAxiIRQ5jQyJo32QVKomqSOClIhEJAdN32lSiOTSW9hlFds9V7eV+rfUlZsx5nFPtT/XMQdqpSZ0nHykS8TkKGnepqqYBHVCjFRjpBJM4lJKbG3Zfjj4B69bTZs6KeIdcUDjq8ciIzmmY= Received: from BLAPR10MB5267.namprd10.prod.outlook.com (2603:10b6:208:30e::22) by MWHPR1001MB2381.namprd10.prod.outlook.com (2603:10b6:301:30::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.18; Sun, 7 Aug 2022 22:21:42 +0000 Received: from BLAPR10MB5267.namprd10.prod.outlook.com ([fe80::b1c7:933:e8c2:f84f]) by BLAPR10MB5267.namprd10.prod.outlook.com ([fe80::b1c7:933:e8c2:f84f%9]) with mapi id 15.20.5504.020; Sun, 7 Aug 2022 22:21:42 +0000 From: Alan Maguire To: rostedt@goodmis.org Cc: corbet@lwn.net, mingo@redhat.com, shuah@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Alan Maguire Subject: [RFC tracing 1/4] tracing: predicate matching trigger crashes for > 8-byte arrays Date: Sun, 7 Aug 2022 23:21:20 +0100 Message-Id: <1659910883-18223-2-git-send-email-alan.maguire@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> References: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> X-ClientProxiedBy: SG2PR04CA0201.apcprd04.prod.outlook.com (2603:1096:4:187::23) To BLAPR10MB5267.namprd10.prod.outlook.com (2603:10b6:208:30e::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 927b604e-6fe5-467a-2fdb-08da78c33434 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2381:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lp5igK+aIUp9LpAlk4S9PyYN629GN+VTpvQLFxzrgU7Qj99jXeaxzqtwhxe5UxxjaWzKCTOtV4T9QyaSXfFkmi0vl3rjqZIn6G4mgzAZq4E5HxoF532XfIaGjMK6sJcrkv2rS/RdJy6lTHta6xAal1Lr74tgaq2lFufJ0WUlDcf18IHQRyaGbul7OUtg49M+H/v1gfFsZFX//aloUqZQvK1y1uQr6ygeJO5mtxazdu25pmdyWc69n/SG9JmAw2MobnslNTHZxD7c62jlSYHDeW/YSua8I2nXWIaQ/SPWcbjY7Y4fgcq99eQrIejQwRSH+dCnEVVXfUfdYet8TtQ+NvNlEZ7sB5B9pZy30qe8xxYZ22gm6F4SS2hVvs1aNWHCAp6Gx6Sm7SKyV2AJ3J9P4BniQ0s7Eae1ridYhDr7O/PxbBupItvmX+mLSZ73Y54v9s43n4TuXztWAPrZoqbMWrqzKgESEcFcR91G0tLsRyLw+GGfJdlqYvigRY0yW+Emqw1N58nK042QtncP/uoXmlTTTC47Ie/mv/AzDVJLf5jMmobIz3VmPpjMEC2L69fGEyETjygJUIQ+tR13sNuGq3AGO9GJns7DL3OCycpxx1ty7WOWpcCyVA4szrUtjaxeQdCTMvzdgTcYl91VinCdtZB82xrim05/aDgRSBska35s/BD1OpxVlyEzCV169fdU94lo9oNagWyzjcFY1ftPFTYBNmUlMQgOuL/eO8yAr2iY04EzrsRwKf5tduNgmvaos+AvIt22U6bYx59sl4KzXfYUtb72mSAufTt53eapzWg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BLAPR10MB5267.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(39860400002)(376002)(366004)(396003)(346002)(6486002)(186003)(52116002)(107886003)(966005)(478600001)(86362001)(6512007)(26005)(41300700001)(6506007)(2616005)(6666004)(2906002)(66946007)(66476007)(66556008)(38350700002)(38100700002)(4326008)(8936002)(44832011)(5660300002)(316002)(6916009)(36756003)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e0Gj0tzHs5/Y6lVWWHkoe2wboqVrm3AFi+fYO0Fhpf5hjBwXOm5z/bscyejYWuLSjdF/hKyWdO/WH3GXIY5EmcxhlSOcAjVlY92ZS3M4437adqBsfjUQiB6KnV78Ed8hmCJFR9aw3+Nd0VTtse2ztlh9eDNEEgrjASJ27NYQbze4mnJ1YWrgGqDRW3u+lsNb0vBxFR/z7+4M9DpxRsvxD5h+Snf04kQyhtWuxC5sC6VqnVmLcXaD3piK6MxJifrbGUIKowyspmSmpGSuFkjA25fSVOySYPQEsaHtmGD/npRZKo9axWWgtCN17/rrEhE0P2ZnmThnDPPnXRhYZS9bXGsLfNN2cMOXTgw715dlUMONyOYAIY8E8WzbWRGNJskkzxwWLeyM9MK8jY7joTb20aaBFsyIrc2MSxMkVUROlgjkqbeZYjhAr8gEhGJVlpWzMVpdsoYFUAOWV4FO+p4YG0MmHKM9YSTA+W6SM++zdgTbz/40ZmXbLYp2zvmH4g5OLv/IiiAYct0nQULExlTLSrrmvnMds5DnM4HOTdYJKinPrzEbYlP42bDQvXzmb6ykCDAzrWYMCRcCpFpNKigkEZX3NlDj72/GST6IEAkt3TX3yc0lg4p3NZt+Crm+ajKKgjHSmmQSJF7Jtu1D0DEuSIsQ8IvoQ3xccevOjdH/S0Mo8RuSsRyKEjqjTMgH6vM9yUIb9qmevg4+37YBxZFOD/QQj4iqgo/i8Xk5jStSAGUUoaSJQQakklWz3AAnQd0gzNATtTtc2s0+lx4CiP2hywmtSNWT6/g80qRN9eEQ/BQOO14SLfwQCSLwD/skCD/Fqjg/J8PfeFpRVJywsYEY1E6SdWZEW+VFe+GWSXhZyVWf2Z9mU0ZNdIQ/pk5qi7uLXdZyUH7RQqMgn+ZJIYh6oHcuqePd093FRZlbBu3Sj0vvsiYw/AXDOs1w1Q7phJMq3PX956ou7s215JRgtZWbzD76FX2Iof7e3up7RtIIhP9GV9Cyrk5jguJ2Dl0CZFtWTwjfcBbrOlzlNrSUbmuCA4o/bj2p14brAkCLJxsjVWhwda0VSgDfTNGT2jMuYOZay9/P7xyHAKss3aNB8r3GBfM1Ys9JQMQz19eTpW6vYnXPrjK+LFFQj6wZVcRTuCVOsVeAL9PfS9pmN2PB5KNWFdmb12TfsWYP19wim+kBvi6dNFvpJDRmbgBVElHpkZ5HR9zUFk7Iyndy1KEPkarbPv+cJJwjkNPKZp/8hrOfcutWhM+xZnuS/pJC0/2kHQatwh4kJH9lW14pBDpPNP1LJNpOJXvDd7I3OyjIu5wHVzLpIGDKOaVcb39qdBEctsrzakmyp26O8HE6FeY3+yXGR6PVtg2VC/yhkUr3lT5YT9lNTcREckkHwR1T+m1MB+QZ049Jn0tb5OU9yFN8WcPwAbif2Uhpb6QiXaQ3J+/rZh2+Fuf97HjmqkalgrfIJU8VlbLrUjN17mUQvUBH5fPfUNP5CyZiFEfW1X9oHWEtIgq0sEELJVJA8WI9Xva1klYVX85camXDEAtysHco0muF/Pyji7aGl5lEgFV+G91oEPsGWDuiEyYzRyWeiUW3d8VG X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 927b604e-6fe5-467a-2fdb-08da78c33434 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5267.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2022 22:21:42.0034 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OgsYxPHj86oM9s63s0wFNnz6KTIQ3TeDW2582J3ONqk2Q7prlFrpG+z5/CL+BIL81OhDh9E3a6fRBAT8FygNOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2381 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-07_15,2022-08-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208070119 X-Proofpoint-ORIG-GUID: qQu79qGieTzk9J0YXpICAxdrlkyuYRbo X-Proofpoint-GUID: qQu79qGieTzk9J0YXpICAxdrlkyuYRbo Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The following (wrong) use of tracepoint filtering was enough to trigger a null-pointer dereference crash: cd /sys/kernel/debug/tracing echo "saddr_v6 == 0x0100007f" > tcp/tcp_receive_reset/filter echo 1 > tcp/tcp_receive_reset/enable wget https://localhost This works fine if saddr - a 4-byte array representing the source address - is used instead. Fix is to handle case where we encounter an unexpected size. Signed-off-by: Alan Maguire --- kernel/trace/trace_events_filter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 4b1057ab9d96..65e01c8d48d9 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -1490,6 +1490,11 @@ static int parse_pred(const char *str, void *data, else { pred->fn = select_comparison_fn(pred->op, field->size, field->is_signed); + if (!pred->fn) { + parse_error(pe, FILT_ERR_ILLEGAL_FIELD_OP, + pos + i); + goto err_free; + } if (pred->op == OP_NE) pred->not = 1; } From patchwork Sun Aug 7 22:21:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Maguire X-Patchwork-Id: 596315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21CB1C19F2A for ; Sun, 7 Aug 2022 22:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242249AbiHGWeH (ORCPT ); Sun, 7 Aug 2022 18:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237133AbiHGWdl (ORCPT ); Sun, 7 Aug 2022 18:33:41 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51B28192B0; Sun, 7 Aug 2022 15:22:02 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 277J3xeV016982; Sun, 7 Aug 2022 22:21:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2022-7-12; bh=Z166aQrGxFvGfqgfYk2k/eb+MdkHWLkpuHni0wWAVkg=; b=dV6O4vwHXYs/0K/rdPAzy0CNmkMd7nw2H8K8NRQ8fS7thX2ZO7pBAM3qUpeG04nybWRr dCtL7pd1DHtWPsx6KkDudg9Q+6wdN1DJsWdsrbVhv9nuTgbqWeJ/sp86rFcsYbsLcBm5 wn89PDp7nq1HLleoQ5YYPrjlKD2ag8FVpzCAtJ2gW3cn0O2z7mi6yLS4KRBQJleJCSRn DRvOc78i0hUW0mN1DA3EUSehaZwBStOyZEy34UP/6K5pkG4wDX8ZPFli5eOZUbr72uOr WIWm+7cRZDqlEa7OyQkPPDlgs98cOFoML9+6P26IVwsEzXUGci/vQSn6al05H68Fg5oX eA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hsew122ty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:54 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 277D0o49035674; Sun, 7 Aug 2022 22:21:54 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2045.outbound.protection.outlook.com [104.47.51.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hser15gwb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gX3Xxw8JMoC30pER+VnLH+n3CUb8zE1v3IgoeH2AGaHeUYCIxWj/6kcNUznuJPo98GDBDW56qAvvSr1QXijQI2zgS0OzPq38XG2HRZpK2mCgKuOHg64cUYRS8t7qC0lBtsZB0E1MRXGNgIZuXOfeDBI8GX5ourYhqB3+VOEf7EwPBxLo3L7B3HUnm/xUVPAHA97H5I6j/Sro0nfuag86A0eDJwsaiCgAXCCeRY+laYs09JmoVxEj8NoAmWDtPIqYlTM4fDsXVUcDKpUw2qnUq+O5dWkrxb9Xr4LQgS2R23PMzA9SkcNzN5tqzjmdx0TE94LVGfcKeth1oj3eEOJhSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z166aQrGxFvGfqgfYk2k/eb+MdkHWLkpuHni0wWAVkg=; b=KkgJJ1XWeDyqYFT3/6u87TuCQM9HIYuKO7JXmpc1D/4NHSzjIwPf9x3ClNfTmIFR852N86SWtxcjkYRiUXmgdpeOrMlZVYYGZ8r5bQ3lGemLL96VrCsDR/2H4YbrFNesmXEZ91OtL16QtFmYhAAjDVgJRCOADdMq5B2RMmY1QRxLSlP+VuXewb87geJbgj2YOth6p+ZJlMjMKNjFHTUfzisAa40GHW7QI5XMS/xVya8Wt45ft0lg6bF1H04DsAUvhS/IK2FP5EFbUl1g3RzWntzd67NYsGblKrDw9bY5sQDKaI7VBfRUPQg8vCBrvqto5jNR37Y3ch/ll+xWPmYXUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z166aQrGxFvGfqgfYk2k/eb+MdkHWLkpuHni0wWAVkg=; b=PJm23vCXsCiT2x0yljtPm1mGuKMJDKjYSEWpPui530mux1DwTJ4t1UlY0myye/8HCMqjClvMat6Q1lBJexs13hIA0dyVNpRSKIlCrBet+OmIU6CFGAyUDmhEtrJLIe4YdcWv19IOOOXto723hCizpz9WmNC7b5STPfyT2xpD/D0= Received: from BLAPR10MB5267.namprd10.prod.outlook.com (2603:10b6:208:30e::22) by MWHPR1001MB2381.namprd10.prod.outlook.com (2603:10b6:301:30::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.18; Sun, 7 Aug 2022 22:21:46 +0000 Received: from BLAPR10MB5267.namprd10.prod.outlook.com ([fe80::b1c7:933:e8c2:f84f]) by BLAPR10MB5267.namprd10.prod.outlook.com ([fe80::b1c7:933:e8c2:f84f%9]) with mapi id 15.20.5504.020; Sun, 7 Aug 2022 22:21:46 +0000 From: Alan Maguire To: rostedt@goodmis.org Cc: corbet@lwn.net, mingo@redhat.com, shuah@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Alan Maguire Subject: [RFC tracing 2/4] tracing: support > 8 byte array filter predicates Date: Sun, 7 Aug 2022 23:21:21 +0100 Message-Id: <1659910883-18223-3-git-send-email-alan.maguire@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> References: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> X-ClientProxiedBy: SG2PR04CA0201.apcprd04.prod.outlook.com (2603:1096:4:187::23) To BLAPR10MB5267.namprd10.prod.outlook.com (2603:10b6:208:30e::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23a8a8f5-227b-48d6-7a54-08da78c3370b X-MS-TrafficTypeDiagnostic: MWHPR1001MB2381:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i/WotO10XI0MD+mst9sO2Su6xEGOqJ1u5h7uTQnhjFnNPoBCtPgQnVTE56l9MWe/u3v4fwRXZlzH/DtKQ2oxfD42njOWg4rX/ZZfigdxuPPPfL9/Z7naTCoEAn/nIWx9IAIHI/xuIRxMTcpWv56jVRSrAXXxKijOy7st1026hL3jKS2UnMiLB+lfPgnJOzUFpTR56SzJh9CYZ/r4kdNrBMv7AJ+2NBVb3xoevzG6d5Nw81476GyyhjlCp7ptbU9Vv53sB4Yfm/RJV2PfxtAzdqg4k5Xy6VYww2l8eeWQSjByDw64CBX4JNpAcb7VvlaKFExzoj9ROL8318t2ruESKInwZnz0qpAiq4v5gWWqDhUkpT4+Kau1MAF4KE3gQttHG9pHMkRIl3nL25gHb8XwG09LPeZ1/Y5PF7JyEj2wo3VLFrPaeCd27tH13WqltlF9PH0TblzcHZWGMBUA2vMifSS89e+F8kEqYjyNrN65bylvOhcfenCucN7NZR1aAKkB7eHGwMydIWX+8fQieZE681NOL7dnOWAcUEHZCjjkELiGRp68MDv6g81+a3C3Rr/rhSIGCg5riXSKDsNxU89hvd3t+rHoWYHHbIUvwPy6wScxVpys7XqnC7eS71tTnR9+ccTWlR8GYp8qBf/oKilBG6QZoHd8Q7JbLgmXfccBxVMGLpzBm+PeWopLi0aJfSZ0GsnHaN9f3fl6QGbfTcyyejjKugfHZIF2VG4AIvLIjw3gHfCuHQdkBz1GmbsffZCeVfTv5sAGDIevlM3d2Nhp7VbIOzfWSZae2KgcSOBJOnY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BLAPR10MB5267.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(39860400002)(376002)(366004)(396003)(346002)(6486002)(186003)(52116002)(107886003)(478600001)(86362001)(6512007)(26005)(41300700001)(83380400001)(6506007)(2616005)(6666004)(2906002)(66946007)(66476007)(66556008)(38350700002)(38100700002)(4326008)(8936002)(44832011)(5660300002)(316002)(6916009)(36756003)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K+LNFeVgwth7BYTHa2NFMDW0H2Kxb4UE+7QqnNifLyBH2El/uNKrkaEYwgY7EiKx/2mY58j06XyU86Z6IChlzZvrDeqvpaHlzz4wFxR+ElORAT/VTQqfMpsF2EcIr/Y/Mux3rTJk1KO4vwyYHgiVS+2XMZiiLLVO/1SNrassl1tJWS2Vvg8Q3rY8uqF4Oqo+VTKkM8sFVweE0cMdxfP+Nkg/tWNnSUstfwtfWDrUzPw6l7FDMLzA/8cJAkA4ZBgpFvz0ZSX5HRo8gVNNycAc02ZdasRjL0MzDn8fFzaG0+eiaBvqftAP6UqiPMy4LVCcLrXOS2X7ZcxLBhkFxzabgQJJBHQxoRIlscPTIJWD2QebLpVmLsVenakWKLj2YFWtkfa8nHGnzEpjyin8lujSyNOi96MLOIWMfeL41NfzMVE6JpjEpRc98l5CIpnOf2fS9jonTR+DAW9zuvdBWjv/uQrraXu1CAoi1iOfcP622cxhXSUTp5nltHS8wQSdCNIza/Fbq47Zteh7GgpCBi3VmU0ay0yUSXK+IHtFCht7xPYYgHElfhyAuXIRQtVdZIrgX8AJzHEAxDGz8r6QmbNj5ozYcdk8TgrMDtff9ch9si5hRQx8Fm8CPnoxL1w4HYsGPsF7qRFGwbW0wYQhQ7nAY0OdjavCV89DrqHFCZPA5DQXF86lTene1RlWjEmgrkegKbNiH8VOOruxVWaa6Wp3OC/ggg8n2y14m/85BMWF+1h1GvsrQTz4Nbf6KkDYSPHI44cB0sQuRycOANdHo/czSGJUOSTs2GNYsLj95uc1C/GoqZ/BRPfketvrxpIeklN6aF64w9ER817w3eFglZu5RgvPqYXKFdNjcVPgOgSnbCyubEPBQVlJYRwXxbKfaFSBf0TwUXvwq/n4/pdRu42bGgpTCZZLe4UU04gVUmu7FQiTxHzr2WX7d/LoSgC8uvIL8+xm4Dlz+qDTA73hrLVBv9aRFDMjt7TBThvSw4B7wX5KSD5GLwhF874Nbf+KcyO28+XLOPXyzYMR8/dJkskiruLTguAD6/MwivLmMNJn2xfPF3tAnrxXKQHqOZwULy0yF7ttyT1yf+jv61+aDj49HVnnRfNIGrnUykJBcqLfq6x0q/VWJ6pnygh1HStV95WGwEWfXbu3gJTenWvjPadWH3HL8HFIW5cE1BxfhGd902TDTJje3j6GxKa3cRa4G48tcHFksIAUcIDuEPbcLUa0XrZ7gvJcIg6oET7BCglsU/ZQ/jghfuHWJKYK7JwtGwiynGaOoLMZiaIzj2sNs7rFm6G8wQojaGLVQ+GihL5ygeFYTW48uflYM68eUIadsBhWaAKHgtyuM8wucsxgeNb+xV4XRlWExSiXlOsQwZ7DGtwrzdlYGsHg7emdSTz+21kJQB1hxYohsOjUSoS9ATqwfd4xqDRBUsoQj+J2JM1FCVrC2pDUxyf5xkW99mbRMT4/btnF1t5saCeRlKlI/3Am6dWLlnuuIgumokN/8Qtx2y7dliUWUDqq76ZvXBs3cULE4oRxLzsTyNl3skb8BITZ9qA6AZP+0pi704qDoqJD3xyMbnk8rsBk7Ta9JPHcWfBf X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23a8a8f5-227b-48d6-7a54-08da78c3370b X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5267.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2022 22:21:46.7230 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JtPnmc3762FC3I3G4Vz6CqLR52IQYSOEsZ9KDwrUFbfFMa8P8Wr21XiMnO+m61jkB/MXd1WVN63QHDRDUvPw5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2381 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-07_15,2022-08-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208070119 X-Proofpoint-ORIG-GUID: jm-nh2aDWMHdwcPpab0ipnfpKq3U6Efl X-Proofpoint-GUID: jm-nh2aDWMHdwcPpab0ipnfpKq3U6Efl Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org For > 8 byte values, allow simple binary '==', '!=' predicates where the user passes in a hex ASCII representation of the desired value. This representation must match the field size exactly, and a simple memory comparison between predicate and actual values is carried out. This will allow predicates with for example IPv6 addresses to be supported, such as filtering on ::1 cd /sys/kernel/debug/tracing/events/tcp/tcp_receive_reset echo "saddr_v6 == 0x00000000000000000000000000000001" > filter Signed-off-by: Alan Maguire --- kernel/trace/trace_events_filter.c | 54 +++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 65e01c8d48d9..31c900b6a83c 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -147,6 +147,8 @@ enum { PROCESS_OR = 4, }; +static int filter_pred_memcmp(struct filter_pred *pred, void *event); + /* * Without going into a formal proof, this explains the method that is used in * parsing the logical expressions. @@ -583,8 +585,11 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, kfree(op_stack); kfree(inverts); if (prog_stack) { - for (i = 0; prog_stack[i].pred; i++) + for (i = 0; prog_stack[i].pred; i++) { + if (prog_stack[i].pred->fn == filter_pred_memcmp) + kfree((u8 *)prog_stack[i].pred->val); kfree(prog_stack[i].pred); + } kfree(prog_stack); } return ERR_PTR(ret); @@ -841,6 +846,14 @@ static int filter_pred_none(struct filter_pred *pred, void *event) return 0; } +static int filter_pred_memcmp(struct filter_pred *pred, void *event) +{ + u8 *mem = (u8 *)(event + pred->offset); + u8 *cmp = (u8 *)(pred->val); + + return (memcmp(mem, cmp, pred->field->size) == 0) ^ pred->not; +} + /* * regex_match_foo - Basic regex callbacks * @@ -1443,6 +1456,45 @@ static int parse_pred(const char *str, void *data, /* go past the last quote */ i++; + } else if (str[i] == '0' && tolower(str[i + 1]) == 'x' && + field->size > 8) { + u8 *pred_val; + + /* For sizes > 8 bytes, we store a binary representation + * for comparison; only '==' and '!=' are supported. + * To keep things simple, the predicate value must specify + * a value that matches the field size exactly, with leading + * 0s if necessary. + */ + if (pred->op != OP_EQ && pred->op != OP_NE) { + parse_error(pe, FILT_ERR_ILLEGAL_FIELD_OP, pos + i); + goto err_free; + } + + /* skip required 0x */ + s += 2; + i += 2; + + while (isalnum(str[i])) + i++; + + len = i - s; + if (len != (field->size * 2)) { + parse_error(pe, FILT_ERR_ILLEGAL_FIELD_OP, pos + s); + goto err_free; + } + + pred_val = kzalloc(field->size, GFP_KERNEL); + if (hex2bin(pred_val, str + s, field->size)) { + parse_error(pe, FILT_ERR_ILLEGAL_INTVAL, pos + s); + kfree(pred_val); + goto err_free; + } + pred->val = (u64)pred_val; + pred->fn = filter_pred_memcmp; + if (pred->op == OP_NE) + pred->not = 1; + } else if (isdigit(str[i]) || str[i] == '-') { /* Make sure the field is not a string */ From patchwork Sun Aug 7 22:21:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Maguire X-Patchwork-Id: 596316 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26D37C25B0D for ; Sun, 7 Aug 2022 22:34:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236386AbiHGWeF (ORCPT ); Sun, 7 Aug 2022 18:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236056AbiHGWdk (ORCPT ); Sun, 7 Aug 2022 18:33:40 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 871A0BE16; Sun, 7 Aug 2022 15:22:01 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 277J42kj011175; Sun, 7 Aug 2022 22:21:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2022-7-12; bh=87e7sJRRIb8E/f8Ay+qjZ/+l6W6enZHvFRdYgHOQ2+k=; b=JdB+r6vB1wIEUYI/NnA6i8TJTK3qwhwkpnRGYcwhqjuKCWL5jpeDe67VogBRhOzyjPoL gTGIWRvjgQHeW+ZYOboX50D4f5AIApkL+R+GOv3vs66F61ThhKsC363StSzwmn0mp63G qEJxAUpe6D116adrlJBDlk8YJ1jDUGK6yErp251MB+JekSzWA6txyuRNhb3osyP8VvjJ fc8brLro7nHIChxJHJGhIvxUhJ5WoFvLH/eAHdez8VregNxURnc2fAVqYT4aUAl3rEAH +/nCdO9ybfeynqrvvD9m7PmXXrdGMoYhPbUaSYqvVSwpNET/T/qfIR/d1vECXERdlL+t HA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hsg69j0d3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:55 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 277D0o4A035674; Sun, 7 Aug 2022 22:21:54 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2045.outbound.protection.outlook.com [104.47.51.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hser15gwb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SbUErCieMJT21jWM60WlPVQFjl4zjngRDe1JRuzFj2zmC4qYWiSGkVWtrkpd44FGF6T9VOfxD153KEYzwZs8RWl6fmeLQXgvJWk5DAJf2gVLvWkTeM2A98yPFdbtjVtb0Jz9bBk4UVHXuHQpKgUEbcMAf2S7UnBSz4ipGjor8k7vNj5/rFAVrUd2i3OF2q4RWRMda2FvL+0S1bpAj+FdxIpmOcoq7jWx+X89fEF5+qUIomNnYjXhvWhe1XFD6H0cuyWswwGzOdn+yTTHu3G8i+I1qxy4+8w4XE3h8NNP79ddOPpXZmJHNSy5sSuIfgqKGsI6vy1jjk94lNFuhDIk+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=87e7sJRRIb8E/f8Ay+qjZ/+l6W6enZHvFRdYgHOQ2+k=; b=EvnN+iNI10oe/WLdfHQhJ7WVMhtDMgVzDjP0EKFwq+QA1oKp/oT1qj/av3KwQNxJ9c9sA3RNpIKmCoiI4K2pVoBcqBSGaTUZtW6gERspoXWQAos0JVAMmSlRMpcG0qD4+8u0FPwn8v88229sApqXRBv4hhob98YqegaWfq3O0vaIP6GXpRdubKbSYcq3Bdw1QZ3BQjcAzi/BIlflBKV6klYdqNiBM53IMyWACTwKjjHNZ2IdA3Gb++ZNDtOi/mE3kUiCOnNvUPY7Gs5lOU9RM7/e+z5YbTIsYQN7JR7wDfYyCtQEX0R8vU2d/ofaTSMJT7E1fJRmK52lS6dHUOMQaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=87e7sJRRIb8E/f8Ay+qjZ/+l6W6enZHvFRdYgHOQ2+k=; b=FBcnlt7aqSvHZg4wnWwduXbLOOv7jbj0zA703L2G3neCTeGHm4/jJtTzSnQl3oVqbP3V/Mb9/n0YIKf9H6HgomIEWdpPwxP8h81wBDaF2nu8wncQbarxIjuQu53mYqb4NDelkqktFWT0fCtMc6eOodzMucBFda1blnP/N3yY54k= Received: from BLAPR10MB5267.namprd10.prod.outlook.com (2603:10b6:208:30e::22) by MWHPR1001MB2381.namprd10.prod.outlook.com (2603:10b6:301:30::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.18; Sun, 7 Aug 2022 22:21:51 +0000 Received: from BLAPR10MB5267.namprd10.prod.outlook.com ([fe80::b1c7:933:e8c2:f84f]) by BLAPR10MB5267.namprd10.prod.outlook.com ([fe80::b1c7:933:e8c2:f84f%9]) with mapi id 15.20.5504.020; Sun, 7 Aug 2022 22:21:51 +0000 From: Alan Maguire To: rostedt@goodmis.org Cc: corbet@lwn.net, mingo@redhat.com, shuah@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Alan Maguire Subject: [RFC tracing 3/4] selftests/ftrace: add test coverage for filter predicates Date: Sun, 7 Aug 2022 23:21:22 +0100 Message-Id: <1659910883-18223-4-git-send-email-alan.maguire@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> References: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> X-ClientProxiedBy: SG2PR04CA0201.apcprd04.prod.outlook.com (2603:1096:4:187::23) To BLAPR10MB5267.namprd10.prod.outlook.com (2603:10b6:208:30e::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b13b59f-ff40-44dd-1f03-08da78c339ea X-MS-TrafficTypeDiagnostic: MWHPR1001MB2381:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F4FKP30YxyTlcb55LYrdxtzHBJjd19gkECpGDKLfe3feJzSCe3Bv6J9K8Nb6zoHoVxznQCmiJF1FB0lLM8sTbDVT2eOdBkloJmO45V5ejT71nUjK23gMxJVLeQFc/YYA2zJ32zVeef7ZmXqEney6V6Y+u1HXmM3WKf2ltLF2HUWQvDR/REP8mHY2DDdnV6zBqtfyDgdxy4WoM04nl02lzJy82iNR+3U7MrfTGPMzbegcIo5YpSHKeNE4n3056HXhktTX/Sl0EGou+MEdg5SUF35l76T4G1T6CcTUiEa/SCky5b/tn91Vxu7wtQgjo0x64+ia8eFUEPQElmWXVVRFDd4m3fhtFBY9WgcyW4GjQNvfPmrrl7GlgpBDuThU7sDPK22SS9JX2N6p1n3qqKvAjskfXRHEoQd39GyZcaMkaI70cnZiHUP0mu+8dxImiMq/aE9EPQT9YAqKhmWnCfeF9kWny/7MTCzGZ6j3Ya2hgUzRbkPahQ/Vl0QY1E3ZgXEPd3nV1YvavO5Hofdmw6WDNddk9OSfzPGHQfMmh8eHC9V5PgKFXaSFsFVSf3ZQHnXHAvjWGLfn8NzvvTpMJMvYUSTqnJBuQzuZ0dPc9cHX9iAN6CGpfV89ddUZ9g5sP9ebPyWB5y4vth4Yk4/+8l6I1Q1kbWrO1LZYJwQuVQaKN96/D3n3UMsZyoDm+Jlc7b0mXDcPLJWdzjDCfp7wGc1PRQBEdEl/yL0VDV8DT+wRwzXa2pxtzDa1wQshBSYd/mKY2Jduth/0sgkz9gnystyd1jwXxNKCJMGlu4MhRfv9Dag= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BLAPR10MB5267.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(39860400002)(376002)(366004)(396003)(346002)(6486002)(186003)(52116002)(107886003)(478600001)(86362001)(6512007)(26005)(41300700001)(83380400001)(6506007)(2616005)(6666004)(2906002)(66946007)(66476007)(66556008)(38350700002)(38100700002)(4326008)(8936002)(44832011)(5660300002)(316002)(6916009)(36756003)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aEVSS+8STCQ/h2cRBA8wqHnlpFNhoZ66pNj3yD3c/Y8AWmzyr0PTeWAwlS3uvd2onU4s6vdMDzuN2eGdnn807jFeiDDYADfroetL0cgIbnCXxDhsK2BXRBxt7VgDH16z6niYFBTazd1RTNYB8jn2kt7QqafLHB7wHe1NL5MCQ93a4yT1tTFq7sFXVZfBTb/2crI4gelshlI2PDEq8IIrShxDtT+VID+kDnDLMJzKBT52QncWD0G6arLxvktYAewp42WCvefoYqRUnE+OgH0dm7eucN4+yqWPqMEETzJ/qxdxB4fLP+Kgv8j1koxXc/bdfOA6sAdSYmsf4Zl4+c9r70YbQ9jpa6mUbkjp5Z5c7BPuCkEMkBneny/sPIrA3NGxjilm1roU6hSihcQX59R5c0zbeJ9TCw+3UiTQAPYb/wXh2gAsQgHpQ4mifCaph15WjnAL5tnF1PpADl0FPFpBcqzhBYbS9G1S8lbOUJnWtga/3Zv99jelmlaT9PR6+Dpc5WZNLa8RbGEx9Z5qccKbqWV5lNRd5poNCugugJfKq135SetuWSD6fKOM/VkyR8ciKmy7m8kYrCbQVx9XLHH8FxTrC4cSnD2N4JM5yQcN4F8NyuiTWaEzUSRtONJ+6MHFhuCvj/m8Dufg6zjZ9gXrDsH/JaGbQMQluxKOsLDwd+JFBj5GEhXXdKvx12sNkuFSr7Tp/EJnFBA52zEVhaBt6Df+CUeiY6UMKuDIvAI+O58ipnKRegKx5Ovq7yKi0d4zl9zjOytv4h7y+UbqNRn3WRMUJ5MjGb41ZVYnNC/eoKiRE36ZoYfDKMQSoIj+VbIvwoZ6P4yJnCk8L7amiKq8aZJkOaVbyp+pCJZ4l3CtVbFTP4Ksx8uM4mmI73+UBnm8Ab5b2Lef4l62LoM6dmmr+wp1PxuB3vi2xbPM9vCpOwV4yi6PqrBf6rj+JOHcqLhohqPnmdG5e+ehDsqFAGicGSNF8t5WhM+WiQTjQP+JSi5zQjb397OfgZSmmnIR9XZdJW/3I042twLPyYLkjNvJzjzqJr0c29K5B3wAu8WyNJ7Nx1DAEz6X6/CWGBb8WW2iutrZeqOUkHB02dgty8jYh2JgWcG8ymUtC9qJBEIMIZ+m5AsbfB/RuxPZRLzJX+29nYRLHPif5KRhUcDjimzZDe2CWDIiQZ7w0bPq4ckT5Ph4qjvGCeNCz6x5/lCVXHi0ZW9O8/VhEVp7L8Ny5H86MqW6t26DLpUbKAgayfsa47lk7L8lOa9zqlTxHPUnylhL5SofAeheGzYb+1CTTpDnSNAzuRmwsOEAWGSnxTspk7r8LCd7EQiElFjnpQ8rCJAXzE9mLS5PtJuazYYTzDPSKqR1anQDr9RvvD4Cjigl42pZw1yqI8KoKAjku36yF/Xx5sxFNt4S09NItjrSSq7W2rXqfQsWQ07KhcJoTgeOr1hHFWeXy20aUvXmn6/QgP0Fryr0uAdQhvATcEfm1CR627H45gised5/J00aiFPF0kJnaxoIRbVX5/vRnj9+2wBEHFt2aHFdPw8BPCocMjVGNEsKGe90Gmxvb/1BpqlcNDudb/9F+Y1uZVthdtpq75wV X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b13b59f-ff40-44dd-1f03-08da78c339ea X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5267.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2022 22:21:51.5697 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aA+tTrJ2UvTr0IZE6n4ZMKcXD/zq8diXnsOovS1in6hi2QpsA7fZHEh2KJmaqT/oLAxgZMzr8AOja4sVMTyoNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2381 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-07_15,2022-08-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208070119 X-Proofpoint-ORIG-GUID: t4Wv3UF-H_jqePAKFWyHCJyT01XAWEI5 X-Proofpoint-GUID: t4Wv3UF-H_jqePAKFWyHCJyT01XAWEI5 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org add tests verifying filter predicates work for 1/2/4/8/16 byte values and strings; use predicates at event and subsystem level. Signed-off-by: Alan Maguire --- .../selftests/ftrace/test.d/event/filter.tc | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/event/filter.tc diff --git a/tools/testing/selftests/ftrace/test.d/event/filter.tc b/tools/testing/selftests/ftrace/test.d/event/filter.tc new file mode 100644 index 000000000000..396383519f84 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/event/filter.tc @@ -0,0 +1,62 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: event tracing - enable filter predicates +# requires: set_event events/sched +# flags: + +do_reset() { + echo 0 > ${event}/enable + echo 0 > ${event}/filter + clear_trace +} + +fail() { #msg + echo $1 + exit_fail +} + +# verify filter predicates at trace event/subsys level for +# - string (prev_comm) +# - 1-byte value (common_flags) +# - 2-byte value (common_type) +# - 4-byte value (next_pid) +# - 8-byte value (prev_state) + +for event in events/sched/sched_switch events/sched +do + for filter in "prev_comm == 'ping'" \ + "common_flags != 0" \ + "common_type >= 0" \ + "next_pid > 0" \ + "prev_state != 0" + do + echo "$filter" > ${event}/filter + echo 1 > ${event}/enable + yield + count=`grep sched_switch trace|wc -l` + if [ $count -lt 1 ]; then + fail "at least one $event should be recorded for '$filter'" + fi + do_reset + done +done + +# verify '==', '!=' filter predicates for 16-byte array at event/subsys +# level + +LOCALHOST="-6 ::1" +for event in events/fib6/fib6_table_lookup events/fib6 ; do + for filter in "dst == 0x00000000000000000000000000000001" \ + "src != 0x00000000000000000000000000000001" + do + echo "$filter" > ${event}/filter + echo 1 > ${event}/enable + yield + count=`grep fib6_table_lookup trace|wc -l` + if [ $count -lt 1 ]; then + fail "at least one $event should be recorded for '$filter'" + fi + do_reset + done +done +exit 0 From patchwork Sun Aug 7 22:21:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Maguire X-Patchwork-Id: 596064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD607C25B0C for ; Sun, 7 Aug 2022 22:34:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242420AbiHGWeG (ORCPT ); Sun, 7 Aug 2022 18:34:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237362AbiHGWdl (ORCPT ); Sun, 7 Aug 2022 18:33:41 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C5EB5D; Sun, 7 Aug 2022 15:22:05 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 277J3wll014171; Sun, 7 Aug 2022 22:21:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2022-7-12; bh=wjqbEeyeEEEjv5oi9cfBJIi/Tbb1BRpx9Oo080ZpbE8=; b=QSfMs73PYG670ROBFFSGIggfOcWxGvRKvXsN7NRpmKernCLFuHABKYQcDVhneRXElJhq Eo5fx2in1UG5K6DY7j/KdSb4lIdshrL5xCfL+LXZ0u6coiT5JT5khl4JPZ9yc1XTdaW0 wIFGx2XKD7VHtyBJ5jqp9TMJRuxih0Bbpj0xLRIC8U1PPqvPnRqe8NKpAc6z9JVzRZU9 Hjr4pWwaFpFNmZnTxOb+jDrzIUgkhR5oc7nLZ8T77bSf+loBbrtm3B8gOsqEfcY21VhD conHEahVdubeEN8cy9lI320/4R3GmdBYa7hCyeD0tlm6c9EVwl4osNRLabzzZxfYgaFd wA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hsfwsj14q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:59 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 277EZHKs004533; Sun, 7 Aug 2022 22:21:58 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2049.outbound.protection.outlook.com [104.47.51.49]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hser1dd61-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZTeRSkZCKmCTVqXNgYXjOyRMOuDHBITNE9nHKYE5pNC/bFmjGkwK+lBanPb0noyqBKAOtbIOeBQVSTA3pDKkDviuISlcjA4l4Elxu3bg/ZsgyZWnU8MynibUew4ePkipOajzL3cn3LB2gOyXylxs3peDbFXqpqEugMNSPoJOepmt49SwqwnaZRqNNMgSzsDp0lW+5Te8XvLxrmxaZlRZds8aPNvL7/+mb0Ldb3AWePngCA8132Z/WVtIyvznc8M89cde+zZxiyOMzdY94zcF/b6Ui5oVIwnwonPM9/gCDrs6jgnOWVvzHyWutB6uX1MAekWsVElDmMSQfBz/kq5xiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wjqbEeyeEEEjv5oi9cfBJIi/Tbb1BRpx9Oo080ZpbE8=; b=BA4LI9XCrZ2p6UhGfpgKeLKtEi2e0in/tC76oPjaThjTnuA/g7CrhSqRRlBYxXjkBjr03tm6MnTLYkXczYK7w449ECvEvXpppTqA7BZ96NexPIYRaU4gkAVrr7XVS/JFZ26dt0soQhyT6cPT09pZZAFV1GtG792SPQtTZ6hXYSqQ55QI6e969O7pffpJoJP/zUVaOCLy/4c8rV7q4Hif34FqHPZjw5JXk+g5GBzMUZY436oexu8IcuuZxuVg9F8lPQRjdIO3I7QyWZ94I+yVOpBoG6udpyH2X6DaZWa6J+yWwiiF6ujqBouRCwvCnDJQDe027/GJTqnob/Wlk32C9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wjqbEeyeEEEjv5oi9cfBJIi/Tbb1BRpx9Oo080ZpbE8=; b=SfJ0ozqrDwNS3L7MY7os+WIGRXCN6ouxkHh50AqmSEM1W5K3xY1eREhzU6NEDJkNiC9GLCA8KwDe3MPHp3Ovg5HRE3cNEWOANxOqfq/WkZZH1mL1jxu0NofKYoot7YffmxrpganBcTWES6DPFJglJ7KE+e0ggOclOzqPyGPr910= Received: from BLAPR10MB5267.namprd10.prod.outlook.com (2603:10b6:208:30e::22) by MWHPR1001MB2381.namprd10.prod.outlook.com (2603:10b6:301:30::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.18; Sun, 7 Aug 2022 22:21:56 +0000 Received: from BLAPR10MB5267.namprd10.prod.outlook.com ([fe80::b1c7:933:e8c2:f84f]) by BLAPR10MB5267.namprd10.prod.outlook.com ([fe80::b1c7:933:e8c2:f84f%9]) with mapi id 15.20.5504.020; Sun, 7 Aug 2022 22:21:56 +0000 From: Alan Maguire To: rostedt@goodmis.org Cc: corbet@lwn.net, mingo@redhat.com, shuah@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Alan Maguire Subject: [RFC tracing 4/4] tracing: document > 8 byte numeric filtering support Date: Sun, 7 Aug 2022 23:21:23 +0100 Message-Id: <1659910883-18223-5-git-send-email-alan.maguire@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> References: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> X-ClientProxiedBy: SG2PR04CA0201.apcprd04.prod.outlook.com (2603:1096:4:187::23) To BLAPR10MB5267.namprd10.prod.outlook.com (2603:10b6:208:30e::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f98d52b-e918-4b49-87c8-08da78c33cc8 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2381:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zbsYLbNbksXibrr/Gv6bk49TLpn9oNVtSLMIqsaE5uMJiNkr5yDJGs2rbWQ8O72tTCdyzdIiw5Q7Cz1zq9+L5517LO+vsk9DbyC1wsy6IVrfOE/kIyDvzEXH9BdYc8cdYukUTpWekWzLlrJz2QzRj6S8zASgRPqSV1P73O6qRqdcMDtCq+CAw6yVOKJ3OlEkVoHqdlAooePS3kcVQsDjg7IyTenzpyOmHrcC3skM/9PCeVKTPs4Ozd0+jFogL4GaSkVBzMGbhwWVD10HcOMn4XRr66S4NJ8ovbp4K3w00osgiAJf5SjV8N3O2opFV7qsXRNZCfyVN/W0UxipFw2nB+oEaaxQOUdCEV04TPi35g56zKh4m4AezBd4LPXXjWd+KMpNvnFKMURc3ApnEuV8HoEzxFf57kZ1GbA6zhppBZkkQN+Zu/oXUu7740h55lSWrhU2h9fsc7rMfQE9RlOXX1AexYIh+FGh5Ut/S6JU1+fJFd86Xpt5HU8gp/yBvt9CM0Q+ls1Qe+xWGLI4xaCdSc9Kru8f3Op9XdwgjEXCk5s02SzbDhFkBdbxwfZ90ekgaiqsg1MGTLnyBsf2wXBxz/nT0QNZApqhS2NNTFa5KuJTjlJ8F7Y6dkPRZutRn3K6e/iy3RMl/aUUsKX4HAcFCgSnpNyid1j9ysZ3tmH23xFAlbrjrNyiJC2UlA/7j9c8fOlZFG7WfOdVce6215taQkkMRiUV+hq3mMsL5dxsA1MCsmXVlcmjcWlyAtDkPnbOcw1uB9MGMc58t06TVVUVEGbGWQAbYKD7vikRUS33F3whjhYRjFRJFco6OEbrkVGP X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BLAPR10MB5267.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(39860400002)(376002)(366004)(396003)(346002)(6486002)(186003)(52116002)(107886003)(478600001)(86362001)(6512007)(26005)(41300700001)(6506007)(2616005)(6666004)(2906002)(66946007)(66476007)(66556008)(38350700002)(38100700002)(4326008)(8936002)(4744005)(44832011)(5660300002)(316002)(6916009)(36756003)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y4hyenqr3VlJBK4J+Dni58SpOXtKWdp/AOT5N6boklXlEt9LHAfnOBGIzyAE9U5lzPX+czJCaos8V84WXQ3i0nuI40hiQ3EOdgjXfIF6yK4Itit+W3PbVbkQVEVky6gCei0eYPk4U5zajxhvPJtPfTj1B77TRNDa5GkeOnFAuJpn3sH11fS6oDYbjhTbGM7P9FMS+p6weZ9vx9UIH4LX/Ijxp0XuNxCGVbPdtIPxqjbVwl+xstgYu1AekG6HfvVF4wCUpqnCaU9wY8c3q0rVi0X4WZbLuoe2THrgGVMLPuT3qVQhDieocGyVxX7INOk4ntQQlzwv6qRXaNcfOXP+ac1gHuzvgrD4jitq9A7eeydBHnBFerZkDf/K+YYyBKd35M2ABgjvdZTVL7xnSxwxoc1UfyVIq8ZGuVGFvc0AwduUyHYvAKUj9zLvSfzd554Zmn4HJfi628jTwR75amEVhxGeyxFwafRdydlL/8KesUu0ty94loYgTbO393ADq/Bp+Em/pqUXEpydrvBP6U/w8hwIjk0lCnpCvW++JRMl5wX+Sm+/+djyxyOR8GpRPFdNFgUXN26DH+X90fyqbUZ6KIbjSTXg8fJ7nhlOmbpsrjZe+3DfPfxRLE4hWTCSt3ZQHn/ZOJ+XkoV1fee8PwE5HZqi4m18jzQdvQpJ7ykRDpn9FfalLuHcvX0vFmAW0dSXrAb53b+EU+XNf/Mbt0mqjtDf1eiULGghL1z6a92PQhkdd4oyPLnN4AQ3xkmMx9efFEcXLy2deasYdXBOOpxHnNRDGv+iaB4ATuRvGlbg9sCPsoabNgSC6i+Fbb2qrESr5SaNdzPJZYodS9XrS2N92MsNiwdsF+diZHFaSS9b6gke8uH4nBo3PLsskKsK71dCXm8ypkLt37xiBToA27ZiKh1EvsLLd8mUN4I4rMMKy2YLkx54yuC93Cma6b6lH/kNFFlnffDzF1YmJ1eqt+rY7GKASnO24MTzZpEuG+WF1OKBpfMgtQNgG1HIIFP8492Yib8fJnGVeNfjoCSQbnDQILsh+ELLnmk1Hv9uS9VnGtEGd4dxYZHNP6CWrFm3LTO1VIIsVcEeywPxsc6xl2i9xQNbPKpHHfLolcrezhgDth8TxUx7OIW3aD2Ojc9CQgv+jDcgtljYi//xqjz5Df8tRYLKY2T3mhqaB5X2+QSRe7sFTP29kKOO8cEbkGT5YHGeVbDLYUl5f21kOZfgsTP9p38imsvxjT4VlLZ7RsQLB/lVxDR7i6MjNk+rEJSri8AwZlciQSYc7U0K5VhVNIJjhaf2AVB9JKYukNyZdZA8QU0u6tu4pa6ntNEPZBBMsAUwHv+I35yICKwPi++2vX3v1zrWcktXHLd7A7Bj6Ja+hC121ZRlZK6MiaBWIy9r6HPyv7diopqQslNDgAbhd5GNsWaJkQ1Tp6FzVp7LcdtIz3dMSJrCBmaT8p0wyx7v1mlktRdMCbBRjOKEUyR9RKNcURX8x5HATzC6uA2p7EzW9DqfDhBMWlsOYKc8opg8u60f9g32bZVV4DFgjrYLQ62LjGtkYBhGw5DzHjqNp62A7TbIzAhs+hVBsfKcyr47AfX/Lg+bbRQp79co8IKx8Hwaqg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f98d52b-e918-4b49-87c8-08da78c33cc8 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5267.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2022 22:21:56.4763 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L2eVXhodokg4Sk0gQcuEafICdQAoU0ZOE/1I/e3+3sfcFz9OVBCHH4/g6LCkOO5cz/gRGhYV5glkTAzTNDgB2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2381 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-07_15,2022-08-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208070119 X-Proofpoint-ORIG-GUID: ReqRWd_8AqnxOw73ZmFFIHuWInWL8xeQ X-Proofpoint-GUID: ReqRWd_8AqnxOw73ZmFFIHuWInWL8xeQ Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org For values > 8 bytes in size, only == and != filter predicates are supported; document this. Signed-off-by: Alan Maguire --- Documentation/trace/events.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/trace/events.rst b/Documentation/trace/events.rst index c47f381d0c00..318dba2fe3ee 100644 --- a/Documentation/trace/events.rst +++ b/Documentation/trace/events.rst @@ -186,6 +186,15 @@ The operators available for numeric fields are: ==, !=, <, <=, >, >=, & +For numeric fields larger than 8 bytes, only + +==, != + +...are allowed, and values for comparison must match field size exactly. +For example, to match the "::1" IPv6 address: + +"dst == 0x00000000000000000000000000000001" + And for string fields they are: ==, !=, ~