All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Anurup M <anurupvasu@gmail.com>
Cc: will.deacon@arm.com, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, anurup.m@huawei.com,
	zhangshaokun@hisilicon.com, tanxiaojun@huawei.com,
	xuwei5@hisilicon.com, sanil.kumar@hisilicon.com,
	john.garry@huawei.com, gabriele.paoloni@huawei.com,
	shiju.jose@huawei.com, huangdaode@hisilicon.com,
	linuxarm@huawei.com, dikshit.n@huawei.com, shyju.pv@huawei.com
Subject: Re: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters
Date: Thu, 30 Mar 2017 11:46:08 +0100	[thread overview]
Message-ID: <20170330104607.GC16211@leverpostej> (raw)
In-Reply-To: <58DCD47C.2010501@gmail.com>

On Thu, Mar 30, 2017 at 03:18:44PM +0530, Anurup M wrote:
> 
> 
> On Tuesday 21 March 2017 10:22 PM, Mark Rutland wrote:
> >+static int hisi_hw_perf_event_init(struct perf_event *event)
> >>+{
> >>+	struct hw_perf_event *hwc = &event->hw;
> >>+	struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu);
> >>+	struct device *dev = hisi_pmu->dev;
> >>+
> >>>+	/*
> >>>+	 * We must NOT create groups containing mixed PMUs, although
> >>>+	 * software events are acceptable
> >>>+	 */
> >>>+	if (event->group_leader->pmu != event->pmu &&
> >>>+	    !is_software_event(event->group_leader))
> >>>+		return -EINVAL;
> >>>+
> >>>+	list_for_each_entry(sibling, &event->group_leader->sibling_list,
> >>>+			    group_entry)
> >>>+		if (sibling->pmu != event->pmu && !is_software_event(sibling))
> >>>+			return -EINVAL;
> >Please also check the number of counters.
> 
> Sorry, I could not follow this comment correctly. Could you please explain ?
> I check the available counters and update used mask in pmu_add -->
> get_event_index

What I meant was that here we should ensure that a group does not
contain more events than can fit into counters.

For example, if the HW had two counters, we should reject any group with
more than two events. Such groups can never be scheduled, and make no
sense.

Thanks,
Mark.

WARNING: multiple messages have this Message-ID (diff)
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters
Date: Thu, 30 Mar 2017 11:46:08 +0100	[thread overview]
Message-ID: <20170330104607.GC16211@leverpostej> (raw)
In-Reply-To: <58DCD47C.2010501@gmail.com>

On Thu, Mar 30, 2017 at 03:18:44PM +0530, Anurup M wrote:
> 
> 
> On Tuesday 21 March 2017 10:22 PM, Mark Rutland wrote:
> >+static int hisi_hw_perf_event_init(struct perf_event *event)
> >>+{
> >>+	struct hw_perf_event *hwc = &event->hw;
> >>+	struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu);
> >>+	struct device *dev = hisi_pmu->dev;
> >>+
> >>>+	/*
> >>>+	 * We must NOT create groups containing mixed PMUs, although
> >>>+	 * software events are acceptable
> >>>+	 */
> >>>+	if (event->group_leader->pmu != event->pmu &&
> >>>+	    !is_software_event(event->group_leader))
> >>>+		return -EINVAL;
> >>>+
> >>>+	list_for_each_entry(sibling, &event->group_leader->sibling_list,
> >>>+			    group_entry)
> >>>+		if (sibling->pmu != event->pmu && !is_software_event(sibling))
> >>>+			return -EINVAL;
> >Please also check the number of counters.
> 
> Sorry, I could not follow this comment correctly. Could you please explain ?
> I check the available counters and update used mask in pmu_add -->
> get_event_index

What I meant was that here we should ensure that a group does not
contain more events than can fit into counters.

For example, if the HW had two counters, we should reject any group with
more than two events. Such groups can never be scheduled, and make no
sense.

Thanks,
Mark.

  reply	other threads:[~2017-03-30 10:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  6:28 [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters Anurup M
2017-03-10  6:28 ` Anurup M
2017-03-21 16:52 ` Mark Rutland
2017-03-21 16:52   ` Mark Rutland
2017-03-24 10:18   ` Anurup M
2017-03-24 10:18     ` Anurup M
2017-03-24 11:57     ` Mark Rutland
2017-03-24 11:57       ` Mark Rutland
2017-03-27  6:34       ` Anurup M
2017-03-27  6:34         ` Anurup M
2017-03-30  9:48   ` Anurup M
2017-03-30  9:48     ` Anurup M
2017-03-30 10:46     ` Mark Rutland [this message]
2017-03-30 10:46       ` Mark Rutland
2017-03-31 14:13       ` Anurup M
2017-03-31 14:13         ` Anurup M
2017-03-31 14:23         ` Mark Rutland
2017-03-31 14:23           ` Mark Rutland
2017-03-31 15:04           ` Anurup M
2017-03-31 15:04             ` Anurup M

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170330104607.GC16211@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=anurup.m@huawei.com \
    --cc=anurupvasu@gmail.com \
    --cc=dikshit.n@huawei.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=huangdaode@hisilicon.com \
    --cc=john.garry@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=sanil.kumar@hisilicon.com \
    --cc=shiju.jose@huawei.com \
    --cc=shyju.pv@huawei.com \
    --cc=tanxiaojun@huawei.com \
    --cc=will.deacon@arm.com \
    --cc=xuwei5@hisilicon.com \
    --cc=zhangshaokun@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.