Message ID | 1682696089-27937-1-git-send-email-alan.maguire@oracle.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1017523vqo; Fri, 28 Apr 2023 08:38:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60k+BKX2paD6O33Uh8OgiYjtTeruEJvMWfF7MfNAEiNbKbzQ8XOM+sGkPrTOiHRHC19lxG X-Received: by 2002:a17:903:22c1:b0:1a9:57b4:9d5a with SMTP id y1-20020a17090322c100b001a957b49d5amr7145806plg.31.1682696300890; Fri, 28 Apr 2023 08:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682696300; cv=none; d=google.com; s=arc-20160816; b=0Fq1DVXU8flqTqgqvNYRZ2LM6pNkvNxxPuY7uleVGXsEZdY5//mLWLpu3wSkqJHG4M wR/SPsh9VpLZ79Jsyvy/FVc3sdZqp0Hb1KZJOARP9YPtYTDQKuXzYqQrfVrDmInh+hYp R5rkalWgp8pUR0Ou5bvpjpQ1EDFNy8w/XMzS2dfu/L/zjbJ/OQUmLbe4R5VxFqIodrte Y3Lm57gNxdWbDt17D34SrwelLoJMMABPNRJiLeZSwVMT+UzEyuO8W0qGz9T4/HcPXabH Cqli4gQkL01wOOtRbKUXKLqyDpfIb+wO7/WbLzn80GRmBqIRo456Sgj11aQeffIGfQDK V5yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=TqPJawlS8vnHqAAbbtgbBvah7H60ySgm+W383xPXe28=; b=QTdkpVPRgpj3SfugiRIfetboeppPZdeYKZDGQGcG/2OTG58/06bF88V1f9ZXl3wZ9S C9uiADdSHONE9TXW25loxBNT2Xms+cctyomzhtyCVvOuQtRYVOR6dBilwGGK0T55rAeU ai/eIpyUZKr0wwOe1tBEtw0IVyf317PkFAyR79dA9UTiV4m25NZlAytCm6KUKOfWk2Xi JrB02c4l9EJUoCY5xL/I/F9IBJ4XbKz4zofpWYEciatC25nHgOJVUpj+HJyvVrFSpe4f Bq2ti46/L/ZdFD9+sgD3dkMusqkaaWhoaTUgp2jOWZsQlbVL8B1VIWaaG06IpwlV6Kt5 CtOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=hJJAI2pM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kw8-20020a170902f90800b001a1defc30cbsi19830194plb.479.2023.04.28.08.38.07; Fri, 28 Apr 2023 08:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=hJJAI2pM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346465AbjD1PfW (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 99 others); Fri, 28 Apr 2023 11:35:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346516AbjD1PfD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Apr 2023 11:35:03 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 804C32106; Fri, 28 Apr 2023 08:35:01 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33SF3uAa001576; Fri, 28 Apr 2023 15:34:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2023-03-30; bh=TqPJawlS8vnHqAAbbtgbBvah7H60ySgm+W383xPXe28=; b=hJJAI2pM6HMeh/ykHNTzF3kgcfcNFv1eYCHQxS4EeP49omgsq4EjSuXo2M1tEzC0gGM0 AnqS4YBqdlg1qz+LYcnl0gymPgUztP6b7J6tAenuVlvPMH+L4azUptO8UjJcSGoFLp9v 2dkChFKOdTsumJonQISXC9sGSEeZ8CM8QGuHlROxg6ds2tjZDkg0kjwrRFG9Ca3diq7Q bnMTsSZMFtidI+IU9JHaUP4bitvvPL+yMU2uwTNZRVkoro8Qg9sBQ9XJJMZ7/6eTbluF UCfluQwaECGd7rTCxuapT317GDVJdUuy27zGBw4RNsNCQ9w+rEdxhuwEwPu2/Urcs7cC pw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47md6rcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Apr 2023 15:34:54 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33SE3UFc028277; Fri, 28 Apr 2023 15:34:53 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q461b4rmy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Apr 2023 15:34:53 +0000 Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33SFYqUA028134; Fri, 28 Apr 2023 15:34:52 GMT Received: from myrouter.uk.oracle.com (dhcp-10-175-188-60.vpn.oracle.com [10.175.188.60]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3q461b4rm0-1; Fri, 28 Apr 2023 15:34:52 +0000 From: Alan Maguire <alan.maguire@oracle.com> To: rostedt@goodmis.org, mhiramat@kernel.org Cc: corbet@lwn.net, shuah@kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Alan Maguire <alan.maguire@oracle.com> Subject: [PATCH v2 tracing 0/6] tracing: additional filter predicates Date: Fri, 28 Apr 2023 16:34:43 +0100 Message-Id: <1682696089-27937-1-git-send-email-alan.maguire@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-28_04,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304280125 X-Proofpoint-GUID: 8rp1Tm198pK-pEjxQs267h97MnabH-RY X-Proofpoint-ORIG-GUID: 8rp1Tm198pK-pEjxQs267h97MnabH-RY X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764434956160441466?= X-GMAIL-MSGID: =?utf-8?q?1764434956160441466?= |
Series |
tracing: additional filter predicates
|
|
Message
Alan Maguire
April 28, 2023, 3:34 p.m. UTC
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. Patch 1 implements this. As a convenience, support for IPv4, IPv6 and MAC addresses are also included; patches 2-4 cover these and allow simpler comparisons which do not require getting the exact number of bytes right; for exmaple "dst == ::1" "src != 127.0.0.1" "mac_addr == ab:cd:ef:01:23:45" Patch 5 adds tests for existing and new filter predicates, and patch 6 documents the fact that for the various addresses supported and the >8 byte memory comparison. only == and != are supported. Changes since v1 [1]: - added support for IPv4, IPv6 and MAC addresses (patches 2-4) (Masami and Steven) - added selftests for IPv4, IPv6 and MAC addresses and updated docs accordingly (patches 5,6) Changes since RFC [2]: - originally a fix was intermixed with the new functionality as patch 1 in series [2]; the fix landed separately - small tweaks to how filter predicates are defined via fn_num as opposed to via fn directly [1] https://lore.kernel.org/linux-trace-kernel/1682414197-13173-1-git-send-email-alan.maguire@oracle.com/ [22] https://lore.kernel.org/lkml/1659910883-18223-1-git-send-email-alan.maguire@oracle.com/ Alan Maguire (6): tracing: support > 8 byte array filter predicates tracing: support IPv4 address filter predicate tracing: support IPv6 filter predicates tracing: support MAC address filter predicates selftests/ftrace: add test coverage for filter predicates tracing: document IPv4, IPv6, MAC address and > 8 byte numeric filtering support Documentation/trace/events.rst | 21 +++ kernel/trace/trace_events_filter.c | 164 +++++++++++++++++- .../selftests/ftrace/test.d/event/filter.tc | 91 ++++++++++ 3 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/ftrace/test.d/event/filter.tc