perf tools: Introduce trigger class
authorWang Nan <wangnan0@huawei.com>
Wed, 20 Apr 2016 18:59:48 +0000 (18:59 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 28 Apr 2016 12:58:58 +0000 (09:58 -0300)
commit3dcc4436fa6f09ce093ff59bf8477c3059dc46df
tree74053f598a114a1c21e2d72199083c2ff2ade9ea
parent909b0360ae358f212f526e171ea4ef433b1b4103
perf tools: Introduce trigger class

Use 'trigger' to model operations which need to be executed when an
event (a signal, for example) is observed.

States and transits:

 OFF--(on)--> READY --(hit)--> HIT
^               |
|            (ready)
|               |
 \_____________/

is_hit and is_ready are two key functions to query the state of a
trigger. is_hit means the event already happen; is_ready means the
trigger is waiting for the event.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1461178794-40467-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/trigger.h [new file with mode: 0644]