• Alexander Shishkin's avatar
    stm class: Rework policy node fallback · cb6102bd
    Alexander Shishkin authored
    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: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
    Tested-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    cb6102bd
policy.c 10.5 KB