<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/ftrace/test.d/functions, branch linux-5.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-04-08T13:22:50Z</updated>
<entry>
<title>selftests/ftrace: Move kprobe/uprobe check_error() to test.d/functions</title>
<updated>2019-04-08T13:22:50Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tom.zanussi@linux.intel.com</email>
</author>
<published>2019-03-31T23:48:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c5e4114fee0b6582b6e86804ffef95bf82bb5f78'/>
<id>urn:sha1:c5e4114fee0b6582b6e86804ffef95bf82bb5f78</id>
<content type='text'>
The k/uprobe_sytax_errors test case defines a check_error() function
used to run a command and check the position of the caret in the
output.

This would be useful for other ftrace facilities too, so move it to
test.d/functions for use by anyone.  In the process, rename it to
ftrace_errlog_check() and parametrize it for general use.

Link: http://lkml.kernel.org/r/9f88080a06f1755811f69081926afe7e5cb53178.1554072478.git.tom.zanussi@linux.intel.com

Acked-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests/ftrace: Use loopback address instead of localhost</title>
<updated>2018-10-24T20:49:35Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2018-08-30T14:17:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cec3adf5f57160d829a033bcb578c3dd0a90c693'/>
<id>urn:sha1:cec3adf5f57160d829a033bcb578c3dd0a90c693</id>
<content type='text'>
Use raw loopback address instead of localhost, because
"localhost" can depend on nsswitch and in some case
we can not resolve the localhost.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Shuah Khan (Samsung OSG) &lt;shuah@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/ftrace: More initialize features in initialize_ftrace</title>
<updated>2018-10-24T20:49:35Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2018-08-30T14:14:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7590472e78c8fbe1383aba30450655fd6415fa7b'/>
<id>urn:sha1:7590472e78c8fbe1383aba30450655fd6415fa7b</id>
<content type='text'>
Clear pid filter, synthetic_events, snapshots,
ftrace filter, and trace log in initialize_ftrace(),
since those are used in test cases.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Acked-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Shuah Khan (Samsung OSG) &lt;shuah@kernel.org&gt;
</content>
</entry>
<entry>
<title>ftrace/selftest: Fix reset_trigger() to handle triggers with filters</title>
<updated>2018-05-29T12:29:46Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-05-14T20:03:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=922a418d687b98542736e4f7c6e63a098521b1b6'/>
<id>urn:sha1:922a418d687b98542736e4f7c6e63a098521b1b6</id>
<content type='text'>
The reset_trigger() function breaks up the command by a space ' '. This is
useful to ignore the '[active]' word for triggers when removing them. But if
the trigger has a filter (ie. "if prio &lt; 10") then the filter needs to be
attached to the line that is written into the trigger file to remove it. But
the truncation removes the filter and the triggers are not cleared properly.

Before, reset_trigger() did this:

 # echo 'hist:keys=common_pid if prev_prio &lt; 10' &gt; events/sched/sched_switch/trigger
 # echo 'hist:keys=common_pid if next_prio &lt; 10' &gt;&gt; events/sched/sched_switch/trigger
 # cat events/sched/sched_switch/trigger
hist:keys=common_pid:vals=hitcount:sort=hitcount:size=2048 if prev_prio &lt; 10 [active]
hist:keys=common_pid:vals=hitcount:sort=hitcount:size=2048 if next_prio &lt; 10 [active]

 reset_trigger() {
   echo '!hist:keys=common_pid:vals=hitcount:sort=hitcount:size=2048' &gt;&gt; events/sched/sched_switch/trigger
 }

 # cat events/sched/sched_switch/trigger
hist:keys=common_pid:vals=hitcount:sort=hitcount:size=2048 if prev_prio &lt; 10 [active]
hist:keys=common_pid:vals=hitcount:sort=hitcount:size=2048 if next_prio &lt; 10 [active]

After, where it includes the filter:

 reset_trigger() {
   echo '!hist:keys=common_pid:vals=hitcount:sort=hitcount:size=2048 if prev_prio &lt; 10' &gt;&gt; events/sched/sched_switch/trigger
 }

 # cat events/sched/sched_switch/trigger
hist:keys=common_pid:vals=hitcount:sort=hitcount:size=2048 if next_prio &lt; 10 [active]

Fixes: cfa0963dc474f ("kselftests/ftrace : Add event trigger testcases")
Acked-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Reviewed-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace/selftest: Have the reset_trigger code be a bit more careful</title>
<updated>2018-05-29T12:29:37Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-05-14T19:40:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=756b56a9e832e063edc83be7c3889e98c536dd2b'/>
<id>urn:sha1:756b56a9e832e063edc83be7c3889e98c536dd2b</id>
<content type='text'>
The trigger code is picky in how it can be disabled as there may be
dependencies between different events and synthetic events. Change the order
on how triggers are reset.

 1) Reset triggers of all synthetic events first
 2) Remove triggers with actions attached to them
 3) Remove all other triggers

