From patchwork Sun Aug 7 22:21:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Maguire X-Patchwork-Id: 12938378 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 4DB36C19F2A for ; Sun, 7 Aug 2022 22:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242188AbiHGWeC (ORCPT ); Sun, 7 Aug 2022 18:34:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235353AbiHGWdh (ORCPT ); Sun, 7 Aug 2022 18:33:37 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D49AE28; Sun, 7 Aug 2022 15:21:54 -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 277J4qAA017312; Sun, 7 Aug 2022 22:21:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=corp-2022-7-12; bh=IEv0QDto4Pk9FuhDRw8D6o5naePOGgb/YF09FUsUpN8=; b=PDoFEjiUT2JCtHiE5Lmpp/syn2PGiXw4HHVLidaytakujQKYt012t0dLMFZ6FWbBjoMP HII1O9u93Qv8sRs35RZ2bTu9Ih4+LBsJGWz3Ppot+Gt1oZjrDKcKvnxckmB4q9PPGb8t aNdeo2AJtujyTQjx5MSiZ2Gk4dif/SDImDFq3/DsN8UOsEmFnYRH8huzial6z7fX47WI A2Nn6JanQEgS04elrunNpzfVffTFKq7aLgsmTkDb38K9NYMp0dqq/9d0fDnFwZohMiQr 65W5a6WxhU4dzC/M5UKBYCnuTluU6gQGXYKQHMmL5yQ4p/+UKZ5G445uQnBHp3HQ7VtU AQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hsfwsj14k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:39 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 277DG80s035214; Sun, 7 Aug 2022 22:21:39 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2048.outbound.protection.outlook.com [104.47.51.48]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hser7dpus-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Aug 2022 22:21:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LDntuknOgPGIlrn1SmFSrXnunH0+ejcOddlsDuW8kFbqnrROUiwI2d/mCO6jxDax6iYrWD7vqq8EVMlhvIVIwnh8G04kYkntk+WbacTw/0D2+Tkqwh27iuFPchieJ+1yLbIERLtM77pCGvJENmV7tne/Vd9yBKq/nzfVs6xeQztQOegUvEOFcfKzhNLEP9+bK/aMmDWBn9Zf8ktJFdjVhXNaF329ApYv5e8lB/orBTgMVYE9JfUhW0r6GdrHEkAzYrAsJv9s5W3OTVcpHnuvrD4hjzph6QzShNWvodkIpJGk9bPoWGzLvDFSBRLbWYp7WL28qYXGRBD+EBVSeRiWVA== 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=IEv0QDto4Pk9FuhDRw8D6o5naePOGgb/YF09FUsUpN8=; b=MXp9HROD9YrtA8DujuGMJ8E9zrUnuuvkF5vNP/7NkPwL/n8gEWft7kYfkZvgTpfUPWp2v3426v+CVxU5dzWcmFl+4hG0nVyqZu9SMTBW6iRv3pKlKtnJz1KFpvu9D+ClMjiw1PCg1CgKdoPTtYQz5Kk8CfrADPlMJJDDq/9bR31fwnEY8P94ESc5DUbPZwttq+XdwG9XWgxL0JSr3oNgRX6pMbBaqGVjHaEfgN38Ey2uKmhCXUFx0TVhxH8HWRkfCSs5DwHmmdQs9leQQ3rse3nX6U9pf8wqJF17pOuoELkDyHA8gWb7RBS6yrlW4imLZqflAVCstvevSJWcHCdkrA== 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=IEv0QDto4Pk9FuhDRw8D6o5naePOGgb/YF09FUsUpN8=; b=D/cGpXKN+Ak1Q/DfzA2aGWzjQCuFauSUCAYzQOIqpwNUuT6ilolA9hkfPCXU/snjaXXcTkSK2MluPKhXwtdxr2hfHMq/Y+cgSvbbGybVUGLl+F4D+BCZA1b7fh4YkrKKJiqhkdGmfcr3m+N7KILV3FCWyEYuGsYuFjc0Xe1/fEc= 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:37 +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:37 +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 0/4] tracing: support > 8 byte filter predicates Date: Sun, 7 Aug 2022 23:21:19 +0100 Message-Id: <1659910883-18223-1-git-send-email-alan.maguire@oracle.com> X-Mailer: git-send-email 1.8.3.1 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: f3c4a8f0-8772-49c6-0843-08da78c33166 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: 6ThuDJmRBO2a4JEtMxZ6dZx4uJawfhwEm7NsRsjeSzA4y3GatjJki3RdwNt7HB9O9283y21mnxbx4i/Ms8W7U/F3nt2A+sY5/Ba7I/mCZNTY8CWh4AyQs9l04TpUyPlgiZEbwWKJ7tsEpLCn1H/EkDAv8YC9nnvPrFokTaDO+WDTfAR1fNyN/a1uv9rGAscKhCZpk0e6wP4rVMD3//B/2cc9+rAL2+tYpgIbqD1djqVk05vURvJd7b/+VI+M4BpRkrpV3H8l9yViJO2B5LZZz+SyABhLYEcZc7XWNetpfbgvWTbFXfXMugTiwzxXBitnFf3wq5KazPsgJ/0tX7DBtCiTy2glFU17gcaZI5qKBQDApaD5udsRfxJihzOh8O6uHs6wY6+wy3lGhynH7glLUCgNuDbw2bav57IYL/JVY9Vfam2DZHXzgCPjDhiRYUoxtvLQoVSw0akgTDJ094+BbreEX2+HNE89pihS4kXEFW2xwiO1piVuH/CpeEl4sx6xb8WSM8XlP1FNfW2e7cc/xa89QhpOdNvTNpE36cftDzoBVqHjI2rVMvlFd1/1JZNnglW3H8VmAbIICyGxodwhAHh+oXiXdVY+MtpwNYi2DesxVKLmr9HHnzHPgjrgjoikTApSli6srUWsbWXCYnTJi4WQsjMNwxKZEumgCpfpxEL94i0obEl8QD9gUTT1ld6SHhZDE//D5C8hCIuV/dIOemuKflrutVui1ErIv0mxJghQvSKlATlpr4oPslt7y5+QxH+lSLOmZ59J5xBERudwcDqIHxJCDbOZj3g1It+xy0g= 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: oiBSvg2gWXvFfWdoLNApBKMeDgYcbbXgLt8+lsT/6GmT+Z05labn4w5UJDOp9DdJ6gpteTu36lnyKvzMdLG4xhJAI0tB2ygQH+PkdLADIIrePsLAgmpkZTFy1yP01bQSHi5Rk7kL/MJr100J6Bw1d3C2wdGYAj+wPjwFwrwD9WEk6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mBqnh31VOAyc2BaR4k+5KC/EfN9wJxkj3bBLYAw1do2ZeiWD8a92UT8GAfLMzqeH4TzXQp1J7k1nPTbZZe/ZMcjKeobyK+pvCN7D5Ti/mDbw8WRL8VKbx3aJUC1jIrEOJRJIoz57EIVrRh76N3k+51qda4cEst4jzzv9birOYuoBXr7lqwPxXS44xO6gMGS5g4R0n2qdcFGxDRZc837nmfGfhawhT7aLGmQTSO6bhcz+EeXZaMRt4hAVVKBgDqYBp+t7VLF7PWD+rme61LDbpEt1jTaQ/b2LGSbzMEm7N4/m0Lpcxg9hLoUW+OK3c2NTbSWnSTKnp9XGyCpPqBPQr X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3c4a8f0-8772-49c6-0843-08da78c33166 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:37.2509 (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: qtV8xiNUgk+qL1uC2v1TcNO2L14LHYx6aqz9SyCtQk6CUqiu2LZmtrp4IVtMo8GMdwwhXPIzI+FcYRPqCU7rLA== 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 bulkscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208070119 X-Proofpoint-ORIG-GUID: -gguk092FezLH8-VRd1zq-EAGljttw-v X-Proofpoint-GUID: -gguk092FezLH8-VRd1zq-EAGljttw-v Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org For cases like IPv6 addresses, having a means to supply tracing predicates for fields with more than 8 bytes would be convenient. This series provides a simple way to support this by allowing simple ==, != memory comparison with the predicate supplied when the size of the field exceeds 8 bytes. For example, to trace ::1, the predicate "dst == 0x00000000000000000000000000000001" ..could be used. When investigating this initially, I stumbled upon a kernel crash when specifying a predicate for a non-string field that is not 1, 2, 4, or 8 bytes in size. Patch 1 fixes it. Patch 2 provides the support for > 8 byte fields via a memcmp()-style predicate. Patch 3 adds tests for filter predicates, and patch 4 documents the fact that for > 8 bytes. only == and != are supported. Alan Maguire (2): tracing: predicate matching trigger crashes for > 8-byte arrays tracing: support > 8 byte array filter predicates Oracle Public Cloud User (2): selftests/ftrace: add test coverage for filter predicates tracing: document > 8 byte numeric filtering support Documentation/trace/events.rst | 9 +++ kernel/trace/trace_events_filter.c | 59 +++++++++++++++++- .../selftests/ftrace/test.d/event/filter.tc | 62 +++++++++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/ftrace/test.d/event/filter.tc