Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp381671pxb; Fri, 29 Oct 2021 11:36:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUVR3SZO8gN85GT9LGqMuk/DDoqI0ji69VIXG1dchmAu9oDwqFZ1sHmc9vytuXUMWSnO9h X-Received: by 2002:a50:e14a:: with SMTP id i10mr16883296edl.73.1635532614803; Fri, 29 Oct 2021 11:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635532614; cv=none; d=google.com; s=arc-20160816; b=pnlpdNP7rW9iaXii1rPc4gaYVv0Byu3KNKklSQvOzvRllUFlWo8hUHfuxj6d5QUcGw ffpEolxOiOlX/4/Kz3qdrSa/wbwj3ZN1a94nPodfwazsYhN+bQVjYCygIlHfD++qbvTM QZWbzvOXZYQU8Zangd5kbm98MChJtTLtB6niNDtYTaAssCk+V2LircNoEFs8GkxOJAPA 6exj9bj7a2OKCaVnQWT4JdU23WB8QoY557qJ/OTHOdkVhMzMKYD+E/hEHmX6z97IkmHP wwABs/ZlUS/wk1yDy71gunFFBp4VoiBp1qwqI0eZJxn8YZsnkx0nTfPmBpEQnG3Gs0Xb pxtw== 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=aWdu1dWgU6LDlQT9WUgK1tbGyRaKD3AurTsATcx1ByY=; b=YHFjN8D0zWQzk5yjTFsyuPREfnB62ko2REqnBYpHPbIjl654tJBtp8+g/6KNUKAORw cAOh0qZN+s/ZEf5/k6YwIk0oxf1riG+bL4BkiXPGO4rHba/OmRZQyVtHanjWhxUjRfP9 oSpWjKUOUx9Q5z1KfS3y17F6JfkBGfQdsT6NpDleECwlQhL8JpSbgT14jrOQ/Ov3s5GG 0ilE0ZoPEIkJyVJyjerjid4kT5L3DrAVpR3ZBN5nCLvzKz3oUOFEbZWDIZOpcTsz55QI qI2wGKC+6oAYd465aLkBfZL0//TfipCSkOumH0EE+95KiIgW3e/E7GfseRKCzvtspUh7 jyTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jtbbuakJ; 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 w13si7587372ede.561.2021.10.29.11.36.29; Fri, 29 Oct 2021 11:36:54 -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=jtbbuakJ; 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 S230319AbhJ2Sgx (ORCPT + 99 others); Fri, 29 Oct 2021 14:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230421AbhJ2Sgv (ORCPT ); Fri, 29 Oct 2021 14:36:51 -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 AE5A3C0613B9 for ; Fri, 29 Oct 2021 11:34:22 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id a20-20020a25ae14000000b005c1961310aeso15018680ybj.3 for ; Fri, 29 Oct 2021 11:34:22 -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=aWdu1dWgU6LDlQT9WUgK1tbGyRaKD3AurTsATcx1ByY=; b=jtbbuakJZsRZNaPCbKbfFEJmOU9Uoi3SgTKnPTxiKpMGfnbaSlJy2stcE7VXQOgk3Y 8bE9sTwZB4gVvZSs1w9ZbFbvJ0t1unK6DB/gzmQgkm6HgAOJEHv968FbY7hJajgtUNoY 2BCnTRP2ZgFqaTEimHnrN4cHb3FYJnJ5ib+SWRJpS11KIYfX42ZpP9gP+7ctok3m4WCi zz6X2fY2YHn7qSqq5hKQ864OD25HPN/N2P2WJ6otYalY28oNO4h/iToCmZhKd39P8xPU aAfSZLHDuo6WjfoAbCXaTjT1jVku5v4UJomfxT54+0kxQMfJyGQQcUeYWtUq28iBayuR PxpA== 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=aWdu1dWgU6LDlQT9WUgK1tbGyRaKD3AurTsATcx1ByY=; b=Ifv0nu9cfHdypgPu9gU6/Fuy0o392ukwy051afDdGVXQcjOCvJr/WZh2Ixv5v1luhy Pf0NS/A/nFxo4TacIfNy71nvNAMB4qTrccpWlKkQJL5srlkwW9U2dBcXaq+Sn9MZAAz/ 5FfJn+OUz/9F2oILlqASk4ir1F9NdgHq+GaJLRi5NaZ3Hlm/ehVLeIRcyWEN2yPjsnOR CV3H6HxQAv+jFUcuYTJn7moekMWjcGWlP80ayaYhvK8GbVg2RnIGuPYv5WG3zncCO5NA ZqfTz/KYKs9zLLlft5YLBDQDRbgKf+lMV+KYCMFerFjX3UEVZl9G1sKtn/6Na9WY4fH2 G7ng== X-Gm-Message-State: AOAM530lIAdlCfiYQNSN+ptUPN7m2TKEOvl41P1syszHOj52ZTtov8jZ WARr6/37dUQJSk6vUFo/ylCS6BVpvHpH104IYA== X-Received: from kaleshsingh.mtv.corp.google.com ([2620:15c:211:200:b03:1d88:1cf2:4973]) (user=kaleshsingh job=sendgmr) by 2002:a5b:402:: with SMTP id m2mr13884785ybp.422.1635532461875; Fri, 29 Oct 2021 11:34:21 -0700 (PDT) Date: Fri, 29 Oct 2021 11:33:29 -0700 In-Reply-To: <20211029183339.3216491-1-kaleshsingh@google.com> Message-Id: <20211029183339.3216491-4-kaleshsingh@google.com> Mime-Version: 1.0 References: <20211029183339.3216491-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.33.1.1089.g2158813163f-goog Subject: [PATCH v3 3/4] 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 , Jonathan Corbet , Ingo Molnar , Shuah Khan , Tom Zanussi , linux-doc@vger.kernel.org, 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.1.1089.g2158813163f-goog