If this order isn't followed, then some triggers will not be reset, and an
error may happen because a trigger is busy.

Cc: stable@vger.kernel.org
Fixes: cfa0963dc474f ("kselftests/ftrace : Add event trigger testcases")
Reviewed-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Acked-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests: ftrace: Add inter-event hist triggers testcases</title>
<updated>2018-03-10T21:06:05Z</updated>
<author>
<name>Rajvi Jingar</name>
<email>rajvi.jingar@intel.com</email>
</author>
<published>2018-01-16T02:52:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f06eec4d0f2c784788ed2e9aa12c9227c2341771'/>
<id>urn:sha1:f06eec4d0f2c784788ed2e9aa12c9227c2341771</id>
<content type='text'>
    This adds inter-event hist triggers testcases which covers following:
     - create/remove synthetic event
     - disable histogram for synthetic event
     - extended error support
     - field variable support
     - histogram variables
     - histogram trigger onmatch action
     - histogram trigger onmax action
     - histogram trigger onmatch-onmax action
     - simple expression support
     - combined histogram

    Here is the test result.
    === Ftrace unit tests ===
    [1] event trigger - test extended error support [PASS]
    [2] event trigger - test field variable support [PASS]
    [3] event trigger - test inter-event combined histogram trigger [PASS]
    [4] event trigger - test inter-event histogram trigger onmatch action   [PASS]
    [5] event trigger - test inter-event histogram trigger onmatch-onmax action     [PASS]
    [6] event trigger - test inter-event histogram trigger onmax action     [PASS]
    [7] event trigger - test synthetic event create remove  [PASS]

Link: http://lkml.kernel.org/r/e07ef1e72f7bf0f84dc87c9b736d6dc91b4b0b49.1516069914.git.tom.zanussi@linux.intel.com

Signed-off-by: Rajvi Jingar &lt;rajvi.jingar@intel.com&gt;
Signed-off-by: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests/ftrace: Have reset_ftrace_filter handle multiple instances</title>
<updated>2018-02-08T15:13:17Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-02-06T22:15:02Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0787ce336075ac0fa2d356de4e3c2a2488e851a6'/>
<id>urn:sha1:0787ce336075ac0fa2d356de4e3c2a2488e851a6</id>
<content type='text'>
If a probe is attached to a static function that is in multiple files with
the same name, removing it by name will remove all instances:

 # grep jump_label_unlock set_ftrace_filter
jump_label_unlock:traceoff:unlimited
jump_label_unlock:traceoff:unlimited

 # echo '!jump_label_unlock:traceoff' &gt;&gt; set_ftrace_filter
 # grep jump_label_unlock set_ftrace_filter
 #

But the loop in reset_ftrace_filter will try to remove multiple instances
multiple times. If this happens the second time will error and cause the
test to fail.

At each iteration of the loop, check to see if the probe being removed still
exists.

Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests/ftrace: Have reset_ftrace_filter handle modules</title>
<updated>2018-02-08T15:13:09Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-02-06T22:10:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=df9d36d9e8adefe0975c7b5888967651b3db3af3'/>
<id>urn:sha1:df9d36d9e8adefe0975c7b5888967651b3db3af3</id>
<content type='text'>
If a function probe in set_ftrace_filter belongs to a module, it will
contain the module name. Like:

 wmi_query_block [wmi]:traceoff:unlimited

But writing:

 '!wmi_query_block [wmi]:traceoff' &gt; set_ftrace_filter

will cause an error. We still need to write:

 '!wmi_query_block:traceoff' &gt; set_ftrace_filter

Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests/ftrace: Fix bashisms</title>
<updated>2017-05-18T01:54:51Z</updated>
<author>
<name>Naveen N. Rao</name>
<email>naveen.n.rao@linux.vnet.ibm.com</email>
</author>
<published>2017-05-16T17:51:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d2ffb8d3cc3458e2102b2f067a2e82c84947deea'/>
<id>urn:sha1:d2ffb8d3cc3458e2102b2f067a2e82c84947deea</id>
<content type='text'>
Fix a few bashisms in ftrace selftests.

Link: http://lkml.kernel.org/r/5fbf4613eef0766918fa04e3ff537cae271223ee.1494956770.git.naveen.n.rao@linux.vnet.ibm.com

Acked-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests: ftrace: Add a way to reset triggers in the set_ftrace_filter file</title>
<updated>2017-04-18T17:48:25Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2017-04-17T21:30:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8e5e19c1b98394c2cdc186a4b0be422fe6e7217a'/>
<id>urn:sha1:8e5e19c1b98394c2cdc186a4b0be422fe6e7217a</id>
<content type='text'>
Just writing into the set_ftrace_filter file does not reset triggers, even
though it can reset the function list. Triggers require writing the trigger
name with a "!" prepended. It's worse that it requires the number if the
trigger has a count associated to it.

Add a reset_ftrace_filter function to the ftrace self tests to allow for the
tests to have a generic way to clear them. It also resets any functions that
are listed in that file as well.

Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
