From: James Clark <james.clark@arm.com>
To: Leo Yan <leo.yan@linaro.org>
Cc: coresight@lists.linaro.org, acme@kernel.org,
suzuki.poulose@arm.com, linux-perf-users@vger.kernel.org,
mathieu.poirier@linaro.org, mike.leach@linaro.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf test: Fix test_arm_coresight.sh failures on Juno
Date: Thu, 6 Oct 2022 16:11:05 +0100 [thread overview]
Message-ID: <cce859cc-f25b-b4e8-70c5-917569aec050@arm.com> (raw)
In-Reply-To: <Yz7qx+4BxNYOCgvL@leoy-yangtze.lan>
On 06/10/2022 15:48, Leo Yan wrote:
> Hi James,
>
> On Wed, Oct 05, 2022 at 03:05:08PM +0100, James Clark wrote:
>> This test commonly fails on Arm Juno because the instruction interval
>> is large enough to miss generating any samples for Perf in system-wide
>> mode.
>>
>> Fix this by lowering the interval until a comfortable number of Perf
>> instructions are generated. The test is still quick to run because only
>> a small amount of trace is gathered.
>>
>> Before:
>>
>> sudo ./perf test coresight -vvv
>> ...
>> Recording trace with system wide mode
>> Looking at perf.data file for dumping branch samples:
>> Looking at perf.data file for reporting branch samples:
>> Looking at perf.data file for instruction samples:
>> CoreSight system wide testing: FAIL
>> ...
>>
>> After:
>>
>> sudo ./perf test coresight -vvv
>> ...
>> Recording trace with system wide mode
>> Looking at perf.data file for dumping branch samples:
>> Looking at perf.data file for reporting branch samples:
>> Looking at perf.data file for instruction samples:
>> CoreSight system wide testing: PASS
>> ...
>
> Since Arm Juno board has zero timestamp for CoreSight, I don't think
> now arm_cs_etm.sh can really work on it.
>
> If we want to pass the test on Juno board, we need to add option
> "--itrace=Zi1000i" for "perf report" and "perf script"; but seems
> to me "--itrace=Z..." is not a general case for testing ...
Unfortunately I now think that adding the Z option didn't improve
anything in Coresight decoding other than removing the warning. I've
never seen the zero timestamp issue on Juno though. I thought that was
on some Qualcomm device? I'm not getting the warning on this test anyway.
The problem is that timeless mode assumes per thread mode, and in per
thread mode there is a separate buffer per thread, so the Coresight
channel IDs are ignored. In systemwide mode the channel ID is important
to know which CPU the trace came from. If this info is thrown away then
not much works correctly.
I plan to overhaul the whole decoder and remove all the assumptions
about per-thread and timeless mode. It would be better if they were
completely separate concepts.
>
>> Signed-off-by: James Clark <james.clark@arm.com>
>> ---
>> tools/perf/tests/shell/test_arm_coresight.sh | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh
>> index e4cb4f1806ff..daad786cf48d 100755
>> --- a/tools/perf/tests/shell/test_arm_coresight.sh
>> +++ b/tools/perf/tests/shell/test_arm_coresight.sh
>> @@ -70,7 +70,7 @@ perf_report_instruction_samples() {
>> # 68.12% touch libc-2.27.so [.] _dl_addr
>> # 5.80% touch libc-2.27.so [.] getenv
>> # 4.35% touch ld-2.27.so [.] _dl_fixup
>> - perf report --itrace=i1000i --stdio -i ${perfdata} 2>&1 | \
>> + perf report --itrace=i20i --stdio -i ${perfdata} 2>&1 | \
>> egrep " +[0-9]+\.[0-9]+% +$1" > /dev/null 2>&1
>
> So here I am suspect that changing to "--itrace=i20i" can allow the test
> to pass on Juno board. Could you confirm for this?
On Juno:
./perf record -e cs_etm// -a -- ls
With interval 20, 23 instruction samples are generated:
./perf report --stdio --itrace=i20i | egrep " +[0-9]+\.[0-9]+% +perf "
| wc -l
23
With interval 1000, 0 are generated:
./perf report --stdio --itrace=i1000i | egrep " +[0-9]+\.[0-9]+% +perf
" | wc -l
Error:
The perf.data data has no samples!
0
I think the issue is that ls is quite quick to run, so not much trace is
generated for Perf. And it just depends on the scheduling which is
slightly different on Juno. I don't think it's a bug. On N1SDP there are
only 134 samples generated with i1000i, so it could probably end up with
a random run generating 0 there too.
>
> Thanks,
> Leo
next prev parent reply other threads:[~2022-10-06 15:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 14:05 James Clark
2022-10-06 14:48 ` Leo Yan
2022-10-06 15:11 ` James Clark [this message]
2022-10-10 7:41 ` Leo Yan
2022-10-10 9:21 ` James Clark
2022-10-14 13:33 ` Arnaldo Carvalho de Melo
2022-10-13 13:45 ` arm coresight txt triggers build warning: (was [PATCH] perf test: Fix test_arm_coresight.sh failures on Juno) Christian Borntraeger
2022-10-13 14:54 ` James Clark
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=cce859cc-f25b-b4e8-70c5-917569aec050@arm.com \
--to=james.clark@arm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=jolsa@kernel.org \
--cc=leo.yan@linaro.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=suzuki.poulose@arm.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
all inboxes | Powered by JetHome®