Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1447951

Re: [PATCH V2 5/6] coresight: adding sink parameter to function coresight_build_path()

From Mathieu Poirier <mathieu.poirier@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH V2 5/6] coresight: adding sink parameter to function coresight_build_path()
Date 2016-07-21 17:10 +0200
Message-ID <rXnLP-DS-5@gated-at.bofh.it> (permalink)
References <rX6rD-6b4-5@gated-at.bofh.it> <rX6rD-6b4-21@gated-at.bofh.it> <rXjIg-6iZ-75@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 21 July 2016 at 04:49, Suzuki K Poulose <Suzuki.Poulose@arm.com> wrote:
> On 20/07/16 21:38, Mathieu Poirier wrote:
>>
>> Up to now function coresight_build_path() was counting on a sink to
>> have been selected (from sysFS) prior to being called.  This patch
>> adds a string argument so that a sink matching the argument can be
>> selected.
>>
>
>>  static int _coresight_build_path(struct coresight_device *csdev,
>> -                                struct list_head *path)
>> +                                struct list_head *path, const char *sink)
>>  {
>>         int i;
>>         bool found = false;
>>         struct coresight_node *node;
>>
>> -       /* An activated sink has been found.  Enqueue the element */
>> -       if ((csdev->type == CORESIGHT_DEV_TYPE_SINK ||
>> -            csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) &&
>> csdev->activated)
>> -               goto out;
>> +       /*
>> +        * First see if we are dealing with a sink.  If we have one check
>> if
>> +        * it was selected via sysFS or the perf cmd line.
>> +        */
>> +       if (csdev->type == CORESIGHT_DEV_TYPE_SINK ||
>> +           csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) {
>> +               /* Activated via perf cmd line */
>> +               if (sink && !strcmp(dev_name(&csdev->dev), sink))
>> +                       goto out;
>> +               /* Activated via sysFS */
>> +               if (csdev->activated)
>
>
> When a sink is specified, should we skip an activated sink and continue to
> find the specified one ? or at least fail with an error as we may not be
> using
> the sink specified by the user ?
> i.e may be :
>                 if (!sink && csdev->activated)
>                         goto out;


I understand your point.  My goal though is to discourage people from
meddling in sysFS when using CS from the perf interface.  As such if
any code is to be added here, it would be to report an error when both
a sink has been specified from perf and activated from sysFS.

>
> Suzuki

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 0/6] perf: Driver specific configuration for PMU Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-20 22:40 +0200
  [PATCH V2 1/6] perf/core: Adding PMU driver specific configuration Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-20 22:40 +0200
  [PATCH V2 6/6] coresight: etm-perf: incorporating sink definition from cmd line Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-20 22:40 +0200
  [PATCH V2 5/6] coresight: adding sink parameter to function coresight_build_path() Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-20 22:40 +0200
    Re: [PATCH V2 5/6] coresight: adding sink parameter to function  coresight_build_path() Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-07-21 12:50 +0200
      Re: [PATCH V2 5/6] coresight: adding sink parameter to function coresight_build_path() Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-21 17:10 +0200
  [PATCH V2 2/6] perf: Passing struct perf_event to function setup_aux() Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-20 22:40 +0200
  [PATCH V2 4/6] perf tools: pushing driver configuration down to the kernel Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-20 22:40 +0200
    Re: [PATCH V2 4/6] perf tools: pushing driver configuration down to  the kernel Jiri Olsa <jolsa@redhat.com> - 2016-07-21 09:50 +0200
      Re: [PATCH V2 4/6] perf tools: pushing driver configuration down to  the kernel Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-07-22 22:00 +0200

csiph-web