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()

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
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 Thu, 21 Jul 2016 17:10:01 +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>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nmoDaDvEafyoEnVuF8j3hdRX/rvoDqTT4YQ6N3QEcVU=; b=io1Bi7k0yK/FPx7QdzOCDwLuWWXrysRMjxKd6Pdnk1Tn+xAfyNeblEvm4RWml8he8n HBavZzFupH3clKyHG/TPWfyI19hwMZItDcYdMXHwt3UFvLIqwIq7M2lkBXrpSgqPJTTQ /mGN8gULFBKWZJvF+SoSdUUkKk/0ZDIQyfhps=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nmoDaDvEafyoEnVuF8j3hdRX/rvoDqTT4YQ6N3QEcVU=; b=ClxN2Jb5nJbTE0cL4PJQbVSp0KsYZ4e0PKTaEwiikyDQQ36X/ypevtthrC6yPeNK2M ES4PBHaeY2k1znlFtEiNz+dOhC9H1Pdi6SdIWa4xmD7xBl+XGMnXwj/ArVPlt2jUTbsC 2+d9gptmTfiL62Jagx8ucGhd+8XYfSBLPE5aiO4sY3iOubtDJl2IfsH6j8Wq7qKVBO5X V20bxFcf+uA4TtOVsxvps0RT+dgPrymRhDjm1zWX6kxz5opBePTfEnSIaPrpynpnGtHl 1+jnI2/qfEDZzH7RFsaGEvJaEiCvXCspiwIWXgx6qGWDg5cAHNPc1I+tsZUP6firWbdn Az8Q==
X-Gm-Message-State ALyK8tK5qqNDo+FYM5pfozmHmLqRsmROfv7ep0hHDEzlQiVb5B2/yig74Sd1QmCNTDyVdr/aRPCK68sOMzk4Sx9P
X-Received by 10.37.105.67 with SMTP id e64mr9727780ybc.71.1469113530650; Thu, 21 Jul 2016 08:05:30 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 52
Organization linux.* mail to news gateway
X-Original-Cc Arnaldo Carvalho de Melo <acme@kernel.org>, jolsa@kernel.org, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>
X-Original-Date Thu, 21 Jul 2016 09:05:27 -0600
X-Original-Message-ID <CANLsYkydbXRsHzuwQQczc7Od7g7CN4HgsJRX5rCtB0+7-m0hEg@mail.gmail.com>
X-Original-References <1469047100-18131-1-git-send-email-mathieu.poirier@linaro.org> <1469047100-18131-6-git-send-email-mathieu.poirier@linaro.org> <07484e7c-7d19-465f-04d9-1dbb4899b643@arm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1447951

Show key headers only | 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