lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Apr 2021 11:14:51 +0800
From:   "Jin, Yao" <yao.jin@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
        mingo@...hat.com, alexander.shishkin@...ux.intel.com,
        Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
        kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v4 21/25] perf tests: Support 'Track with sched_switch'
 test for hybrid

Hi Jiri,

On 4/22/2021 2:28 AM, Jiri Olsa wrote:
> On Fri, Apr 16, 2021 at 10:05:13PM +0800, Jin Yao wrote:
>> Since for "cycles:u' on hybrid platform, it creates two "cycles".
>> So the number of events in evlist is not expected in next test
>> steps. Now we just use one event "cpu_core/cycles:u/" for hybrid.
>>
>>    # ./perf test 35
>>    35: Track with sched_switch                                         : Ok
>>
>> Signed-off-by: Jin Yao <yao.jin@...ux.intel.com>
>> ---
>>   tools/perf/tests/switch-tracking.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
>> index 3ebaa758df77..3a12176f8c46 100644
>> --- a/tools/perf/tests/switch-tracking.c
>> +++ b/tools/perf/tests/switch-tracking.c
>> @@ -18,6 +18,7 @@
>>   #include "record.h"
>>   #include "tests.h"
>>   #include "util/mmap.h"
>> +#include "pmu.h"
>>   
>>   static int spin_sleep(void)
>>   {
>> @@ -340,6 +341,10 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
>>   	struct evsel *switch_evsel, *tracking_evsel;
>>   	const char *comm;
>>   	int err = -1;
>> +	bool hybrid = false;
>> +
>> +	if (perf_pmu__has_hybrid())
>> +		hybrid = true;
>>   
>>   	threads = thread_map__new(-1, getpid(), UINT_MAX);
>>   	if (!threads) {
>> @@ -371,7 +376,10 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
>>   	cpu_clocks_evsel = evlist__last(evlist);
>>   
>>   	/* Second event */
>> -	err = parse_events(evlist, "cycles:u", NULL);
>> +	if (!hybrid)
> 
> why the variable? some leftover? could be directly
> 'if (perf_pmu__has_hybrid())' no?
> 

Yes, using 'if (perf_pmu__has_hybrid())' is the better style.

Thanks
Jin Yao

> thanks,
> jirka
>
>> +		err = parse_events(evlist, "cycles:u", NULL);
>> +	else
>> +		err = parse_events(evlist, "cpu_core/cycles/u", NULL);
>>   	if (err) {
>>   		pr_debug("Failed to parse event cycles:u\n");
>>   		goto out_err;
>> -- 
>> 2.17.1
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