From patchwork Thu Mar 2 17:17:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 6046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:7b8e:b0:9f:8c76:fea4 with SMTP id j14csp5848129dyk; Thu, 2 Mar 2023 09:19:17 -0800 (PST) X-Google-Smtp-Source: AK7set+C85ua2BUfjOxSgTnOp6ArLm7ZxUWSK5q21xnKvoT3s37jhQu/tf+ZJFrq8Cfke5rMi2DJ X-Received: by 2002:a17:906:34d9:b0:8b2:7150:dcff with SMTP id h25-20020a17090634d900b008b27150dcffmr10852331ejb.23.1677777556839; Thu, 02 Mar 2023 09:19:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677777556; cv=none; d=google.com; s=arc-20160816; b=urUl3BH9ptZMlUWI3ZwrbPqfI6cRhDMuPnfOVn6MGCyQb+BX05mu2C2ldtJekBMX6l 9FkIpoL3WgqWByWNbERWUnmC42kxQm7Kn91bgQBKLvNVe9BjPMe5dzIyVWREjsMIvKyC Ba7GHfw3Oj9eW3FdCfXqa+Hw+4l6LJlfyyFyFlPltBC9STr0F7vlOYWckPO9t+As0xVa YHDXOKzMw/Ka3GEVT5ZNnGn22ivYSdoQIYIRe46lOV/d5Ujg7p4Z4zXP1z88NaoS+F3L IOTWwBG9xeNVyzAgnS3y6+ksrfpGPxlhzzolJldCcMHibgx22e4sQL9ji/vNatOAWI15 gTzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YbwFMOnHpkoSTnNEWipHuVElxlgFW4ojRkWqW/l3H3E=; b=J6swFsLYzjay5iPmYBI9oFvhOU1gfUYAoZOBAPnAdznibrXbzrU/hSwLJGp23ga7eU GsVLzn/13hBXf9TWl16r75TyL41PRL6V4463Sm4U9AJ5gB7pUrJYzbZ0FAdkZ62ZBPsj HhWDO9mlztT78K6mTHIuzKbP+L71UTWNU5bz3kXv8QX0IqWMs5B/VEyjxL2RwTunV0di BbKUSAHfW1B/h3QudYOiPOQia5LDU3LDGkJ+A7ZU17XhI41eIdRuzI6PNi54ze3n77Io 2aR8rrmvH7+RV5oSLISPRC0p5NGZO8JlSjsSyGU15ckg6ACz90MFL4BevG0LR5uPZBMp px5g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qp26-20020a170907207a00b008e10c06e907si684228ejb.450.2023.03.02.09.18.53; Thu, 02 Mar 2023 09:19:16 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbjCBRSE (ORCPT + 99 others); Thu, 2 Mar 2023 12:18:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjCBRSC (ORCPT ); Thu, 2 Mar 2023 12:18:02 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 35055BBA1; Thu, 2 Mar 2023 09:18:00 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 96A3E1FB; Thu, 2 Mar 2023 09:18:43 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6AD713F67D; Thu, 2 Mar 2023 09:17:59 -0800 (PST) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: linux-trace-kernel@vger.kernel.org, mark.rutland@arm.com, mhiramat@kernel.org, rostedt@goodmis.org, zanussi@kernel.org Subject: [PATCH 0/2] tracing/hist: add a modulus operator Date: Thu, 2 Mar 2023 17:17:53 +0000 Message-Id: <20230302171755.1821653-1-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759277279468504685?= X-GMAIL-MSGID: =?utf-8?q?1759277279468504685?= I've been analysing some usercopy code, and wanted to cpature the spread of sizes and alignment of copies for a workload. I found that histrogram triggers were great for cpaturing the size, but there's not currently a way to capture the alignment short of recording the entire base pointer and post-processing the histogram, which is less than ideal. These patches add a modulus operator to histogram expressions, so which allows the alignment of pointers to be captured directly. The first patch is a preparatory refactoring to the expression parsing code, and the second actually adds the new operator. Thanks, Mark. Mark Rutland (2): tracing/hist: simplify contains_operator() tracing/hist: add modulus operator Documentation/trace/histogram.rst | 4 +- kernel/trace/trace_events_hist.c | 109 ++++++++++++++++-------------- 2 files changed, 62 insertions(+), 51 deletions(-)