Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1940569pxb; Thu, 28 Oct 2021 13:01:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz01pEU3J/hR/5VJZHaS4LGLTQ7eMq15UxqUnkDYR1tes8239ccUl7tuA47TTHFFmuNdvKy X-Received: by 2002:a63:9308:: with SMTP id b8mr4796465pge.104.1635451293543; Thu, 28 Oct 2021 13:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635451293; cv=none; d=google.com; s=arc-20160816; b=k+r+RsRQMUH/LxrDXFjAV8+/X1c841jR+rMYK+X7b50EaS8xvySQZQGx+3xQav/Szt w+snHysTOInOsCv3ew3qoaXmiOiNQFcAzEKuvJztK0zwyuuo3rCr82tq78wIzPjZ0Og3 gToayOML/G806E4AXdVupv0FuJYZKcQIePQJBU16AujsKgno8B9FndpIV6CumJwN/jEt IkYQkcc4rllyFcJpW/rXbfh4ue3AeTyEsjcT9mNjiyt55euOCdNT5OgGVm43VZxC4abY eUJHVCRZg/77jHn1IlFQV8MwiXpKYNUQf7wP+LtJtZN2xLqijuNpj01xNJJABG7CDZYJ 234w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:cc:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=aL9ForBXeqIt4axGE+MJntx+0cHbs1gItbc8kj8VTwA=; b=j2u0XWgrD3XCZFgdI3yuisCrLA+cpU/urk6cEUlNvuhVSMe9kYQ2IPQRD05Q7NmVQK 1NhHn07ZTdw1cooQnqgxXYz2mMHtLyXOg3eng0lqPz1JPOqFo7tGWi+WV4IUPpSb8KMu qTXkYo5KO+cUf+lPMGzuR/xWiHngrXP3ao53UWSJpvWrMbQRHkNgLGEZf45iTSmIY1gJ fU7l8HYMZxEZMjChwexCPgbE0sdVtOzKssM6WcRXENO4RpVnNWWCTfFs2ME5FJTTF+jr vt/WoEkmFYwWcjhAfGAfJBBbpcDfe5EHWLFALBAoZy5SA51xFUA+g08jP8b2nob+TbeK Em7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=iK242Dvb; 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 o24si4798370pjp.102.2021.10.28.13.01.14; Thu, 28 Oct 2021 13:01:33 -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=iK242Dvb; 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 S230342AbhJ1UAt (ORCPT + 99 others); Thu, 28 Oct 2021 16:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231138AbhJ1UAs (ORCPT ); Thu, 28 Oct 2021 16:00:48 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A75FDC061570 for ; Thu, 28 Oct 2021 12:58:21 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id w199-20020a25c7d0000000b005bea7566924so10298431ybe.20 for ; Thu, 28 Oct 2021 12:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:cc; bh=aL9ForBXeqIt4axGE+MJntx+0cHbs1gItbc8kj8VTwA=; b=iK242DvbTA3vdISimfzLPV0oBXKg5wDnG2LSTdzxQlmZVUx9hkOqy0Phj04oNDpQf0 f8X0Dj8lEfABj4r3D7lTSImo2f3VnMh/d2v8fVwD3Kv6pFOdI/5qjms/epVDFSs7CTpA EITRmLPqOGYHiHJw8bmACSOkRCB9DTBiYY7aETpEsi3+mxbIlnOfPShwLKGL9HODy8w8 INYuwJPNdgXAiIstfpMv0ZLUq6X797UA3occ+/IT2caEsDvC7XoVH4RfLNNmOr0iqn4o lVkOb58XLQEuH6iFAWurtDmcjZWrQSaOUP/JecjxAMYbkTzc67pnx37jIspMMcNvWYwh /eKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:cc; bh=aL9ForBXeqIt4axGE+MJntx+0cHbs1gItbc8kj8VTwA=; b=LzGKJFTlsHCTLgA6LVbt9d8m/wsE+N74Bqg3Y/mKu4FJI7JpBjbPSuQRBwP33jS7rt tQ+7pscg1qzYYMOcLjQaPjmyd89oaGH+eBj2FwYzea+52KMtd5Ww7yO8IrwhERBnldGv iyz+9J6hMqoRwxzQzUBTPuJKqtwmYQIQ5zQyeQwZnX/LEAao8HpFYk5nk74k+kZrnKbX 3VTXRCYkxRvT4Qx1/tP/pUObP7vSGApBxStntGb/fpUE1UmeQkl74zbVVi4BWAHr8eck muZJCvuUto19PTjroYh9eyqTRI5+qz2mjwXN69k8w0T0OCCRx7eaE5pC/E5pz1PZB7JG QzmQ== X-Gm-Message-State: AOAM530BVvSORii2YvhiAT71qTm2YSZMqyu3ZTNT/EduZCKMwsqr9Al7 el+i8xPZT+EcYTQSp1tqJ9oTtvrmIKa/5hLsyQ== X-Received: from kaleshsingh.mtv.corp.google.com ([2620:15c:211:200:9b57:752f:2f0a:3a13]) (user=kaleshsingh job=sendgmr) by 2002:a25:880e:: with SMTP id c14mr6965833ybl.55.1635451100900; Thu, 28 Oct 2021 12:58:20 -0700 (PDT) Date: Thu, 28 Oct 2021 12:57:57 -0700 In-Reply-To: <20211028195805.2684854-1-kaleshsingh@google.com> Message-Id: <20211028195805.2684854-2-kaleshsingh@google.com> Mime-Version: 1.0 References: <20211028195805.2684854-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [PATCH v2 1/2] tracing/histogram: Document hist trigger variables From: Kalesh Singh Cc: surenb@google.com, hridya@google.com, namhyung@kernel.org, kernel-team@android.com, rostedt@goodmis.org, mhiramat@kernel.org, Kalesh Singh , Ingo Molnar , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the tracefs README to describe how hist trigger variables can be created. Signed-off-by: Kalesh Singh Acked-by: Masami Hiramatsu --- Changes in v2: - Add Masami's Acked-by. kernel/trace/trace.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index bc677cd64224..c41b3786401d 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5628,6 +5628,7 @@ static const char readme_msg[] = #ifdef CONFIG_HIST_TRIGGERS " hist trigger\t- If set, event hits are aggregated into a hash table\n" "\t Format: hist:keys=\n" + "\t [:=[,=...]]\n" "\t [:values=]\n" "\t [:sort=]\n" "\t [:size=#entries]\n" @@ -5639,6 +5640,16 @@ static const char readme_msg[] = "\t common_timestamp - to record current timestamp\n" "\t common_cpu - to record the CPU the event happened on\n" "\n" + "\t A hist trigger variable can be:\n" + "\t - a reference to a field e.g. x=current_timestamp,\n" + "\t - a reference to another variable e.g. y=$x,\n" + "\t - a numeric literal: e.g. ms_per_sec=1000,\n" + "\t - an arithmetic expression: e.g. time_secs=current_timestamp/1000\n" + "\n" + "\t hist trigger aritmethic expressions support addition(+), subtraction(-),\n" + "\t multiplication(*) and division(/) operators. An operand can be either a\n" + "\t variable reference, field or numeric literal.\n" + "\n" "\t When a matching event is hit, an entry is added to a hash\n" "\t table using the key(s) and value(s) named, and the value of a\n" "\t sum called 'hitcount' is incremented. Keys and values\n" -- 2.33.0.1079.g6e70778dc9-goog