Skip to content

Commit 6a6e5ef

Browse files
Kalesh Singhrostedt
authored andcommitted
tracing/histogram: Document hist trigger variables
Update the tracefs README to describe how hist trigger variables can be created. Link: https://lkml.kernel.org/r/[email protected] Cc: Jonathan Corbet <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Tom Zanussi <[email protected]> Signed-off-by: Kalesh Singh <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 0ca6d12 commit 6a6e5ef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

kernel/trace/trace.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5606,6 +5606,7 @@ static const char readme_msg[] =
56065606
#ifdef CONFIG_HIST_TRIGGERS
56075607
" hist trigger\t- If set, event hits are aggregated into a hash table\n"
56085608
"\t Format: hist:keys=<field1[,field2,...]>\n"
5609+
"\t [:<var1>=<field|var_ref|numeric_literal>[,<var2>=...]]\n"
56095610
"\t [:values=<field1[,field2,...]>]\n"
56105611
"\t [:sort=<field1[,field2,...]>]\n"
56115612
"\t [:size=#entries]\n"
@@ -5617,6 +5618,16 @@ static const char readme_msg[] =
56175618
"\t common_timestamp - to record current timestamp\n"
56185619
"\t common_cpu - to record the CPU the event happened on\n"
56195620
"\n"
5621+
"\t A hist trigger variable can be:\n"
5622+
"\t - a reference to a field e.g. x=current_timestamp,\n"
5623+
"\t - a reference to another variable e.g. y=$x,\n"
5624+
"\t - a numeric literal: e.g. ms_per_sec=1000,\n"
5625+
"\t - an arithmetic expression: e.g. time_secs=current_timestamp/1000\n"
5626+
"\n"
5627+
"\t hist trigger aritmethic expressions support addition(+), subtraction(-),\n"
5628+
"\t multiplication(*) and division(/) operators. An operand can be either a\n"
5629+
"\t variable reference, field or numeric literal.\n"
5630+
"\n"
56205631
"\t When a matching event is hit, an entry is added to a hash\n"
56215632
"\t table using the key(s) and value(s) named, and the value of a\n"
56225633
"\t sum called 'hitcount' is incremented. Keys and values\n"

0 commit comments

Comments
 (0)