Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Shaokun Zhang <zhangshaokun@hisilicon.com>,
	<linux-arm-kernel@lists.infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will@kernel.org>, Qi Liu <liuqi115@huawei.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 5/8] drivers/perf: hisi: Update DDRC PMU for programable counter
Date: Tue, 26 Jan 2021 15:56:45 +0000	[thread overview]
Message-ID: <83d7bdcd-abbb-af1f-deb3-314f30252fa2@huawei.com> (raw)
In-Reply-To: <06dadbf0-cf24-fd71-d4c4-1684df439e32@huawei.com>

On 26/01/2021 12:33, John Garry wrote:
>>   }
>> @@ -332,8 +506,16 @@ static int hisi_ddrc_pmu_probe(struct 
>> platform_device *pdev)
>>           return ret;
>>       }
>> -    name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_ddrc%u",
>> -                  ddrc_pmu->sccl_id, ddrc_pmu->index_id);
>> +    if (ddrc_pmu->identifier >= HISI_PMU_V2)
>> +        name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
>> +                      "hisi_sccl%u_ddrc%u_%u",
>> +                      ddrc_pmu->sccl_id, ddrc_pmu->index_id,
>> +                      ddrc_pmu->sub_id);

I think that this is actually ok for perf.

Checking pmu_uncore_alias_match():

bool pmu_uncore_alias_match(const char *pmu_name, const char *name)
{
	char *tmp = NULL, *tok, *str;
	bool res;

...

	for (; tok; name += strlen(tok), tok = strtok_r(NULL, ",", &tmp)) {
		name = strstr(name, tok);
		if (!name) {
			res = false;
			goto out;
		}
	}

	...
}

We match each token in @pmu_name, "hisi_sccl,ddrc". So we would match 
"hisi_sccl%u_" part with "hisi_sccl" token and then match "ddrc%u_%u" 
with "ddrc" token.

But it would be good to triple check. We need the JSON files created at 
some stage anyway :)

> 
> I don't think perf can support event aliasing in this format 
> (hisi_scclX_Y_Z), but I need to double-check.
> 
>> +    else
>> +        name = devm_kasprintf(&pdev->dev, GFP_KERNEL, 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-01-26 15:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31  6:19 [PATCH 0/8] Add support for HiSilicon Hip09 uncore PMU driver Shaokun Zhang
2020-12-31  6:19 ` [PATCH 1/8] drivers/perf: hisi: Refactor code for more uncore PMUs Shaokun Zhang
2020-12-31  6:19 ` [PATCH 2/8] drivers/perf: hisi: Add PMU version for uncore PMU drivers Shaokun Zhang
2021-01-26 11:46   ` John Garry
2021-01-27  7:56     ` Shaokun Zhang
2020-12-31  6:19 ` [PATCH 3/8] drivers/perf: hisi: Add new functions for L3C PMU Shaokun Zhang
2021-01-26 12:05   ` John Garry
2020-12-31  6:19 ` [PATCH 4/8] drivers/perf: hisi: Add new functions for HHA PMU Shaokun Zhang
2021-01-26 12:10   ` John Garry
2021-01-27  8:02     ` Shaokun Zhang
2020-12-31  6:19 ` [PATCH 5/8] drivers/perf: hisi: Update DDRC PMU for programable counter Shaokun Zhang
2021-01-26 12:33   ` John Garry
2021-01-26 15:56     ` John Garry [this message]
2021-01-27  8:16       ` Shaokun Zhang
2020-12-31  6:19 ` [PATCH 6/8] drivers/perf: hisi: Add support for HiSilicon SLLC PMU driver Shaokun Zhang
2021-01-26 12:30   ` John Garry
2021-01-27  8:26     ` Shaokun Zhang
2020-12-31  6:19 ` [PATCH 7/8] drivers/perf: hisi: Add support for HiSilicon PA " Shaokun Zhang
2021-01-26 12:45   ` John Garry
2021-01-27  8:41     ` Shaokun Zhang
2020-12-31  6:19 ` [PATCH 8/8] docs: perf: Add new description on HiSilicon uncore PMU v2 Shaokun Zhang
2021-01-22  6:03 ` [PATCH 0/8] Add support for HiSilicon Hip09 uncore PMU driver Shaokun Zhang
2021-02-02 18:48   ` Will Deacon
2021-02-03  1:46     ` Shaokun Zhang

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=83d7bdcd-abbb-af1f-deb3-314f30252fa2@huawei.com \
    --to=john.garry@huawei.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=liuqi115@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox