From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jonathan Corbet <corbet@lwn.net>, Ingo Molnar <mingo@redhat.com>,
Shuah Khan <shuah@kernel.org>, Tom Zanussi <zanussi@kernel.org>,
Kalesh Singh <kaleshsingh@google.com>,
Masami Hiramatsu <mhiramat@kernel.org>
Subject: [for-next][PATCH 12/14] tracing/histogram: Document hist trigger variables
Date: Tue, 02 Nov 2021 16:11:38 -0400 [thread overview]
Message-ID: <20211102201158.771485961@goodmis.org> (raw)
In-Reply-To: 20211102201126.559641540@goodmis.org
From: Kalesh Singh <kaleshsingh@google.com>
Update the tracefs README to describe how hist trigger variables
can be created.
Link: https://lkml.kernel.org/r/20211029183339.3216491-4-kaleshsingh@google.com
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/trace.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 985390cb8441..31a4632f9af1 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5606,6 +5606,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=<field1[,field2,...]>\n"
+ "\t [:<var1>=<field|var_ref|numeric_literal>[,<var2>=...]]\n"
"\t [:values=<field1[,field2,...]>]\n"
"\t [:sort=<field1[,field2,...]>]\n"
"\t [:size=#entries]\n"
@@ -5617,6 +5618,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
next prev parent reply other threads:[~2021-11-02 20:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 20:11 [for-next][PATCH 00/14] tracing: Updates for 5.16 Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 01/14] tracing/osnoise: Do not follow tracing_cpumask Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 02/14] tracing/osnoise: Improve comments about barrier need for NMI callbacks Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 03/14] tracing/osnoise: Split workload start from the tracer start Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 04/14] tracing/osnoise: Use start/stop_per_cpu_kthreads() on osnoise_cpus_write() Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 05/14] tracing/osnoise: Support a list of trace_array *tr Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 06/14] tracing/osnoise: Remove TIMERLAT ifdefs from inside functions Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 07/14] tracing/osnoise: Allow multiple instances of the same tracer Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 08/14] tracing/osnoise: Remove STACKTRACE ifdefs from inside functions Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 09/14] tracing/osnoise: Remove PREEMPT_RT " Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 10/14] tracing/histogram: Optimize division by constants Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 11/14] tracing/histogram: Update division by 0 documentation Steven Rostedt
2021-11-02 20:11 ` Steven Rostedt [this message]
2021-11-02 20:11 ` [for-next][PATCH 13/14] tracing/selftests: Add tests for hist trigger expression parsing Steven Rostedt
2021-11-02 20:11 ` [for-next][PATCH 14/14] ftrace/samples: Add missing prototype for my_direct_func Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211102201158.771485961@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=kaleshsingh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=shuah@kernel.org \
--cc=zanussi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.