]> asedeno.scripts.mit.edu Git - linux.git/commit
stm class: Rework policy node fallback
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Fri, 5 Oct 2018 12:42:51 +0000 (15:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Oct 2018 10:12:54 +0000 (12:12 +0200)
commitcb6102bd99efe35f016dc6d7282e681e6dbde154
treec1be7b7a7b71486fe45b64699835b56d0fdbb978
parentba1cb318dcbfc9754acda9656262aea97ebe77e6
stm class: Rework policy node fallback

Currently, if no matching policy node can be found for a trace source,
we'll try to use "default" policy node, then, if that doesn't exist,
we'll pick the first node, in order of creation. If that also fails,
we'll allocate M/C range from the beginning of the device's M/C range.

This makes it difficult to know which node (if any) was used in any
particular case.

In order to make things more deterministic, the new order is as follows:
  * if they supply ID string, use that and nothing else,
  * if they are a task, use their task name (comm),
  * use "default", if it exists,
  * return failure, to let them know there is no suitable rule.

This should provide enough convenience with the "default" catch-all node,
while not leaving *everything* to chance. As a side effect, this relaxes
the requirement of using ioctl() for identification with the possibility of
using task names as policy nodes.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Tested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/stm/core.c
drivers/hwtracing/stm/policy.c
drivers/hwtracing/stm/stm.h