linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: sgoutham@marvell.com, gcherian@marvell.com, lcherian@marvell.com,
	bbhushan2@marvell.com, German Gomez <german.gomez@arm.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	John Garry <john.g.garry@oracle.com>,
	Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	tanmay@marvell.com, leo.yan@linaro.org, mike.leach@linaro.org
Subject: Re: [PATCH v4 6/8] perf cs_etm: Record ts_source in AUXTRACE_INFO for ETMv4 and ETE
Date: Thu, 19 Jan 2023 16:49:59 +0000	[thread overview]
Message-ID: <17f226e1-271e-e16d-596a-a0fb955de586@arm.com> (raw)
In-Reply-To: <fb6564d3-c3a2-08c1-32c5-79ba22c69200@arm.com>



On 19/01/2023 15:56, Suzuki K Poulose wrote:
> On 19/01/2023 15:43, James Clark wrote:
>> From: German Gomez <german.gomez@arm.com>
>>
>> Read the value of ts_source exposed by the driver and store it in the
>> ETMv4 and ETE header. If the interface doesn't exist (such as in older
>> Kernels), defaults to a safe value of -1.
> 
> Super minor nits feel free to ignore.
> 
>>
>> Signed-off-by: German Gomez <german.gomez@arm.com>
>> Signed-off-by: James Clark <james.clark@arm.com>
>> ---
>>   tools/perf/arch/arm/util/cs-etm.c | 48 +++++++++++++++++++++++++++++++
>>   tools/perf/util/cs-etm-base.c     |  2 ++
>>   tools/perf/util/cs-etm.h          |  2 ++
>>   3 files changed, 52 insertions(+)
>>
>> diff --git a/tools/perf/arch/arm/util/cs-etm.c
>> b/tools/perf/arch/arm/util/cs-etm.c
>> index b526ffe550a5..481e170cd3f1 100644
>> --- a/tools/perf/arch/arm/util/cs-etm.c
>> +++ b/tools/perf/arch/arm/util/cs-etm.c
>> @@ -53,6 +53,7 @@ static const char * const metadata_etmv4_ro[] = {
>>       [CS_ETMV4_TRCIDR2]        = "trcidr/trcidr2",
>>       [CS_ETMV4_TRCIDR8]        = "trcidr/trcidr8",
>>       [CS_ETMV4_TRCAUTHSTATUS]    = "mgmt/trcauthstatus",
>> +    [CS_ETMV4_TS_SOURCE]        = "ts_source",
>>   };
>>     static const char * const metadata_ete_ro[] = {
>> @@ -62,6 +63,7 @@ static const char * const metadata_ete_ro[] = {
>>       [CS_ETE_TRCIDR8]        = "trcidr/trcidr8",
>>       [CS_ETE_TRCAUTHSTATUS]        = "mgmt/trcauthstatus",
>>       [CS_ETE_TRCDEVARCH]        = "mgmt/trcdevarch",
>> +    [CS_ETE_TS_SOURCE]        = "ts_source",
>>   };
>>     static bool cs_etm_is_etmv4(struct auxtrace_record *itr, int cpu);
>> @@ -613,6 +615,32 @@ static int cs_etm_get_ro(struct perf_pmu *pmu,
>> int cpu, const char *path)
>>       return val;
>>   }
>>   +static int cs_etm_get_ro_signed(struct perf_pmu *pmu, int cpu,
>> const char *path)
> 
> minor nit: This doesn't necessarily care if it is RO ?
> Also, does it make sense to rename to include cpu relation :
> 
> say,  cs_etm_pmu_cpu_get_signed() ?
> 
>> +{
>> +    char pmu_path[PATH_MAX];
>> +    int scan;
>> +    int val = 0;
>> +
>> +    /* Get RO metadata from sysfs */
>> +    snprintf(pmu_path, PATH_MAX, "cpu%d/%s", cpu, path);
>> +
>> +    scan = perf_pmu__scan_file(pmu, pmu_path, "%d", &val);
>> +    if (scan != 1)
>> +        pr_err("%s: error reading: %s\n", __func__, pmu_path);
>> +
>> +    return val;
>> +}
>> +
>> +static bool cs_etm_pmu_path_exists(struct perf_pmu *pmu, int cpu,
>> const char *path)
> 
> nit: cs_etm_pmu_cpu_path_exists() ? To make the "cpu" relation explicit ?
> 

For both of these points, I think it was just trying to be consistent
with what is already there.

There is already cs_etm_is_etmv4() and cs_etm_get_ro() which don't
mention the cpu part, and also the metadata_etmv4_ro variable which has
_ro. You're right that it doesn't matter that they're read only, but at
the moment everything is so it's probably easiest to leave it for now
rather than go and update everything.


> Otherwise looks good to me.
> 
> Suzuki
> 

Thanks for the review.

  reply	other threads:[~2023-01-19 16:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 15:42 [PATCH v4 0/8] perf cs_etm: Basic support for virtual/kernel timestamps James Clark
2023-01-19 15:43 ` [PATCH v4 1/8] perf: Remove duplication around EVENT_SOURCE_DEVICE_PATH James Clark
2023-01-19 15:43 ` [PATCH v4 2/8] perf: Use perf_pmu__open_file() and perf_pmu__scan_file() James Clark
2023-01-19 15:43 ` [PATCH v4 3/8] perf: Remove remaining duplication of bus/event_source/devices/ James Clark
2023-01-19 15:43 ` [PATCH v4 4/8] perf pmu: Add function to check if a pmu file exists James Clark
2023-01-19 15:43 ` [PATCH v4 5/8] perf cs_etm: Keep separate symbols for ETMv4 and ETE parameters James Clark
2023-01-19 15:43 ` [PATCH v4 6/8] perf cs_etm: Record ts_source in AUXTRACE_INFO for ETMv4 and ETE James Clark
2023-01-19 15:56   ` Suzuki K Poulose
2023-01-19 16:49     ` James Clark [this message]
2023-01-19 15:43 ` [PATCH v4 7/8] perf cs_etm: Set the time field in the synthetic samples James Clark
2023-01-19 15:43 ` [PATCH v4 8/8] perf: cs-etm: Ensure that Coresight timestamps don't go backwards James Clark
2023-01-19 16:58 ` [PATCH v4 0/8] perf cs_etm: Basic support for virtual/kernel timestamps Arnaldo Carvalho de Melo
2023-01-20 14:39   ` James Clark
2023-01-20 16:58     ` Arnaldo Carvalho de Melo

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=17f226e1-271e-e16d-596a-a0fb955de586@arm.com \
    --to=james.clark@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bbhushan2@marvell.com \
    --cc=coresight@lists.linaro.org \
    --cc=gcherian@marvell.com \
    --cc=german.gomez@arm.com \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sgoutham@marvell.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tanmay@marvell.com \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).