[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <688e9a7f-0b98-4f8a-b575-90d7de244589@linux.intel.com>
Date: Thu, 6 Feb 2025 13:42:58 +0800
From: "Mi, Dapeng" <dapeng1.mi@...ux.intel.com>
To: "Liang, Kan" <kan.liang@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>, Thomas Richter <tmricht@...ux.ibm.com>
Cc: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
acme@...nel.org, linux-s390@...r.kernel.org, james.clark@...aro.org,
agordeev@...ux.ibm.com, gor@...ux.ibm.com, sumanthk@...ux.ibm.com,
hca@...ux.ibm.com
Subject: Re: [PATCH 2/2 v3] perf test: Change event in perf test 114 perf
record test subtest test_leader_sampling
On 2/4/2025 11:55 PM, Liang, Kan wrote:
>
> On 2025-02-03 10:42 p.m., Namhyung Kim wrote:
>> Add Kan and Dapeng to CC.
>>
>> Thanks,
>> Namhyung
>>
>>
>> On Fri, Jan 31, 2025 at 11:27:56AM +0100, Thomas Richter wrote:
>>> On s390 the event instructions can not be used for recording.
>>> This event is only supported by perf stat.
>>>
>>> Change the event from instructions to cycles in
>>> subtest test_leader_sampling.
>>>
>>> Signed-off-by: Thomas Richter <tmricht@...ux.ibm.com>
>>> Suggested-by: James Clark <james.clark@...aro.org>
>>> Reviewed-by: James Clark <james.clark@...aro.org>
>>> ---
>>> tools/perf/tests/shell/record.sh | 10 +++++-----
>>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
>>> index fe2d05bcbb1f..ba8d873d3ca7 100755
>>> --- a/tools/perf/tests/shell/record.sh
>>> +++ b/tools/perf/tests/shell/record.sh
>>> @@ -231,7 +231,7 @@ test_cgroup() {
>>>
>>> test_leader_sampling() {
>>> echo "Basic leader sampling test"
>>> - if ! perf record -o "${perfdata}" -e "{instructions,instructions}:Su" -- \
>>> + if ! perf record -o "${perfdata}" -e "{cycles,cycles}:Su" -- \
>>> perf test -w brstack 2> /dev/null
>
> As a non-precise test, using cycles instead should be fine. But we
> should never use it for precise test, e.g., with p. Because cycles is a
> non-precise event. It would not surprise me if there is a skid when
> reading two cycles events at the point when the event overflow occurs.
>
> Reviewed-by: Kan Liang <kan.liang@...ux.intel.com>
Kan, I suppose you mean only the case without counter snapshot, right? With
counter snapshot's help, there would be same period even for non-precise
events, right?
>
> Thanks,
> Kan
>
>>> then
>>> echo "Leader sampling [Failed record]"
>>> @@ -243,15 +243,15 @@ test_leader_sampling() {
>>> while IFS= read -r line
>>> do
>>> # Check if the two instruction counts are equal in each record
>>> - instructions=$(echo $line | awk '{for(i=1;i<=NF;i++) if($i=="instructions:") print $(i-1)}')
>>> - if [ $(($index%2)) -ne 0 ] && [ ${instructions}x != ${prev_instructions}x ]
>>> + cycles=$(echo $line | awk '{for(i=1;i<=NF;i++) if($i=="cycles:") print $(i-1)}')
>>> + if [ $(($index%2)) -ne 0 ] && [ ${cycles}x != ${prev_cycles}x ]
>>> then
>>> - echo "Leader sampling [Failed inconsistent instructions count]"
>>> + echo "Leader sampling [Failed inconsistent cycles count]"
>>> err=1
>>> return
>>> fi
>>> index=$(($index+1))
>>> - prev_instructions=$instructions
>>> + prev_cycles=$cycles
>>> done < $script_output
>>> echo "Basic leader sampling test [Success]"
>>> }
>>> --
>>> 2.48.1
The code changes look good for me.
>
Powered by blists - more mailing lists