Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp847096pxb; Tue, 19 Oct 2021 14:26:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzPkwt5WfF1if1gbONmrAxUzEo2zvfi/yrejrZlR9JJpTLGp8ivZHJcorP7FIqweC479EE X-Received: by 2002:a17:906:e089:: with SMTP id gh9mr41116937ejb.320.1634678763713; Tue, 19 Oct 2021 14:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634678763; cv=none; d=google.com; s=arc-20160816; b=BF2odTAhVyOpPdlABvphXZmqzSyGosPpo5yJFIO3WQHHx2KMfFec1dy/JgA8x1etoJ Pum6RFnIcmh8o4TTix3VJtO2EoqAVC+43T+rYieLMF0pCVKzOiz0RUUqgp8yz6IdHcsl KDsH12J16nSM5ag48ZTI9tTh+9DDyCIa/7LF/QoM/o/60tB7M2NSesPfq61lIBNAx0HE O3CC02DrBgKmYz5Ut5Z0lifggP1NCHLfPGiCw1zPU7rZA1HtdELp4zQhfDlaADq67/CY PDYfwhW6Xx6EjRqu57AO7XN2w0vPBBOphwUNWgWQv9ORy1qsSdCSPznyQ8nUpbolHfXc NAnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=J2jhZlXrpk36rWXoQ81LZZvnNqC+n5/mdi3guRUAkO0=; b=b2z4j/oClqhSgqlnP3liWG1KhYUe2my/nOichRMZbdFvM/EIlWc/AMhZGJHwvQ5rak iT0vPjgKaxM7MxpsEizwI3ic9sH4YzjJOjBO6pAq38B1GcVceZ/zBiDOcC5e1jyyjP0V WLbISRf+HvdzCSnod7Ra8+V4lzxWosUDDK33Nag9emDOrpiPMI+fTeos8yy45XLi3OHN jVtU52sYPkao5reRqDfccm0h3/gKpS1cQUvE55nY7ILwquIMdYF98YsxPurAuW/wU09L fTJIYxKlPOVs2iwIww1z8AyOpe4R39gGyAmegy8+6sGRTanqXKRew4tb8iEQrdfR+h1h IIcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LYi4+Nnn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si420484edc.134.2021.10.19.14.25.39; Tue, 19 Oct 2021 14:26:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LYi4+Nnn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbhJSVX3 (ORCPT + 99 others); Tue, 19 Oct 2021 17:23:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbhJSVX3 (ORCPT ); Tue, 19 Oct 2021 17:23:29 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E62B1C061749 for ; Tue, 19 Oct 2021 14:21:15 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id w17so2774550plg.9 for ; Tue, 19 Oct 2021 14:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J2jhZlXrpk36rWXoQ81LZZvnNqC+n5/mdi3guRUAkO0=; b=LYi4+NnnfP0J6789EEebKcu0dApyAjclojXAdKGfIBZY+gpjAy9yZ1/cwG5vc+9FEI gi/Co6xxDkkvTlbOgEmMuyARACCagckvkPyYt/BIvmV6O6XZBu1XgPl0PscxBVXkA594 o1X8qHYYsaBk/GmlBsxNhtKxr7qsMe+aTvmVJzIy5MCSqi8B608gp9frwfyzmlaMrxVL 9qwpBgYY9EoKeOt+d3JNuQ2YbkqIT9QAZznAxXglyE3fOusihHg+m4h5ceUVWhBWRzrv 6bUD7gUhsp50oLl262iLa4vgkQEml9CTBwc4iIKT4q7rKwUFST+WUex8s07PV63QYKsj qhkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J2jhZlXrpk36rWXoQ81LZZvnNqC+n5/mdi3guRUAkO0=; b=Muu2+LEn7roVw4sqQedktBwyJs8msC06HEheH668MEjOz+rOGYRe5o/XLGDpeFfXt8 zp6n0WZ4lRl1zFEAUJcC57UvAfNdXveVI7yR6LGWNJkHmMByJfVLRyIB6fIEsoEhH9r3 OyVZy0fTDCmRyAJONRf1Gi0Pgr6E/TB1VTfwJC+IL8/0+cbJL0wPPGtKJhzkeOTSNmPe vyUJCfKqZvHIw+HeyxJ67MSDqvdLwvU/cQtMkXKKysWtuQxyiswE+BrKrpFWft0dHGJS H+PAE8ZOUagZ5TVxp7qSd8UKIoWkGO2xODVlrdsmjcNCcaQbdaQpOZmEh/LSTKgpXRGW kxZQ== X-Gm-Message-State: AOAM531O/zTi6MUZTLg/q9+qOxLBa2zJ2Viy5Q5wJhYqUHCihInbze7s us70Sn1uSH/hN+qdlYvjvzzHz4NVuRC3HyH95v5uww== X-Received: by 2002:a17:90b:4a81:: with SMTP id lp1mr2553281pjb.124.1634678475225; Tue, 19 Oct 2021 14:21:15 -0700 (PDT) MIME-Version: 1.0 References: <20210915195306.612966-1-kaleshsingh@google.com> <20210915195306.612966-2-kaleshsingh@google.com> <20211019164834.465b2a53@gandalf.local.home> In-Reply-To: <20211019164834.465b2a53@gandalf.local.home> From: Kalesh Singh Date: Tue, 19 Oct 2021 14:21:04 -0700 Message-ID: Subject: Re: [PATCH 1/5] tracing: Add support for creating hist trigger variables from literal To: Steven Rostedt Cc: Suren Baghdasaryan , Hridya Valsaraju , Namhyung Kim , Jonathan Corbet , Ingo Molnar , Shuah Khan , Tom Zanussi , Masami Hiramatsu , "open list:DOCUMENTATION" , LKML , "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 19, 2021 at 1:48 PM Steven Rostedt wrote: > > On Wed, 15 Sep 2021 19:52:45 +0000 > Kalesh Singh wrote: > > > Currently hist trigger expressions don't support the use of numeric > > literals: > > e.g. echo 'hist:keys=common_pid:x=$y-1234' > > --> is not valid expression syntax > > > > Having the ability to use numeric constants in hist triggers supports > > a wider range of expressions for creating variables. > > I'm not against the patch, but I'm curious to what use case this would be > useful for. In the cover letter it mentions the division and multiplication > for finding associated buckets, but what is the addition / subtraction used > for? Addition and subtraction are already supported operations. The use case given in Documentation/trace/histogram.rst is for calculating latencies. I don't have a use case where the constants may be needed in the addition/subtraction, but for simplicity and completeness we support them for all operations. - Kalesh > > -- Steve > > > > > > Add support for creating trace event histogram variables from numeric > > literals. > > > > e.g. echo 'hist:keys=common_pid:x=1234,y=size-1024' >> event/trigger > > > > A negative numeric constant is created, using unary minus operator > > (parentheses are required). > > > > e.g. echo 'hist:keys=common_pid:z=-(2)' >> event/trigger > > > > Signed-off-by: Kalesh Singh > >